Operation
3-5
Either of the following statements turns off channels 1!1, 1!4
through 1!6, and the channels of M1:
PRINT #1, "output 07; open (@ 1!1, 1!4:1!6, M1)"
PRINT #1, "output 07; open all"
3.11 Scanning output channels
There are many commands associated with scanning. How-
ever, it is possible to configure a scan using as little as four
commands. These commands are listed as follows:
*RST
:TRIGger:COUNt:AUTo ON
:ROUTe:SCAN <list>
:INIT
The first command resets the mainframe to a default scan
configuration. The second command automatically sets the
channel count to the number of channels in the Scan List, the
third command defines the Scan List and the fourth com-
mand takes the Model 7001/7002 out of the idle state.
The following program fragment will perform a single scan
of output channels 1 through 4 of slot 1, and the channels that
make up channel pattern M1:
PRINT #1, "output 07; *rst"
PRINT #1, "output 07; trig:coun:auto on"
PRINT #1, "output 07; scan (@ 1!1:1!4, M1)"
PRINT #1, "output 07; init"
The first statement selects the *RST default configuration for
the scan. The second statement sets channel count to the
scan-list-length (5). The third statement defines the scan list,
and the last statement takes the mainframe out of the idle
state. The scan is configured to start as soon as the :INIT
command is executed.
When the above program fragment is run, the scan will be
completed in approximately 30 milliseconds (3msec delay
for channel closures and 3msec delay for each open), which
is too fast to view from the front panel. An additional relay
delay can be added to the program to slow down the scan for
viewing. The program is modified by adding a statement to
slow down the scan. Also, a statement is added to the begin-
ning of the program to ensure that all channels are open be-
fore the scan is started. The two additional statements are
indicated in bold typeface.
PRINT #1, "output 07; open all"
PRINT #1, "output 07; *rst"
PRINT #1, "output 07; trig:coun:auto on"
PRINT #1, "output 07; trig:del 0.5"
PRINT #1, "output 07; scan (@ 1!1:1!4, M1)"
PRINT #1, "output 07; init"
The first statement opens all channels, and the fourth state-
ment sets a 1/2 second delay after each channel closes.
3.12 Reading input channels
The following SCPI commands are used to read the status of
input channels:
:SENSe2:DATA? <list>
Read input channels; Slot 1
:SENSe3:DATA? <list>
Read input channels; Slot 2
:SENSe4:DATA? <list>
Read input channels; Slot 3
:SENSe5:DATA? <list>
Read input channels; Slot 4
:SENSe6:DATA? <list>
Read input channels; Slot 5
:SENSe7:DATA? <list>
Read input channels; Slot 6
:SENSe8:DATA? <list>
Read input channels; Slot 7
:SENSe9:DATA? <list>
Read input channels; Slot 8
:SENSe10:DATA? <list>
Read input channels; Slot 9
:SENSe11:DATA? <list>
Read input channels; Slot 10
The conventional form for the <list> parameter includes the
slot and input channel number. However, for these com-
mands you do not need to include the slot number. For exam-
ple, you can send either of the following two commands to
read input channel 23 in slot 6:
:SENSe7:DATA? (@6!23)
or
:SENSe7:DATA? (@23)
After the mainframe is addressed to talk, the response mes-
sage will indicate the state of each listed input channel. A re-
turned “0” indicates that the channel is off (open), and a
returned “1” indicates that the channel is on (closed).
The following program fragment reads channel 3 of a digital
I/O card installed in slot 1:
PRINT #1, "output 07; sens2:data? (@3)"
PRINT #1, "enter 07"
LINE INPUT #2, A$
PRINT A$
The first statement reads input channel 3 (slot 1). The second
statement addresses the mainframe to talk (sends response
message to computer). The third statement reads the re-
sponse message and the last statement displays the message
(0 or 1) on the computer CRT.
The above program fragment is modified to read all 40 input
channels in slot 1 as follows. The modified statement is
shown in bold typeface.