![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/e6/3e68ced7-e780-4a08-9488-535798d1c4ed/3e68ced7-e780-4a08-9488-535798d1c4ed-bg5d.png)
3 - 74 USING THE COMBISCOPE INSTRUMENTS
3.15.3 How to enable status reporting
The principle of using the status reporting mechanism is explained by showing two
program examples. In the first example the standard Status Byte (STB) is checked
to signal "operation completed". In the second example the SRQ mechanism is
used to signal "operation completed" by generating a Service Request.
3.15.3.1 Program example using the status byte (STB)
PROGRAM EXAMPLE:
In this example the standard status byte (STB) is checked to detect whether or
not a "CONFigure:AC" + "INITiate" operation is completed. If completed, the
program continues by fetching and printing the AC-RMS value.
CALL IBTMO(0, 13) ’
CALL Send(0, 8, "
*
RST", 1) ’
CALL Send(0, 8, "
*
ESE 1", 1) ’
Enables OPC-bit (0) in ESE
’"
OPeration Completed" is reported in bit 5 (ESB) of the STB after sending
*
.
’
CALL Send(0, 8, "CONFigure:AC", 1) ’
CALL Send(0, 8, "
*
OPC", 1)
’
This command forces the instrument to set the OPC bit
’
when all pending operations have been finished
.
’
CALL Send(0, 8, "INITiate", 1) ’
ESB.bit.set = 0
result$ = SPACE$(3)
WHILE ESB.bit.set = 0
CALL Send(0, 8, "
*
STB?", 1) ’
CALL Receive(0, 8, result$, 256) ’
IF (VAL(result$) AND 32) THEN ’
ESB.bit.set = 1 ’
END IF
WEND
CALL Send(0, 8, "FETCh:AC?", 1) ’
result$ = SPACE$(30)
CALL Receive(0, 8, result$, 256) ’
PRINT "AC-RMS value = "; result$ ’