5-7
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 240msec (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
before 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.
Reading digital I/O input channels
The following SCPI commands are used to read the status of
digital I/O 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 2 in slot 6:
:SENSe7:DATA? (@6!2)
or
:SENSe7:DATA? (@2)
After the mainframe is addressed to talk, the response mes-
sage will indicate the state of each listed input channel. A
returned “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
response message, and the last statement displays the mes-
sage (0 or 1) on the computer CRT.
The above program fragment is modified to read all ten dig-
ital I/O input channels in slot 1 as follows. The modifie
statement is shown in bold typeface.
PRINT #1, "output 07; sens2:data? (@1:10)"
PRINT #1, "enter 07"
LINE INPUT #2, A$
PRINT A$
The response message will include a “0” (off) or “1” (on) for
each of the ten input channels (i.e. “0, 0, 0, 1, 0..... 0, 1”).
Содержание 7037
Страница 7: ......
Страница 33: ...Card Connections and Installation 4 14...
Страница 61: ......
Страница 62: ......
Страница 63: ......
Страница 64: ......
Страница 65: ......
Страница 67: ......
Страница 68: ......
Страница 72: ...Keithley Instruments Inc 28775 Aurora Road Cleveland Ohio 44139 Printed in the U S A...