National Instruments GPIB-MAC User Manual page 135

Table of Contents

Advertisement

November 1985
Send serial port initialization programming messages, if necessary.
You can skip this for this example.
Send GPIB initialization programming messages, if necessary.
Again, you can skip this for this example.
Communicate with the device using wrt programming messages,
and reading back status after each. Here is the heart of the program!
After each wrt string, call the subroutine status which will check for
errors. The plotter's GPIB address is 5.
Following is the completed program.
APPENDIX H - SAMPLE PROGRAM
125
PRINT #l,"wrt 5"
PRINT #l,"in;spl,pal000,3000;ci500;"
status:
LINE INPUT #l,gpiberr$
LINE INPUT # 1 ,sperr$
LINE INPUT # 1 ,cnt$
PRINT status!§ gpiberr$ sperr$ cnt$
if stat% < 0 GOSUB error
OPEN "coml:9600,n,8,1" AS #l
PRINT #l,"stat c n"
PRINT # 1 ,"wrt 5"
PRINT #l,"in;spl,pa1000,3OOO;ci5OO;"
END

Advertisement

Table of Contents
loading

Table of Contents