User's Manual

R e m o t e C o n t r o l a n d P r o g r a m m i n g R e f e r e n c e f o r t h e F L U K E 1 9 0 f a m i l y o f S c o p e M e t e r ® t e s t t o o l s
p a g e 2 4
‘***************** Beginning of example program *****************
CLS ‘Clears the PC screen
OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1
PRINT #1, “IS” ‘Sends the INSTRUMENT STATUS query
GOSUB Acknowledge ‘Input acknowledge from ScopeMeter
INPUT #1, Status$ ‘Input Instrument Status
StV = VAL(Status$) ‘Decimal value of Instrument Status
PRINT “Instrument Status : “; StV
IF (StV AND 1) = 1 THEN PRINT “ ScopeMeter in Maintenance mode.”
IF (StV AND 2) = 2 THEN PRINT “ ScopeMeter charging.”
IF (StV AND 4) = 4 THEN PRINT “ ScopeMeter recording.”
IF (StV AND 8) = 8 THEN PRINT “ AutoRanging active”
IF (StV AND 16) = 16 THEN PRINT “ ScopeMeter remote.”
IF (StV AND 32) = 32 THEN PRINT “ Battery connected.”
IF (StV AND 64) = 64 THEN PRINT “ Power Adapter connected.”
IF (StV AND 128) = 128 THEN PRINT “ Calibration necessary.”
IF (StV AND 256) = 256 THEN PRINT “ ScopeMeter in HOLD.”
IF (StV AND 512) = 512 THEN PRINT “ Pre-calibration busy.”
IF (StV AND 1024) = 1024 THEN PRINT “ Pre-calibration valid.”
IF (StV AND 2048) = 2048 THEN PRINT “ Replay-buffer full.”
IF (StV AND 4096) = 4096 THEN PRINT “ ScopeMeter triggered.”
IF (StV AND 8192) = 8192 THEN PRINT “ ScopeMeter On.”
ELSE
PRINT “ ScopeMeter Off.”
END IF
IF (StV AND 16384) = 16384 THEN PRINT “ Reset Instrument occurred.”
END
‘******************* Acknowledge subroutine *********************
‘Use this subroutine after each command or query sent to the
‘ScopeMeter. This routine inputs the acknowledge response from
‘the ScopeMeter. If the response is non-zero, the previous
‘command was not correct or was not correctly received by
‘the ScopeMeter. Then an error message is displayed and
‘the program is aborted.
Acknowledge:
INPUT #1, ACK ‘Reads acknowledge from ScopeMeter.
IF ACK <> 0 THEN
PRINT “Error “; ACK; “: “;
SELECT CASE ACK
CASE 1
PRINT “Syntax Error”
CASE 2
PRINT “Execution Error”
CASE 3
PRINT “Synchronization Error”
CASE 4
PRINT “Communication Error”
CASE IS < 1
PRINT “Unknown Acknowledge”
CASE IS > 4
PRINT “Unknown Acknowledge”
END SELECT
PRINT “Program aborted.”
END
END IF
RETURN
‘******************** End of example program ********************