Пример #1
0
 public static string DecodeError(int code)
 {
     return(Marshal.PtrToStringAnsi(NativeLibrary.plc_tag_decode_error(code)));
 }
Пример #2
0
 /// <summary>
 /// Decode libplctag error code
 /// </summary>
 /// <param name="code">Error code</param>
 /// <returns></returns>
 public static string DecodeError(int code)
 {
     return(NativeLibrary.DecodeError(code));
 }
Пример #3
0
 /// <summary>
 /// Set local value UInt16
 /// </summary>
 /// <param name="tagHandle"></param>
 /// <param name="value"></param>
 /// <param name="offset"></param>
 private static int SetUInt16(int tagHandle, object value, int offset)
 {
     return(NativeLibrary.plc_tag_set_uint16(tagHandle, offset, (UInt16)value));
 }
Пример #4
0
        /// <summary>
        /// Set bit from index and value
        /// </summary>
        /// <param name="tagHandle"></param>
        /// <param name="value"></param>
        /// <param name="offset"></param>
        private static int SetBool(int tagHandle, object value, int offset)
        {
            byte byteValue = (byte)((bool)value ? 1 : 0);

            return(NativeLibrary.plc_tag_set_uint8(tagHandle, offset, byteValue));
        }
Пример #5
0
 /// <summary>
 /// Set local value Float
 /// </summary>
 /// <param name="tagHandle"></param>
 /// <param name="value"></param>
 /// <param name="offset"></param>
 private static int SetFloat64(int tagHandle, object value, int offset)
 {
     return(NativeLibrary.plc_tag_set_float64(tagHandle, offset, (double)value));
 }
Пример #6
0
 /// <summary>
 /// Set local value Int64
 /// </summary>
 /// <param name="tagHandle"></param>
 /// <param name="value"></param>
 /// <param name="offset"></param>
 private static int SetInt64(int tagHandle, object value, int offset)
 {
     return(NativeLibrary.plc_tag_set_int64(tagHandle, offset, (Int64)value));
 }