Program Example Using A Service Request (Srq) - Fluke CombiScope PM3370B User Manual

Autoranging instrument
Hide thumbs Also See for CombiScope PM3370B:
Table of Contents

Advertisement

USING THE COMBISCOPE INSTRUMENTS
3.15.3.2

Program example using a service request (SRQ)

PROGRAM EXAMPLE:
In this example the "Service Request" mechanism is used to detect whether or
not a "CONFigure:AC" + "INITiate" operation is completed. If completed, an SRQ
is generated to continue with fetching and printing the AC-RMS value.
SRQ.detected = 0
ON PEN GOSUB ServReq
PEN ON
CALL IBTMO(0, 13)
CALL Send(0, 8, " * RST", 1)
CALL Send(0, 8, " * ESE 1", 1)
'"OPeration Completed" is reported in bit 5 (ESB) of STB after sending * OPC.
'
CALL Send(0, 8, " * SRE 32", 1)
'SRQ generation after "OPeration Completed" is enabled.
'
CALL Send(0, 8, "CONFigure:AC", 1)
CALL Send(0, 8, "INITiate", 1)
CALL Send(0, 8, " * OPC", 1)
'This command forces the instrument to set the OPC bit in the STB
'when all pending operations have been finished.
'
WHILE SRQ.detected = 0
'Do something else while waiting for SRQ; continue when SRQ.detected = 1.
WEND
CALL Send(0, 8, "FETCh:AC?", 1)
result$ = SPACE$(30)
CALL Receive(0, 8, result$, 256)
PRINT "AC-RMS value = "; result$
END
'
ServReq:
PRINT "Service request generated because of Operation Completed."
CALL ReadStatusByte(0, 8, sbyte%)
'Serial polls for the status byte to reset the SRQ-mechanism.
'
PRINT "STB byte ="; sbyte%
CALL Send(0, 8, " * ESR?", 1)
'Queries for the contents of the Event Status Register to clear the OPC-bit.
'
resp$ = " "
CALL Receive(0, 8, resp$, 256)
PRINT "ESR byte = "; resp$
SRQ.detected = 1
RETURN
'Defines SRQ-routine
'Enables SRQ-routine
'Timeout at 10 seconds
'Resets the instrument
'Sets OPC-bit in ESR
'Sets ESB-bit in SRE-register
'Automatic configuration
'Single initiation
'Fetches AC-RMS value
'Reads AC-RMS value
'Prints AC-RMS value
3 - 75

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents