125
4
1032 ‘ Calculate the Frame Check Sum (FCS) for the entered command
1033 ‘
1034 FCS=0
1035 FOR IFCS=1 TO LEN(COMMAND$)
1036 FCS=FCS XOR ASC(MID$(COMMAND$,IFCS,1))
1037 NEXT
1038 FSC$=RIGHT$(“0”+HEX$(FCS),2)
1039 ‘
1040 ‘ Issue command packet to the instrument
1041 ‘
1042 PRINT #1, CFCS$
1043 ‘
1044 ‘ Receive the response packet back from the instrument
1045 ‘
1046 RCNT=0
1047 RECV$=””””
1048 RLOOP:
1049 ‘
1050 ‘ If the COM port buffer contains data then process data in RDATA loop otherwise
1051 ‘ keep track of time gone by since data has been entered into COM port buffer.
1052 ‘
1053 IF LOC(1) <> 0 THEN RDATA
1054 RCNT=RCNT+1
1055 ‘
1056 ‘ If no data has been entered into the COM port buffer by the time the counter RCNT
1057 ‘ reaches 100000 then indicate the instrument is not responding. If you receive the
1058 ‘ “No Response!” error too frequently then increase the error count value.
1059 ‘
1060 IF RCNT=100000 THEN RERROR
1061 ELSE RLOOP
1062 ‘
Chapter 4 - Remote Interface Reference
Example BASIC Control Program for IBM PC Compatible Machines
Summary of Contents for LFI-3751
Page 10: ...10 This page intentionally left blank ...
Page 13: ...1 Chapter 1 Quick Start 13 1 ...
Page 20: ...20 This page intentionally left blank ...
Page 21: ...2 Chapter 2 Front Panel Operation 21 2 ...
Page 34: ...34 This page intentionally left blank ...
Page 54: ...54 This page intentionally left blank ...
Page 68: ...68 This page intentionally left blank ...
Page 69: ...3 Chapter 3 Rear Panel Operation 69 3 ...
Page 75: ...3 4 Chapter 4 Remote Interface Reference 75 4 ...
Page 88: ...88 This page intentionally left blank ...
Page 127: ...5 Chapter 5 Specifications 127 5 ...
Page 131: ...Appendix CAT 220 Cable Accessory Diagram 131 ...