Object: DeviceIO
A DeviceIO object. The function GetDeviceIOs returns an array of this object type.
Properties
All these properties are read only. The name in brackets is the field name from the Device IOs table (where applicable).
Name | Type | Description |
---|---|---|
EquipmentName | String | Gets the equipment name the DeviceIO is attached to (Equipment Name) |
EquipmentTypeName | String | Gets the equipment type name for the DeviceIO entry (Equipment Type) |
StartBit | Integer | Gets the DeviceIO Start bit (Start Bit) |
Size | Integer | Gets the DeviceIO size (SizeElement) |
ElementSize | Integer | (1,2, or 4) Gets the DeviceIO element size. The size in bytes of the data element in the device e.g. 2 bytes is 16 bit WORD. Used for bit field validation and byte swapping for Network byte order systems. |
ScriptHandler | String | Gets the DeviceIO script handler name (Script Handler) |
Identifier | String | Gets the DeviceIO identifier property (Identifier/Property) or user defined property. |
IsOutput | Boolean | Gets the state of the type value. True if this DeviceIO is an Output (Type) |
DeviceName | String | Gets the DeviceIO Sevice this IO is attached to (Device) |
MessageNumber | Integer | Gets the message number for the DeviceIO (Message Type) |
InvertedLogic | Boolean | Gets the state of the InvertedLogic value (Inverted Logic) |
Comment | String | Gets the free form comment for this DeviceIO. Supports unicode for languages. |
UpdateRate | Integer | Gets the Update rate for the DeviceIO (Output UpdateRate) Only in CSV file |
Example
Print out all device IOs is the project
// Get all device IOs
var deviceIOs = GetDeviceIOs();
// Go through each device IO and log properties
for(var i=0; i<deviceIOs.length; i++) {
var io = deviceIOs[i];
LogDebug("Device EquipmentName = " + io.EquipmentName);
LogDebug("Device EquipmentTypeName = " + io.EquipmentTypeName);
LogDebug("Device StartBit = " + io.StartBit);
LogDebug("Device Size = " + io.Size);
LogDebug("Device ElementSize = " + io.ElementSize);
LogDebug("Device ScriptHandler = " + io.ScriptHandler);
LogDebug("Device Identifier = " + io.Identifier);
LogDebug("Device IsOutput = " + io.IsOutput);
LogDebug("Device DeviceName = " + io.DeviceName);
LogDebug("Device MessageType = " + io.MessageType);
LogDebug("Device UpdateRate = " + io.UpdateRate);
LogDebug("Device Comment = " + io.Comment);
}