User and Programming Manual
72
XDS
Series
INPUT "Enter Command ('quit' to exit)--> ", cmd$
IF cmd$ <> "QUIT" AND cmd$ <> "quit" THEN
IF cmd$ <> "" THEN
PRINT #1, cmd$ + CHR$(10);
END IF
IF INSTR(cmd$, "?") THEN
PRINT "Power supply query response = "; retstring$
END IF
'Check for Errors after each command is issued
PRINT "Sending non-query syntax check *ESR?"
'On fast PC's we may have to hold off between commands
FOR t = 0 TO 1000: NEXT t
PRINT #1, "*ESR?" + CHR$(10);
esr% = 0 'Clear last error
'Mask off bits 5,4,3,2 only. Other bits are not used.
esr% = VAL(retstring$) AND 60
'Process esr% value for error bits
IF esr% AND 4 THEN
PRINT "*** Query Error Reported by power supply ***"
END IF
IF esr% AND 8 THEN
PRINT "*** Instrument Dependent Error Reported by power supply ***"
END IF
IF esr% AND 16 THEN
PRINT "*** Command Execution Error Reported by power supply ***"
END IF
IF esr% AND 32 THEN
PRINT "*** Command Syntax Error Reported by power supply ***"
END IF
'Clear ERR. -XXX Message from front panel if any error occurred
IF esr% <> 0 THEN
PRINT #1, "*CLS" + CHR$(10);
END IF
END IF
LOOP UNTIL cmd$ = "QUIT" OR cmd$ = "quit"
'Close COM port on exit
CLOSE #1
END
'================================================================
FUNCTION retstring$
'This function returns a response string from the XDS Series
'power supply. The QBasic statement LINE INPUT cannot be used
'as the XDS Series does not return a CR <13> after a response
'message. The LINE INPUT function waits for a CR before
'returning a string. The P Series returns a LF <10> instead
'so we need to poll each returned character for a LF to
'assemble the response string. The COM port needs to be
'opened AS random with a record length of 1 for it to support
'this function. Also, the device number is assumed to be #1
'Optionally, this value could be passed as a parameter to
'make this program more generic.
DIM char AS STRING * 1
DIM resp AS STRING
char = ""
resp = ""
DO
char = INPUT$(1, #1)
resp = resp + char
LOOP UNTIL char = CHR$(10)
'Return result
retstring = LEFT$(resp, LEN(resp) - 1)
END FUNCTION
Содержание XDS 100-100
Страница 4: ...User and Programming Manual 4 XDS Series Electrical Safety Symbols Used in This Manual ...
Страница 27: ...User and Programming Manual XDS Series 27 Figure 3 5 Outline Drawing XDS DC Supply ...
Страница 41: ...User and Programming Manual XDS Series 41 Figure 5 4 Parallel Cable Interconnect Accessory ...
Страница 45: ...User and Programming Manual XDS Series 45 Figure 6 1 DC Power Supply Block Diagram IF option shown ...
Страница 69: ...User and Programming Manual XDS Series 69 Figure 8 3 Replaceable Fuse Locations ...