beautypg.com

Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 110

background image

II. SOFTWARE GUIDES - 8. Driver488/DRV

8J. Spreadsheets

Personal488 User’s Manual, Rev. 3.0

II-95

Now that we have identified the device that is requesting service, we can further examine the Serial
Poll status to classify the request. If

DIO6

is set, then the 195 is signaling an error condition. If that bit

is clear, then some non-error condition caused the

SRQ

:

195SRQ:
{IF DIO6}{BRANCH 195ERR}
{IF DIO5}{BEEP}
{GETLABEL “195 Status: BUSY. Press Return.”,TypeHere}
{IF DIO4}{BEEP}
{GETLABEL “195 Status: READING DONE. Press Return.”,TypeHere}
{IF DIO3}{BEEP}
{GETLABEL “195 Status: BUFFER 1/2 FULL. Press Return.” TypeHere}
{IF DIO2}{BEEP}
{GETLABEL “195 Status: BUFFER FULL. Press Return.”,TypeHere}
{IF DIO1}{BEEP}
{GETLABEL “195 Status: OVERFLOW. Press Return.”,TypeHere}
{RETURN}
195ERR:
{IF DIO5}{BEEP}
{GETLABEL “195 Status: FAILED SELFTEST. Press Return.”,TypeHere}
{IF DIO4}{BEEP}
{GETLABEL “195 Status: TRIGGER OVERRUN. Press Return.”,TypeHere}
{IF DIO3}{BEEP}
{GETLABEL “195 Status: NO REMOTE. Press Return.”,TypeHere}
{IF DIO2}{BEEP}
{GETLABEL “195 Status: ILLEGAL COMMAND. Press Return.”,TypeHere}
{IF DIO1}{BEEP}
{GETLABEL “195 Status: ILLEGAL COMMAND OPTION. Press
Return.”,TypeHere}

Finally, once we have diagnosed the service request, we are ready to return to the main program:

{RETURN}
Sample Program
{OPEN IEEE,W}
{WRITELN RESET}
{WRITELN EOL IN CR}
{WRITELN FILL ERROR}
{IeeeInit}
{WRITELN “HELLO”}
{READLN Hello}
{WRITELN “STATUS”}
{READLN Status}
{WRITELN “OUTPUT 16;F0R0X”}
{WRITELN ENTER 16}
{READLN Reading}
{LET Voltage,@VALUE(@MID(Reading,4,11))}
{FOR Index,0,9,1,Sum1}
Sum1:
WRITELN ENTER 16}
{READLN Reading}
{PUT Voltages,0,Index,@VALUE(@MID(Reading,4,11))}
{RETURN}
CheckSRQ:
{DEFINE Signal:VALUE}
{WRITELN SPOLL}
{READLN SP}
{LET SP,@VALUE(@MID(SP,0,@LENGTH(SP)-1))}
{IF SP=0}{BLANK ST195}{RETURN}
{WRITELN “OUTPUT 16;M2X”}
{WRITELN “STATUS”}
{READLN Status}
{CheckSRQ 10}
{WRITELN ENTER 16}
{READLN Reading}
{CHECKSRQ 20}
{WRITELN SPOLL 16}