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)); } }
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)); } }
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); } }