4-36
Programming
Example Programs
Err_mngmt:SUB Err_mngmt(OPTIONAL Cmd_msg$)
COM /Instrument/ @Mwmt
DIM Err_msg$[255]
INTEGER Cme
CLEAR @Mwm
REPEAT
OUTPUT @Mwm;"*ESR?"
ENTER @Mwm;Cme
OUTPUT @Mwm;":SYST:ERR?"
ENTER @Mwm;Err_msg$
IF NPAR>0 AND NOT POS(Err_msg$,"+0") THEN PRINT "This command ";Cmd_msg$;" makes
the following error :"
IF NOT POS(Err_msg$,"+0") THEN PRINT Err_msg$
UNTIL NOT BIT(Cme,2) AND NOT BIT(Cme,4) AND NOT BIT(Cme,5) AND POS(Err_msg$,"+0")
Subend:SUBEND
Set_ese:SUB Set_ese
COM /Instrument/ @Mwm
OUTPUT @Mwm;"*ESE ";IVAL("00110100",2)
SUBEND
Identity:DEF FNIdentity$;
COM /Instrument/ @Mwm
DIM Identity$[50]
Identity$=""
OUTPUT @Mwm;"*RST"
OUTPUT @Mwm;"*OPC?"
ENTER @Mwm;Opc_done
OUTPUT @Mwm;"*IDN?"
ENTER @Mwm;Identity$
RETURN Identity$
FNEND
Cmd_opc:SUB Cmd_opc(Set_cmd$)
COM /Instrument/ @Mwm
OUTPUT @Mwm;Set_cmd$
OUTPUT @Mwm;"*OPC?"
ENTER @Mwm;Opc_done$
SUBEND
Tempo:SUB Tempo(Temp)
FOR I=Temp TO 0 STEP -1)
DISP "Waiting for ";VAL$(I);" sec . . . "
WAIT 1
NEXT I
DISP ""
SUBEND