Fluke CombiScope PM3370B User Manual page 54

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

Advertisement

USING THE COMBISCOPE INSTRUMENTS
PROGRAM EXAMPLE:
In this program example a trace of 512 samples from the actual signal at input
channel 1 is read. The received data block is converted to an array of voltages. After
each sample conversion the voltage value is printed. This program example works
for traces of 512 samples, consisting of 8 bits (1 byte) or 16 bits (2 bytes) samples.
Note:
The program is supplied on floppy under file name EXCNVTRC.BAS.
DIM sample(512)
DIM response AS STRING * 1033
DIM peaktop AS STRING * 10
DIM offs AS STRING * 10
'
CALL Send(0, 8, " * RST", 1)
CALL Send(0, 8, "CONFigure:AC (@1)", 1)
CALL Send(0, 8, "INITiate", 1)
CALL Send(0, 8, " * WAI;TRACe? CH1", 1)
CALL Receive(0, 8, response$, 256)
'
nr.of.digits = VAL(MID$(response$, 2, 1))
nr.of.bytes = VAL(MID$(response$, 3, nr.of.digits)) - 2
sample.length = ASC(MID$(response$, 3 + nr.of.digits, 1))
nr.of.samples = nr.of.bytes / (sample.length / 8)
CALL Send(0, 8, "SENSe:VOLTage:RANGe:PTPeak?", 1)
CALL Receive(0, 8, peaktop$, 256)
ptpeak = VAL(LEFT$(peaktop$, IBCNT%))
CALL Send(0, 8, "SENSe:VOLTage:RANGe:OFFSet?", 1)
CALL Receive(0, 8, offs$, 256)
offset = VAL(LEFT$(offs$, IBCNT%))
IF sample.length = 1 THEN
FOR i = 1 TO nr.of.samples
trace% = ASC(MID$(response$, i + 3 + nr.of.digits, 1))
IF trace% > 127 THEN trace% = trace% - 256
END IF
sample(i) = trace% / 200 * ptpeak - offset
PRINT sample(i);
NEXT i
ELSE
FOR i = 1 TO nr.of.samples
J = 2 * i + 2 + nr.of.digits
byte1 = ASC(MID$(response$, J, 1))
byte2 = ASC(MID$(response$, J + 1, 1))
IF byte1 < 128 THEN trace% = byte1 * 256 + byte2
ELSE trace% = (byte1 - 256) * 256 + byte2
END IF
sample(i) = trace% / 51200 * ptpeak - offset
PRINT sample(i);
NEXT i
END IF
'Array of sample voltages
'Trace data response string
'Peak-to-peak response string
'Offset response string
'Resets the instrument
'Configures for optimal AC-RMS settings
'Signal-offset also becomes zero
'Initiates single acquisition
'Requests channel 1 trace
'Reads channel 1 trace
'Queries ptp
'Reads ptp
'IBCNT% = length
'Queries offset
'Reads offset
'IBCNT% = length
'1-byte samples
'2-byte samples
'Pointer to next sample
'M.S.B.
'L.S.B.
3 - 35

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents