An IOPort object represents a single IO port on a CF device or module. Since ports can be configured to perform several functions, you can obtain the current port mode by reading the CFLink.IOPort.mode property, which is one of the values in CFLink.IOPort.Mode.

This class is a low-level object that you shouldn't need to use directly. Use the convenience methods in the device classes instead.
Instances of this object are being created for you by the device class that holds the port (i.e. CFLink.CFMini, CFLink.DINMOD4).
Members

deviceID :String

The CFLink device ID of the device holding this port

minChange :Number

For port modes that support it (i.e. voltage digital trigger), the minimum change that triggers a state change

mode :CFLink.IOPort.Mode

The current Mode of this port. Do not change it directly

portNumber :Number

The port number for this port in the device (starts at 1)

portNumberString :String

The port number of this port, as a string

powerOnState :Number

The power-on state of this port, when application (otherwise, 0)

state :Number

The current state of the port. Do not change it directly. For I/O ports configured as relay ports, state is either 0 (open) or 1 (closed) For I/O ports configured as dry contact inputs, voltage trigger or video sensing input, it is 0 or 1 For I/O ports configured for voltage or resistance reading, it is the actual value read on the port.

<static, constant> CONFIGURATION_CHANGE

Event fired when an IOPort's configuration changes Your callback function for watching this event should be of the type: function(event, sender, portObject) the portObject is an object of type CFLink.IOPort. From it, you can obtain the current mode and state. This event is also sent by LED subclasses (for specialized LEDs on SW16 and others)

<static> Mode

Constants defining the mode an I/O port can be configured to
Name Value Description
DRY_CONTACT D Port configured as a dry contact input @constant
RESISTANCE_READING R Port configured for reading resistance values up to 10000 ohms
VOLTAGE_TRIGGER V Port configured as a digital trigger based on input voltage (will return 0 or 1)
VOLTAGE_READING A Port configured as an analog voltage (0.0v to 10.0v) reading input
VIDEO_SENSING S Port configured to sense video signals
RELAY_CONTROL_OUTPUT E port is an external relay control output (0-24V DC)
LED_OUTPUT L Port configured as an external LED output (1ma)

<static, constant> VALUE_CHANGE

Event fired when the value (input or output) of an I/O port changes. For example, a different voltage could have been read, or a relay could have been closed. Your callback function for watching this event should be of the type: function(event, sender, portObject, oldValue, newValue) the portObject is an object of type CFLink.IOPort. From it, you can obtain the current mode as well. the oldValue is the previous value (-1 the first time one is received) the newValue is the new value