No-Swap Mode - National Instruments GPIB-232CV-A User Manual

Ieee 488 rs-232 converter
Table of Contents

Advertisement

Chapter 3
Operation of the GPIB-232CV-A
GPIB-232CV-A User Manual
Line 20 of the program outputs plotter commands to the serial port to both
draw a line and obtain status. Because neither a <CR> nor <LF> is sent
between these commands, the GPIB-232CV-A keeps the GPIB plotter
addressed to listen and sends all serial data received to the plotter. Because
the
statement is not ended with a semicolon after the double
PRINT
quotation mark, BASIC automatically sends a <CR> after the last character
in the ASCII string is sent. If the GPIB-232CV-A is set up for <CR>
termination, the GPIB-232CV-A then readdresses the plotter to talk so that
its status can be output.
Line 30 inputs the status response from the plotter into the string variable
.
RESPONSE$
Line 40 outputs the plotter command to the GPIB-232CV-A to draw a
circle. As soon as the GPIB-232CV-A receives the first character in this
string, it readdresses the plotter to listen and then sends these characters to
it. Notice that for this
PRINT
double quotation mark. This means a <CR> is not sent. Because no
information is requested from the plotter, there is no need to send a <CR>
at the end of the string to address the plotter to talk.

No-Swap Mode

In no-swap mode, the GPIB-232CV-A never readdresses a GPIB device
after it has initially been addressed as a Listener. To select no-swap mode,
set SW1 switches 6 and 7 to ON.
This mode is useful if your device is intended only to receive data. In the
example given in the
<CR> or <LF> Termination Mode
chapter, you could use the no-swap mode to talk to the plotter if you never
needed to obtain status information from it. By adding a semicolon after the
double quotation mark at the end of line 20 as shown below, you suppress
the <CR>. Since you cannot readdress in no-swap mode, the <CR> is not
needed to obtain status as it was in the previous example.
10 OPEN "COM1:9600,n,8,1" AS #1
20 PRINT #1,"pa1000,1000";
statement a semicolon is included after the last
3-10
section of this
'Assumes
'GPIB-232CV-A is
'at 9600 baud,
'no parity, 8
'data bits, 1
'stop bit.
'Plot absolute to
'1000,1000.
www.ni.com

Advertisement

Table of Contents
loading

Table of Contents