A.2 the output pin (pin 9) – Campbell Scientific SDM-SIO1 Serial Input/Output Module User Manual
Page 30
Appendix A. Using the Handshaking Lines for General Input/Output
‘IF value returned is over 4095 then input line is high
‘ELSE input line must be low
If ChkValReturned > 4095 Then
InputStatus
=
1
‘Flag that input line is high
else
InputStatus
=
0
‘Flag input line is low
EndIf
…
next scan
…
The input line can accept 0 and 5V logic inputs OR -12 and +12V RS-232 level
inputs. Below is a break down of the different input voltages allowed and the
state of the input line flag.
Voltage on the input line State of bit 16
+12V 1
-12V 0
5V 1
0V 0
A.2 The Output Pin (Pin 9)
To set the spare output pin (pin 9) you must use the ‘SerialOutBlock’
command.
The spare I/O lines are RS-232 lines NOT logic lines. This means that the
output line voltage is -12V and +12V (approximately) not 0 and 5V.
The following examples show you how to set the output pin using the
SerialOutBlock() instruction.
CRBasic example for setting the output pin
SerialOutBlock(32, 1, 0) ‘This will set the spare output pin high
SerialOutBlock(32, 0, 0) ‘This will set the spare output pin low
The two example lines of code above will set the output pin on the SDM-SIO1
high then low respectively on the SDM-SIO1 device set to address 0 on its
rotary switch.
Any value greater than 1 will set the output pin high, but usually the number 1
is used, as this will improve the readability of he code.
A-2