Chapter 7:
Power, Environmental & Digital I/O
174
For example, to set pin 1 to a low output, type:
ioc -p 1 -d 0 -v 0
To pulse one of these outputs, use a script like the following:
ioc -p 1 -d 0 -v 1
sleep 1
ioc -p 1 -d 0 -v 0
This will set the output high for 1 second, return it to low (assuming the initial state is low)
7.4.2 Digital I/O Input Configuration
When either of the two digital I/O (DIO1 & DIO2) outlets is configured as an Input on the
System > I/O
Ports
, it can be used to monitor the current status of any attached sensor.
When configured as inputs (and this is the factory default) these first two ports are notionally attached to
an internal EMD. To configure them as alarms, go to the Environmental page and edit and enable the
Internal EMD.
The low voltage circuits in DIO1 and DIO2 should not be wired to voltages greater than 5V DC.
These input ports can be monitored using the ioc command line utility (as detailed in the previous section)
7.4.3 High Voltage Outputs
OUT1 and OUT2 (internally DIO3 & DIO4) outlets are wired as high voltage outputs. The way these outputs
are expected to be used is to pull a power connected line to ground (i.e. the OUT1 and OUT2 transistors
are open collector).
The I/O port header includes a 12v reference line (VIN) which can be used to detect the line state change.
For example, to light a 12v LED using the high voltage outputs, connect the positive leg of the LED to the
12v reference, and the negative leg to output pin 4. Due to the way that the I/O port is connected internally,
the output has to be set
high
to pull the output to ground.
The following command will switch on the led:
ioc -p 4 -d 0 -v 1
OUT1 and OUT2 transistors can operate with a supply of >5V to <= 30V @100mA. This means to drive a
relay circuit you must guarantee it doesn't provide more than 100mA when set to 1.
7.4.4 DIO SNMP status
There is a SNMP status table (with V3.9 and later) which reports on the status of the digital IO ports. The
table OID is OG-STATUSv2-MIB::ogEmdDioTable. Performing an snmpwalk on this table on a console
server with DIO produces something like (will vary depending on device status):
$ snmpwalk -v2c -c public -M $MIBSDIR -m ALL t5:161
1.3.6.1.4.1.25049.16.5
OG-STATUS-MIB::ogDioStatusName.1 = STRING: DIO 1
OG-STATUS-MIB::ogDioStatusName.2 = STRING: DIO 2
OG-STATUS-MIB::ogDioStatusName.3 = STRING: DIO 3
OG-STATUS-MIB::ogDioStatusName.4 = STRING: DIO 4
OG-STATUS-MIB::ogDioStatusType.1 = INTEGER: ttlInputOutput(0)
OG-STATUS-MIB::ogDioStatusType.2 = INTEGER: ttlInputOutput(0)
OG-STATUS-MIB::ogDioStatusType.3 = INTEGER: highVoltageOutput(1)
OG-STATUS-MIB::ogDioStatusType.4 = INTEGER: highVoltageOutput(1)
OG-STATUS-MIB::ogDioStatusDirection.1 = INTEGER: input(1)
OG-STATUS-MIB::ogDioStatusDirection.2 = INTEGER: input(1)
OG-STATUS-MIB::ogDioStatusDirection.3 = INTEGER: input(1)