beautypg.com

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

Page 270

background image

A

P P E N D I X

I :

Program Examples

264

ISSUED: February 2005

WM-RCM-E Rev D

BaseListen% = 32 : BaseTalk% = 64
DSOAddress% = 4
DSOListen$ = UnListen$ + UnTalk$ + Chr$ (BaseTalk%) + Chr$ (BaseListen% +
DSOAddress%)
DSOTalk$ = UnListen$ + UnTalk$ + Chr$ (BaseListener%) + Chr$ (BaseTalk% +
DSOAddress%)

BDNAME$= "GPIB0" : CALL IBFIND (BDNAME$,BRD0%)

IF BRD0% < 0 THEN PRINT “IBFIND ERROR” : STOP

CALL IBSIC (BRD0%) :

IF IBSTA% < 0 THEN PRINT “IBFIND ERROR” : STOP

LOOP = 1

WHILE LOOP

LINE INPUT "Enter command (EX --> Exit) : ",CMD$

V% = 1: CALL IBSRE(BRD0%,V%)

IF CMD$ = "ex" OR CMD$ = "EX" THEN LOOP = FALSE : GOTO ExitGPIB

IF CMD$ = "st" OR CMD$ = "ST" THEN GOSUB StoreData : GOTO LoopEnd

IF CMD$ = "rc" OR CMD$ = "RC" THEN GOSUB RecallData : GOTO LoopEnd

IF CMD$ = "lc" OR CMD$ = "LC" THEN GOSUB DSOLocal : GOTO LoopEnd

IF CMD$ = "" THEN GOTO LoopEnd

CALL IBCMD (BRD0%,DSOListen$) : CALL IBWRT(BRD0%,CMD$): GOSUB GetData

LoopEnd : WEND


ExitGPIB : CALL IBSIC (BRD0%): V%=0 : CALL IBSRE (BRD0%,V%)
CALL IBSIC (BRD0%) : END

DSOLocal :
V% = 0 : CALL IBSRE (BRD0%,V%) : PRINT : RETURN

GetData :
CALL IBCMD (BRD0%,DSOTalk$) : CALL IBRD ( BRD0%,RD$) : I=IBCNT%

FOR J=1 TO I

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

NEXT J

PRINT : RETURN

StoreData :
RD1$=SPACE$(3)
LINE INPUT "Specify trace (TA...TD,M1...M4,C1...C4) : ",TRACE$
LINE INPUT "Enter filename : ",FILE$
CALL IBCMD (BRD0%, DSOListen$)
CMD$="WFSU NP,0,SP,0,FP,0,SN,0;CHDR SHORT"
CALL IBWRT (BRD0%,CMD$)
CMD$=TRACE$+":WF?": CALL IBWRT (BRD0%,CMD$)
CALL IBCMD (BRD0%,DSOTalk$) : CALL IBRD (BRD0%,RD1$)
CALL IBRDF (BRD0%,FILE$)

IF IBSTA% < 0 THEN GOSUB GPIBError : STOP

PRINT : RETURN

RecallData :