Appendix E - Common Questions - National Instruments GPIB-MAC User Manual

Table of Contents

Advertisement

November 1985
Appendix E
Common Questions
This appendix gives answers to common questions.
Question
Why does the manual suggest that I use INPUT$ sometimes and
LINE INPUT# at other times? Microsoft suggests using INPUT$
to read from the serial port
Answer
Use LINE INPUT# to read status information from the GPIB-
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 INPUT# allows you to easily
read each piece of status information and assign it to a variable.
Use INPUT$ to read a data string from your GPIB-device.
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 INPUT$ to read the
number of bytes you requested in your rd function. The GPIB-
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 INPUT$, use LINE INPUT# 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

Advertisement

Table of Contents
loading

Table of Contents