beautypg.com

Program examples – Teledyne LeCroy X-STREAM OSCILLOSCOPES Remote Control User Manual

Page 268

background image

A

P P E N D I X

I :

Program Examples

262

ISSUED: February 2005

WM-RCM-E Rev D

CALL

IBWRT(SCOPE%,CMD$)

IF IBSTA% < 0 THEN GOSUB GPIBError : END

GOSUB

GetData

LoopEnd : WEND

LocalMode:

Put DSO into Local Mode.

CALL IBLOC (SCOPE%) : PRINT
RETURN

GetData :

Get data from DSO.

'

If there are no data to read, simply wait until timeout occurs

CALL IBRD (SCOPE%,RD$)
I = IBCNT% 'IBCNT% is the number of characters read

FOR J = 1 TO I

PRINT MID$ (RD$,J,1);

NEXT J

PRINT : RETURN

StoreData :

Store waveform data in a file.

RD1$=SPACE$(3)
LINE INPUT "Specify trace (TA...TD,M1...M4,C1...C4): ",TRACE$
LINE INPUT "Enter filename : ",FILE$
CMD$="WFSU NP,0,SP,0,FP,0,SN,0; CHDR SHORT"
CALL IBWRT (SCOPE%,CMD$)
CMD$=TRACE$+":WF?"
CALL IBWRT (SCOPE%,CMD$)
CALL IBRD (SCOPE%,RD1$) ' Discard first 3 chars of response
CALL IBRDF (SCOPE%,FILE$)

IF IBSTA% < 0 THEN GODUB GPIBError : END

PRINT : RETURN


RecallData :

Recall waveform data from file and send them to DSO.

LINE INPUT "Specify target memory (M1...M4):",MEM$
LINE INPUT "Enter filename : ",FILE$
CMD$=MEM$+":"
CALL IBWRT (SCOPE%,CMD$)
CALL IBWRTF (SCOPE%,FILE$)
IF IBSTA% < 0 THEN GOSUB GPIB Error : END
RETURN

GPIBError:
PRINT "GPIB ERROR -- IBERR: ";IBERR%;"IBSTA: ";HEX$(IBSTA%) : RETURN