
November 1985
Appendix E
Common Questions
National Instruments
This appendix gives answers to common questions.
Question
Why does the manual suggest that I use
sometimes and
LINE
at other times? Microsoft suggests using
to read from the serial port
Answer
Use LINE
to read status information from the
MAC. GPIB-MAC software formats its status information so that
your BASIC program may easily read and interpret each of its
pieces. Each logical piece of status information is followed by a
carriage return and linefeed. LINE
allows you to easily
read each piece of status information and assign it to a variable.
Use
to read a data string from your GPIB-device.
requires that you know the exact number of characters you
wish to read from the serial port. When reading status information
from the GPIB-MAC, this is not always possible since the
responses may vary in length from one call to the next. But when
reading a data string from your GPIB device, you requested a
certain number of bytes and you should use
to read the
number of bytes you requested in your rd function. The
MAC appends to the end of the data string a string containing the
number of bytes that were actually read from the GPIB. So once
you read in the data bytes using
use LINE
to
read the string containing the byte count. Refer to the example
following the rd function description in Section Four.
115
APPENDIX E COMMON QUESTIONS