3.7 Program examples for setting the parameters
‘Sample Remote Control Commands for A-series CM31 with RS232 Interface
CLS
‘initialize constants
NAK$ = CHR$(21): ACK$ = CHR$(6)
‘opening RS232 comunication
OPEN “COM1:2400,N,8,1,rs,cs,ds,cd“ FOR RANDOM AS #1
LOCATE 1, 1: PRINT “Sample Control Program for Leybold A-Series Gauge“;
LOCATE 2, 1: PRINT “COMBIVAC CM31 with RS232-Interface“;
‘ set display to PM measurement channel
PRINT #1, “dsp w pm1“
‘ command: set display to PM
LINE INPUT #1, AckNakTest$
‘ get handshake character from CM31
DO
‘ start point of the never ending loop
CLS
‘ cold cathode high voltage on (to PM measurement channel)
PRINT #1, “HVs w pm1,On“
‘ send output command to CM31: PM high voltage on
LINE INPUT #1, AckNakTest$
‘ get handshake character from CM31
IF AckNakTest$ <> ACK$ THEN
‘ test for <ACK>/<NAK> character
PRINT #1, “eri r“
‘ if <NAK>, then request CM31 error code
LINE INPUT #1, AckNakTest$
‘ get handshake character (without test)
LINE INPUT #1, FailMessg$
‘ get error code from CM31
LOCATE 4, 1: PRINT SPACE$(79);
‘ clear screen line
LOCATE 4, 1: PRINT “RS232 failure on cold cathode high voltage on command: “;
LOCATE 4, 40: PRINT FailMessg$;
’ error code to screen
ELSE
LOCATE 4, 1: PRINT SPACE$(79);
‘ clear screen line
LOCATE 4, 1: PRINT “CM31 PM high voltage on successful“;
END IF
‘ read cold cathode high voltage status (from CM31 PM measurement channel)
PRINT #1, “hVs R PM1“
‘ command: read cold cathode voltage status
LINE INPUT #1, AckNakTest$
‘ get handshake character from CM31
IF AckNakTest$ <> ACK$ THEN
‘ test for <ACK>/<NAK> character
PRINT #1, “eri r“
‘ if <NAK>, then request CM31 error code
LINE INPUT #1, AckNakTest$
‘ get handshake character (without test)
LINE INPUT #1, FailMessg$
‘ get error code from CM31
LOCATE 5, 1: PRINT SPACE$(79);
‘ clear screen line
LOCATE 5, 1: PRINT “failure on reading HV status of PM channel: “;
LOCATE 5, 40: PRINT FailMessg$;
‘ error code to screen
ELSE
LINE INPUT #1, HvStatus$
‘ if no failure then get HV status
LOCATE 5, 1: PRINT SPACE$(79);
‘ clear screen line
LOCATE 5, 1: PRINT “PM HV status: “;
LOCATE 5, 40: PRINT HvStatus$;
‘ PM HV status to screen
END IF
‚
30
Summary of Contents for 157 89
Page 36: ...5 Brief operating instructions 36...
Page 38: ...38...