Appendix A API Command Reference
NetScan Users Manual A-35
O - Set Digital Outputs
TYPE
System
EXECUTION
Immediate
SYNTAX
Obank1,
bank2,
bank3,
bank4
Set any of the 32 digital outputs (separated into four 8-bit banks) to a
specified setting, where bankn (for n = 1, 2, 3, 4) is an argument in the
form of the number nnn such that 000 < nnn < 255 when converted to
binary format represents the desired settings for the 8-bit bank.
O?
Query current state of digital output.
DESCRIPTION
The Set Digital Outputs (O) command may be used to force any of the 32 digital out put s (separated into four 8-bit
banks) on the unit to a certain setting. The Bank to Digital Output mapping is as follows:
Bank
Digital Output
1
01 - 08
2
09 - 16
3
17 - 24
4
25 - 32
Each argument bankn represents the desired bit mapping for the corresponding bank of digital out puts. The
argument is a decimal number, which, when converted to binary format is the desired s ettings for that bank of
digital outputs. For example, an argument of 201 for bank2 would be interpreted in binary as 11001001 (with
1 as active high and 0 as active low). This would affect the digital outputs of Bank 2 as foll ows:
Bank 2 Digital Outputs
9
10
11
12
13
14
15
16
high
high
low
low
high
low
low
high
Note: The setting of a bank will force the digital outputs to the specified setting regardless of the current s tate of
the digital outputs (such as if an alarm has been assigned to the output).
If it is desired to not affect a certain bank (maybe because it is bei ng us ed for alarm outputs), a value of 999 can
be used for the argument for that bank. This will effectively mask off that bank from being updated.
There are 8 digital input lines and 32 digital output lines available on a rear panel DB50 connector. The digital
output can be controlled either automatically via the alarm settings or manual l y us ing the Set Digital Outputs (O)
command. To determine the digital output state, use the User Stat us (U) commands.
The Set Digital Outputs (O) command allows you to enter an output range and specify whether the output s houl d
be cleared (logic false) or set (logic true). This command will force the specified digital output to the specified
condition. A 1 will drive the corresponding digital output(s) high. Conversely, a 0 will drive the corresponding
digital output(s) low.
Each digital output line will drive 5 standard TTL loads. All digital input lines are one-eighth (0.125) TTL loads. All
inputs are protected against damage from high static voltages. Normal prec autions should be taken to limit the
input voltages to 0.3 to 5.3 volts. All digital I/O lines are referenced to digi t al ground.
EXAMPLE
PRINT#1, O?X
Get the current state of the digital outputs banks
LINE INPUT #1, N$
PRINT N$
Screen shows O128,255,065,024
PRINT#1, O0,999,76,234X
Set Banks 1, 3, and 4
PRINT#1, O?X
Get the current state of the digital outputs
LINE INPUT #1, O$
PRINT O$
Screen shows O000,255,076,234
Note that Bank 2 did not change