예제 #1
0
 public ItemData <bool> ReadBit(DeviceAddress address)
 {
     if (IsClosed)
     {
         return(new ItemData <bool>(false, 0, QUALITIES.QUALITY_NOT_CONNECTED));
     }
     else
     {
         LGX_Read *data = Tuxeip_Class._ReadLgxData(session, connection, GetAddress(address), 1);
         return(new ItemData <bool>(Tuxeip_Class._GetLGXValueAsInteger(data, 0) > 0, 0, QUALITIES.QUALITY_GOOD));
     }
 }
예제 #2
0
 public ItemData <ushort> ReadUInt16(DeviceAddress address)
 {
     if (IsClosed)
     {
         return(new ItemData <ushort>(0, 0, QUALITIES.QUALITY_NOT_CONNECTED));
     }
     else
     {
         LGX_Read *data = Tuxeip_Class._ReadLgxData(session, connection, GetAddress(address), 1);
         return(new ItemData <ushort>((ushort)Tuxeip_Class._GetLGXValueAsInteger(data, 0), 0, QUALITIES.QUALITY_GOOD));
     }
 }
예제 #3
0
 public float[] ReadFloatArray(DeviceAddress address, ushort size)
 {
     if (IsClosed)
     {
         return(null);
     }
     else
     {
         float[]   buffer = new float[size]; address.VarType = DataType.FLOAT; var addr = GetAddress(address);
         LGX_Read *data = Tuxeip_Class._ReadLgxData(session, connection, addr, size);
         if (data != null && data->Varcount > 0)
         {
             for (int i = 0; i < data->Varcount; i++)
             {
                 buffer[i] = Tuxeip_Class._GetLGXValueAsFloat(data, i);
             }
             data = null;
             return(buffer);
         }
         connection = null;
         return(null);
     }
 }
예제 #4
0
 public static extern float _GetLGXValueAsFloat(LGX_Read *reply, int index);
예제 #5
0
 public static extern int _GetLGXValueAsInteger(LGX_Read *reply, int index);