Chapter 3
Operation of the GPIB-232CV-A
©
National Instruments Corporation
3-9
In timeout termination mode, the GPIB-232CV-A addresses the GPIB
device to talk, and any characters read from the GPIB port are passed along
immediately to the serial port. When a serial character is received by the
GPIB-232CV-A, it immediately readdresses the GPIB device to listen and
passes the character to it. It remains in this mode until its serial input buffer
becomes empty and no serial characters are received for 300 ms. After this
period of inactivity, the GPIB-232CV-A assumes that since no more serial
data is being sent, the device might have data that it needs to send back to
the GPIB-232CV-A. It then readdresses the device to talk and passes any
characters read from the GPIB port along to the serial port.
<CR> or <LF> Termination Mode
If a command string to the GPIB instrument can be terminated with either
a <CR> (carriage return) or <LF> (linefeed) character, you can use either
termination with <CR> or <LF> to readdress the GPIB device to send data.
To select <CR> mode, set SW1 switch 6 to ON and 7 to OFF. To select
<LF> mode, set SW1 switch 6 to OFF and 7 to ON.
In these modes, when the GPIB-232CV-A receives the terminating
character from the serial port, it addresses the device to talk so that any
GPIB data can be input by the GPIB-232CV-A. Then any serial character
received by the GPIB-232CV-A signals the GPIB-232CV-A to readdress
the GPIB device as a Listener. For example, you might want to connect an
HP7475 GPIB plotter to an IBM PC serial port using the GPIB-232CV-A.
To then draw a line, get plotter status, and draw a circle you could use the
following BASIC commands:
10
OPEN "COM1:9600,n,8,1" AS #1
'Assumes
'GPIB-232CV-A is
'at 9600 baud,
'no parity, 8
'data bits, 1
'stop bit.
20
PRINT #1,"pa1000,1000 os"
'Plot absolute to
'1000,1000 then
'output status.
30
LINE INPUT #1,RESPONSE$
'Get status
'response from
'plotter.
40
PRINT #1 "ci100";
'Draw circle
'with radius of
'100 units.