3-31
3
3.8
PROGRAMMING GUIDELINES
This section shows the user how to program the 4863/2363 to transfer data,
to configure the unit, how to use the IEEE-488.2 Status Reporting Structure
to generate SRQs, binary data transfer, programming the IDN message and
saving the configuration. For additional examples, check the Application
Notes page at http:\\www.icselect.com.
3.8.1
Simple Port and Bit Commands
The Digital I/O lines can be programmed or read without configuring the
unit. The SOURce:DATA:PORTn command writes directly to any byte.
The ROUTe commands set or clear a specific output bit. The
SENSe:DATA:PORTn? query reads from any byte and SENSe:BIT? reads
a specific bit. These commands automatically set the port as an input or as
an output. The SENSe and SOURce branches have a :POLarity command
that sets each bit's logically true state.
The following commands set bits on the Digital I/O connector:
SOURCe:DATA:PORT1 5
'sets CH1 and CH3 on
using the default polarity
SOURCe:DATA:PORT2:POL #h00
'sets byte 2 to low true
polarity
SOURCe:DATA:PORT2 0
'sets all byte 2 lines false
(high)
SOURCe:DATA:PORT2 #h13
'sets CH 9, 10 and 13
true (low) (bits 0,1and 4)
SOURCe:DATA:PORT2?
'reads last output value
ROUTe:CLOSe 2,1
'sets bit 2 on byte 2 true
ROUTe:OPEN 2,5
'sets bit 6 on byte 2 false
The following commands read data from the Digital I/O connector. The
input lines will be high unless connected to some device.
SENSe:DATA:PORT3
'reads state of byte 3 lines
SENSe:BIT? 3,0
'reads bit 1 on byte 3
To read contact closures to ground at byte 3, set the polarity to low true.
SENSe:DATA:PORT3:POL 0
'sets byte 3 polarity
for low true