! Instrument Driver for the HP 547x0 series Modular Digitizing Oscilloscopes ! Rev. A.00.06 ! Copyright (C) Hewlett-Packard Co. 1992 - 1995. All rights reserved. ! REVISION 2.00; INITIALIZE RESET; ERROR COMPONENT stat_err; STORE COMPONENT STORE_STATE; RECALL COMPONENT RECALL_STATE; update component auto_update; eol 10; component bogus nogen noerrcheck; type integer; initial invalid; set actions; if livemode then; output string "*CLS;*SRE 32;*ESE 1"; flush; output string "*OPC?;*OPC"; flush; wait spoll bit 5; enter stack format K; drop ; end if; invalidate bogus; end actions; end component; COMPONENT Plug_in1 ; TYPE DISCRETE; VALUES EMPTY,HP54711A,HP54712A,HP54713A,HP54721A,HP54722A; INITIAL EMPTY; SET ACTIONS; END ACTIONS; GET ACTIONS Get_plug_in1; END COMPONENT; COMPONENT Plug_in2 ; TYPE DISCRETE; VALUES EMPTY,HP54711A,HP54712A,HP54713A,HP54721A,dum22; INITIAL EMPTY; SET ACTIONS; END ACTIONS; GET ACTIONS Get_plug_in2; END COMPONENT; COMPONENT Plug_in3 ; TYPE DISCRETE; VALUES EMPTY,HP54711A,HP54712A,HP54713A,HP54721A,dum22; INITIAL EMPTY; SET ACTIONS; END ACTIONS; GET ACTIONS get_plug_in3; END COMPONENT; COMPONENT Plug_in4 ; TYPE DISCRETE; VALUES EMPTY,HP54711A,HP54712A,HP54713A,HP54721A,dum22; INITIAL EMPTY; SET ACTIONS; END ACTIONS; GET ACTIONS Get_plug_in4; END COMPONENT; COMPONENT Mainframe ; TYPE DISCRETE; VALUES HP54710A,HP54720A; INITIAL HP54720A; GET ACTIONS Get_mainframe; END COMPONENT; COMPONENT First_Plug_In ; TYPE INTEGER ; VALUES RANGE 0,4,1 ; INITIAL 0 ; GET ACTIONS Get_First_Plug_In ; END COMPONENT ; COMPONENT SLOT_11A ; TYPE INTEGER ; VALUES RANGE 0,4,1 ; INITIAL 0 ; END COMPONENT ; COMPONENT SLOT_12A ; TYPE INTEGER ; VALUES RANGE 0,4,1 ; INITIAL 0 ; END COMPONENT ; COMPONENT SLOT_13A ; TYPE INTEGER ; VALUES RANGE 0,4,1 ; INITIAL 0 ; END COMPONENT ; COMPONENT SLOT_21A ; TYPE INTEGER ; VALUES RANGE 0,4,1 ; INITIAL 0 ; END COMPONENT ; COMPONENT SLOT_22A ; ! new hp54722A plug-in is a 4-wide plugin and takes slot 1 only TYPE INTEGER ; VALUES RANGE 0,1,1 ; INITIAL 0 ; END COMPONENT ; COMPONENT RESET NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; CLEAR; output string "*CLS"; flush; OUTPUT STRING "*RST;*SRE 0;*ESE 0;:RUN;"; OUTPUT STRING ":SYSTEM:HEADER OFF;LONGFORM OFF;"; OUTPUT STRING ":MEAS:SEND OFF" ; ! disables state code on error OUTPUT STRING ":TRIG:SWE AUTO;"; FLUSH; POKEINITIAL; ! invalidates 'acquired' values -- waveforms, msmts, ... GOSUB Check_version ; if stop_flag then ; gosub flash_warning ; else ; gosub set_model ; gosub set_init ; end if ; END ACTIONS; END COMPONENT; COMPONENT SUBSYSTEM NOGEN NOERRCHECK; TYPE DISCRETE; VALUES MAIN,TIMEBASE,CHANNEL,TRIGGER,TRIGGER_N,Wfm_math,MEASURE,MEASDEF,LIMIT,MARKERS, ACQUISITION,WAVEFORM,FFT,DISPLAY,WMEMORY,misc,STATUS,ABOUT; INITIAL MAIN; PANEL SET ACTIONS; HIDE Flash_warning ; HIDE STANDARD; HIDE TIMEBASE_SUBSYSTEM; HIDE CHANNEL_SUBSYSTEM; HIDE TRIGGER_SUBSYSTEM; HIDE TRIGGER_N_SUBSYSTEM ; HIDE MARKER_SUBSYSTEM; HIDE Math_subsystem; HIDE MEASURE_SUBSYSTEM; HIDE MEASDEF_SUBSYSTEM ; HIDE LIMIT_SUBSYSTEM ; HIDE ACQUISITION_SUBSYSTEM ; HIDE WAVEFORM_SUBSYSTEM; HIDE FFT_SUBSYSTEM ; HIDE DISPLAY_SUBSYSTEM; HIDE WMEMORY_SUBSYSTEM ; HIDE misc; HIDE STATUS_PANEL; HIDE ABOUT_PANEL; SELECT SUBSYSTEM; CASE MAIN; SHOW STANDARD; CASE TIMEBASE; SHOW TIMEBASE_SUBSYSTEM; output string ":MENU TIM"; CASE CHANNEL; IF First_Plug_In THEN ; SHOW CHANNEL_SUBSYSTEM; SET Channel; OUTPUT STRING ":MENU CHAN"; OUTPUT Channel FORMAT K ; END IF ; CASE TRIGGER; SHOW TRIGGER_SUBSYSTEM; output string ":MENU TRIG"; CASE TRIGGER_N ; SHOW TRIGGER_N_SUBSYSTEM ; output string ":MENU TRIG" ; CASE MARKERS; SHOW MARKER_SUBSYSTEM; output string ":MENU MARK"; CASE Wfm_math; SHOW MATH_SUBSYSTEM; OUTPUT STRING ":MENU MATH"; CASE MEASURE; SHOW MEASURE_SUBSYSTEM; output string ":MENU MEAS"; CASE MEASDEF; SHOW MEASDEF_SUBSYSTEM; CASE LIMIT ; SHOW LIMIT_SUBSYSTEM ; output string ":MENU LTES" ; CASE ACQUISITION ; SHOW ACQUISITION_SUBSYSTEM; output string ":MENU ACQ"; CASE WAVEFORM; SHOW WAVEFORM_SUBSYSTEM ; output string ":MENU ACQ"; CASE WMEMORY; SHOW WMEMORY_SUBSYSTEM ; output string ":MENU WAV"; CASE FFT; SHOW FFT_SUBSYSTEM ; output string ":MENU FFT" ; CASE DISPLAY; SHOW DISPLAY_SUBSYSTEM; output string ":MENU DISP"; CASE misc; SHOW misc; output string ":MENU UTIL"; CASE 'STATUS'; SHOW STATUS_PANEL; output string ":MENU UTIL"; CASE 'ABOUT'; SHOW ABOUT_PANEL; END SELECT; END ACTIONS; END COMPONENT; COMPONENT CHARSTRING NOTSAVED NOGEN NOERRCHECK; TYPE STRING 255; INITIAL INVALID; GET ACTIONS ; END ACTIONS ; END COMPONENT; COMPONENT NUM_BUFFER NOTSAVED NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; END ACTIONS ; END COMPONENT; COMPONENT Temp NOTSAVED NOGEN NOERRCHECK; TYPE INTEGER; END COMPONENT; COMPONENT Temp_string CLONE CHARSTRING; component disp_temp notsaved nogen noerrcheck; type integer; end component; !======================= ! LEARN STRING SUPPORT !======================= COMPONENT LEARN_STRING; TYPE IARRAY 6144; INITIAL INVALID; END COMPONENT; COMPONENT Ls_length NOGEN NOERRCHECK; TYPE CONTINUOUS; END COMPONENT; COMPONENT Ls_bytes NOGEN NOERRCHECK; TYPE INTEGER; END COMPONENT; COMPONENT STORE_STATE NOTSAVED NOERRCHECK NOGEN ; TYPE INTEGER; SET ACTIONS; ! get learn string from instrument ... OUTPUT STRING ":SYST:SET?"; ENTER CHARSTRING FORMAT '#,A'; ! consume # ENTER Ls_bytes FORMAT '#,D'; fetch Ls_bytes; gosub Get_num_bytes; store NUM_BUFFER ; FETCH NUM_BUFFER ; FETCH 2 ; idiv ;store Ls_length ; ENTER Learn_string FORMAT INT16 0 Ls_length; IF LIVEMODE THEN; ELSE; MATSCALE 0,0 Learn_string; END IF; fetch NUM_BUFFER ; FETCH 2 ; MOD ; IF STACK THEN ; ENTER Extra_byte FORMAT '#,B' ; ! even LF FETCH 1; ELSE; FETCH 0; END IF ; STORE Odd_Even; ENTER Temp_string FORMAT '#,A'; ! consume LF END ACTIONS; END COMPONENT; COMPONENT Odd_Even NOGEN NOERRCHECK; TYPE INTEGER ; INITIAL 0 ; ! 0- Even, 1 - Odd END COMPONENT ; COMPONENT Extra_byte NOGEN NOERRCHECK; TYPE INTEGER ; END COMPONENT ; COMPONENT Length NOTSAVED nogen noerrcheck; TYPE INTEGER ; INITIAL invalid ; END COMPONENT ; ACTIONS Get_num_bytes; ! ! array i/o format = #nxxxb1b2b3b4... ! where # = literal, ! n = len(xxx) ! len = number of bytes to follow. if livemode then; STORE Length ; FETCH 0; STORE NUM_BUFFER ; fetch ""; LOOP ; ENTER CHARSTRING FORMAT '#,A'; fetch CHARSTRING ; trimstr; CATSTR; fetch NUM_BUFFER; fetch 1; add; dup; store NUM_BUFFER ; fetch Length ; eq; exit if stack; END LOOP ; VAL; ! keep result in stack end if; END ACTIONS ; COMPONENT RECALL_STATE NOTSAVED NOERRCHECK NOGEN ; TYPE INTEGER; SET ACTIONS; IF LIVEMODE THEN; ! Search for at least 1 non-zero element in the state FETCH 1; LOOP; DUP; FETCH Ls_length; GT; EXIT IF STACK; DUP; FETCH LEARN_STRING; EXIT IF STACK; FETCH 1; ADD; END LOOP; FETCH Ls_length; LE; ELSE; FETCH 1; END IF; IF STACK THEN; ! download learn string to instrument ! OUTPUT STRING ":SYST:SET #" ; OUTPUT Ls_bytes FORMAT 'D'; FETCH Ls_length; fetch 2; mul; FETCH Odd_Even; ADD; VALSTR; TRIMSTR; DUP; STORE CHARSTRING; LENGTH; GOSUB PAD_ZEROS ; OUTPUT CHARSTRING FORMAT 'K'; OUTPUT Learn_string INT16 Ls_length; IF Odd_Even THEN; output extra_byte FORMAT 'B'; END IF ; output string ""; FLUSH ; output string "*CLS;*SRE 32;*ESE 1"; flush; output string "*OPC?;*OPC"; flush; wait spoll bit 5; enter stack format K; drop ; GET TIME_INCR; VALIDATE ALL; ! triggers 'UPDATE ACTIONS' to react ... GET EDGE_TRIGGER_UPDATE; GET STATE_TRIGGER_UPDATE; GET GLITCH_TRIGGER_UPDATE; GET DEVENT_ARM_UPDATE; GET DEVENT_EVENT_UPDATE; GET DEVENT_TRIGGER_UPDATE; GET DTIME_ARM_UPDATE; GET DTIME_TRIGGER_UPDATE; GET TIME_INCR ; ELSE; IF LIVEMODE THEN; NOTIFY "Invalid Recall State not sent to instrument"; NOTIFY "Invalid State possibly caused by program being written in NOT LIVE mode"; END IF; END IF; END ACTIONS; PANEL SET ACTIONS ; GOSUB UPDATE_TRACE_DATA; GOSUB Enable_Limit_Source ; GOSUB Recall_Screens ; SET SUBSYSTEM ; END ACTIONS ; END COMPONENT; ACTIONS PAD_ZEROS ; FETCH Ls_bytes ; SWAP ; SUB ; STORE NUM_BUFFER ; select NUM_BUFFER; case range 1,250; LOOP ; FETCH "0" ;FETCH CHARSTRING ; CATSTR ; STORE CHARSTRING ; FETCH NUM_BUFFER ; FETCH 1 ; SUB ; DUP ; STORE NUM_BUFFER ; IF STACK THEN ; ELSE ; FETCH 1 ; EXIT IF STACK ; END IF ; END LOOP ; CASE ELSE; END SELECT; END ACTIONS ; COMPONENT More NOTSAVED NOGEN NOERRCHECK ; TYPE INTEGER ; PANEL SET ACTIONS ; SELECT SUBSYSTEM ; CASE CHANNEL ; SELECT CHANNEL ; CASE 1 ; HIDE CH1_SCR1 ; SHOW CH1_SCR2 ; CASE 2 ; HIDE CH2_SCR1 ; SHOW CH2_SCR2 ; CASE 3 ; HIDE CH3_SCR1 ; SHOW CH3_SCR2 ; CASE 4 ; HIDE CH4_SCR1 ; SHOW CH4_SCR2 ; CASE ELSE ; END SELECT ; CASE TRIGGER ; HIDE TRIGGER_SUBSYSTEM,TRIGGER_SCR1 ; SHOW TRIGGER_SUBSYSTEM,TRIGGER_SCR2 ; SELECT TRIGGER_MODE ; CASE 4 ; ! Delay event SHOW DEVENT_MODE,DEVENT_SCR1 ; CASE ELSE ; END SELECT ; CASE Wfm_math ; SELECT FUNCTION ; CASE 0 ; HIDE Function1_scr1 ; SHOW Function1_scr2 ; CASE 1 ; HIDE Function2_scr1 ; SHOW Function2_scr2 ; END SELECT ; CASE FFT ; HIDE FFT_SCR1 ; SHOW FFT_SCR2 ; CASE WMEMORY ; HIDE WMEMORY_SCR1 ; SHOW WMEMORY_SCR2 ; CASE ELSE ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT More1 NOTSAVED NOGEN NOERRCHECK ; TYPE INTEGER ; PANEL SET ACTIONS ; HIDE DEVENT_MODE,DEVENT_SCR1 ; SHOW DEVENT_MODE,DEVENT_SCR2 ; END ACTIONS ; END COMPONENT ; COMPONENT Return NOTSAVED NOGEN NOERRCHECK ; TYPE INTEGER ; PANEL SET ACTIONS ; SELECT SUBSYSTEM ; CASE CHANNEL ; SELECT CHANNEL ; CASE 1 ; SHOW CH1_SCR1 ; HIDE CH1_SCR2 ; CASE 2 ; SHOW CH2_SCR1 ; HIDE CH2_SCR2 ; CASE 3 ; SHOW CH3_SCR1 ; HIDE CH3_SCR2 ; CASE 4 ; SHOW CH4_SCR1 ; HIDE CH4_SCR2 ; CASE ELSE ; END SELECT ; CASE TRIGGER ; HIDE TRIGGER_SUBSYSTEM,TRIGGER_SCR2 ; SHOW TRIGGER_SUBSYSTEM,TRIGGER_SCR1 ; HIDE DEVENT_MODE,DEVENT_SCR2 ; CASE Wfm_math ; SELECT FUNCTION ; CASE 0 ; HIDE Function1_scr2 ; SHOW Function1_scr1 ; CASE 1 ; HIDE Function2_scr2 ; SHOW Function2_scr1 ; END SELECT ; CASE FFT ; HIDE FFT_SCR2 ; SHOW FFT_SCR1 ; CASE WMEMORY ; SHOW WMEMORY_SCR1 ; HIDE WMEMORY_SCR2 ; CASE ELSE ; END SELECT ; END ACTIONS ; END COMPONENT ; ! ========================= ! SYSTEM UTILITIES ! ========================= COMPONENT RUN NOTSAVED; TYPE INTEGER; INITIAL 0; SET ACTIONS; OUTPUT STRING ":RUN"; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT SINGLE NOTSAVED; TYPE INTEGER; INITIAL 0; SET ACTIONS; OUTPUT STRING ":SING"; END ACTIONS; END COMPONENT; COMPONENT STOP NOTSAVED; TYPE INTEGER; INITIAL 0; SET ACTIONS; OUTPUT STRING ":STOP"; END ACTIONS; END COMPONENT; ACTIONS FLUSH_ERR_QUEUE; loop; OUTPUT STRING ":SYST:ERR? STR"; ENTER stat_err FORMAT "#,K"; enter stat_err_str format 'K'; fetch stat_err; fetch 0; eq; exit if stack; end loop; END ACTIONS; !******************** STATUS COMPONENTS ****************************** ! error component component stat_err_str notsaved; type string 80; initial "No Error"; end component ; component stat_err notsaved noerrcheck; type integer; initial 0,invalid; get actions; output string ":SYST:ERR? STR"; enter stat_err format '#,K'; enter stat_err_str format 'K'; select stat_err; CASE 0; ! no error ... CASE ELSE; ! GOSUB FLUSH_ERR_QUEUE; end select; end actions; end component; ! status panel components component stat_cls notsaved; type integer; initial dontcare; set actions; output string "*CLS"; end actions; end component; component stat_evnt_evr notsaved; type integer; initial 0,invalid; get actions; output string "*ESR?"; enter stat_evnt_evr format 'K'; end actions; end component; component stat_evnt_enr notsaved; type integer; values range 0,255,1; initial 0; set actions; output stat_evnt_enr format '"*ESE ",K'; end actions; get actions; output string "*ESE?"; enter stat_evnt_enr format 'K'; end actions; end component; component stat_stb notsaved; type integer; initial 0,invalid; ! Note that the use of 'SPOLL' will clear the SRQ line -- using ! the '*STB?' query will also get the status byte but will NOT clear ! the SRQ line in the process. GET ACTIONS; SPOLL; ! Leaves status byte on stack ... STORE stat_stb; END ACTIONS; end component; component stat_sre notsaved; type integer; values range 0,255,1; initial 0; set actions; output stat_sre format '"*SRE ",K'; end actions; get actions; output string "*SRE?"; enter stat_sre format 'K'; end actions; end component; component stat_opc notsaved; type integer; set actions; output string "*OPC"; end actions; end component; component stat_opcv notsaved; type integer; initial 0,invalid; get actions; output string "*OPC?"; enter stat_opcv format 'K'; end actions; end component; component stat_wai notsaved; type integer; set actions; output string "*WAI"; end actions; end component; component stat_self_test notsaved; type string 6; initial invalid; get actions; output string "*TST?"; if livemode then; wait spoll bit 4; end if; enter stat_self_test format 'K'; end actions; end component; COMPONENT SERIAL_NUM NOTSAVED; TYPE STRING 12; INITIAL INVALID; SET ACTIONS; ! Unusable unless RAM is NOT write-protected OUTPUT STRING ':SERIAL "'; OUTPUT SERIAL_NUM FORMAT K; OUTPUT STRING '"'; END ACTIONS; GET ACTIONS; OUTPUT STRING "*IDN?"; ENTER CHARSTRING FORMAT "#,23A"; ENTER SERIAL_NUM FORMAT "#,10A"; ENTER CHARSTRING FORMAT K; END ACTIONS; END COMPONENT; !================================= ! WAVEFORM SUBSYSTEM !================================= COMPONENT WF_TYPE; TYPE DISCRETE; VALUES NORMAL,RAW,INT,AVER,VERS; ! NORMAL,AVERAGE - eqvt time INITIAL INVALID; ! RAW,INT - real time GET ACTIONS; IF LIVEMODE THEN ; OUTPUT STRING ":WAV:TYPE?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NORM"; FETCH (WF_TYPE)NORMAL; CASE "RAW"; FETCH (WF_TYPE)RAW; CASE "INT"; FETCH (WF_TYPE)INT; CASE "AVER"; FETCH (WF_TYPE)AVER; CASE "VERS"; FETCH (WF_TYPE)VERS ; CASE ELSE; IF LIVEMODE THEN; NOTIFY "Bad Case in Select Comp:WF_TYPE" ; END IF; FETCH WF_TYPE; END SELECT; STORE WF_TYPE; ELSE ; !FETCH (WF_TYPE)AVER ; STORE WF_TYPE ; END IF ; END ACTIONS; END COMPONENT; COMPONENT View_source ; TYPE DISCRETE ; VALUES CH1,CH2,CH3,CH4,F1,F2,FFT,WM1,WM2,WM3,WM4 ; INITIAL CH1 ; ! check it out SET ACTIONS ; OUTPUT STRING ":WAV:SOUR " ; OUTPUT View_source TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; END ACTIONS ; PANEL SET ACTIONS ; !Depending on WF_TYPE GET WF_TYPE ; GET HIT_COUNT ; GET TIME_BUCKT ; GET WAV_POINTS ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":WAV:SOUR?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "CHAN1" ; FETCH ( View_source ) CH1 ; CASE "CHAN2" ; FETCH ( View_source ) CH2 ; CASE "CHAN3" ; FETCH ( View_source ) CH3 ; CASE "CHAN4" ; FETCH ( View_source ) CH4 ; CASE "FUNC1" ; FETCH ( View_source ) F1 ; CASE "FUNC2" ; FETCH ( View_source ) F2 ; CASE "FFT" ; FETCH ( View_source ) FFT ; CASE "WMEM1" ; FETCH ( View_source ) WM1 ; CASE "WMEM2" ; FETCH ( View_source ) WM2 ; CASE "WMEM3" ; FETCH ( View_source ) WM3 ; CASE "WMEM4" ; FETCH ( View_source ) WM4 ; CASE ELSE ; FETCH View_source ; IF LIVEMODE THEN; NOTIFY "Bad CASE in SELECT Comp View_source"; END IF; END SELECT ; STORE View_source ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT HIT_COUNT; ! I have changed this - check it out - can also add :WAV:COMP TYPE INTEGER; INITIAL INVALID ; GET ACTIONS; OUTPUT STRING ":WAV:COUNT?"; ENTER HIT_COUNT FORMAT K; END ACTIONS; END COMPONENT; COMPONENT TIME_BUCKT; ! I have changed this - check it out - can also add :WAV:COMP TYPE INTEGER; INITIAL INVALID ; GET ACTIONS; OUTPUT STRING ":WAV:COMP?"; ENTER TIME_BUCKT FORMAT K; END ACTIONS; END COMPONENT; COMPONENT WAV_POINTS ; TYPE INTEGER ; INITIAL INVALID ; GET ACTIONS; OUTPUT STRING ":WAV:POIN?"; ENTER WAV_POINTS FORMAT K; END ACTIONS; END COMPONENT ; !! COMPONENT for WAVE:BAND? query can be added !================================= ! WAVEFORM MEMORY SUBSYSTEM !================================= COMPONENT SOURCE_WM1; TYPE DISCRETE; VALUES UNKNOWN,CHAN1,CHAN2,CHAN3,CHAN4,FUNC1,FUNC2,FFT; INITIAL UNKNOWN; GET ACTIONS; END ACTIONS; END COMPONENT; COMPONENT SOURCE_WM2; TYPE DISCRETE; VALUES UNKNOWN,CHAN1,CHAN2,CHAN3,CHAN4,FUNC1,FUNC2,FFT; INITIAL UNKNOWN; GET ACTIONS; END ACTIONS; END COMPONENT; COMPONENT SOURCE_WM3; TYPE DISCRETE; VALUES UNKNOWN,CHAN1,CHAN2,CHAN3,CHAN4,FUNC1,FUNC2,FFT; INITIAL UNKNOWN; GET ACTIONS; END ACTIONS; END COMPONENT; COMPONENT SOURCE_WM4; TYPE DISCRETE; VALUES UNKNOWN,CHAN1,CHAN2,CHAN3,CHAN4,FUNC1,FUNC2,FFT; INITIAL UNKNOWN; GET ACTIONS; END ACTIONS; END COMPONENT; COMPONENT UNITS_WM1_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_WM2_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_WM3_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_WM4_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; END COMPONENT ; COMPONENT WAVEMEM ; TYPE DISCRETE ; VALUES WM1,WM2,WM3,WM4 ; INITIAL WM1 ; END COMPONENT ; COMPONENT WM1_OK ; TYPE INTEGER ; VALUES RANGE 0,1 ; INITIAL 0 ; END COMPONENT ; COMPONENT WM2_OK CLONE WM1_OK ; COMPONENT WM3_OK CLONE WM1_OK ; COMPONENT WM4_OK CLONE WM1_OK ; COMPONENT WM1_TIME_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM1_TIME_SENS ; SET ACTIONS ; FETCH WM1_TIME_SENS; FETCH 10; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM1:XRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM1:XRAN?"; ENTER STACK FORMAT K; FETCH 10; DIV; ! range is 10x sensitivity ...; STORE WM1_TIME_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM1_TIME_DELAY ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM1_TIME_DELAY ; SET ACTIONS ; OUTPUT WM1_TIME_DELAY FORMAT '":WMEM1:XOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM1:XOFF?"; ENTER WM1_TIME_DELAY FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM1_TIME_REF; TYPE DISCRETE; VALUES LEFT,CENTER,RIGHT; INITIAL CENTER; END COMPONENT ; COMPONENT WM1_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM1_SENS,VMIN_WM1,VMAX_WM1,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2; SET ACTIONS ; FETCH WM1_SENS; FETCH 8; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM1:YRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM1:YRAN?"; ENTER STACK FORMAT K; FETCH 8; DIV; ! range is 10x sensitivity ...; STORE WM1_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM1_OFFSET ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM1_OFFSET,VMIN_WM1,VMAX_WM1,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; OUTPUT WM1_OFFSET FORMAT '":WMEM1:YOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM1:YOFF?"; ENTER WM1_OFFSET FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM2_TIME_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM2_TIME_SENS ; SET ACTIONS ; FETCH WM2_TIME_SENS; FETCH 10; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM2:XRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM2:XRAN?"; ENTER STACK FORMAT K; FETCH 10; DIV; ! range is 10x sensitivity ...; STORE WM2_TIME_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM2_TIME_DELAY ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM2_TIME_DELAY ; SET ACTIONS ; OUTPUT WM2_TIME_DELAY FORMAT '":WMEM2:XOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM2:XOFF?"; ENTER WM2_TIME_DELAY FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM2_TIME_REF; TYPE DISCRETE; VALUES LEFT,CENTER,RIGHT; INITIAL CENTER; END COMPONENT ; COMPONENT WM2_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM2_SENS,VMIN_WM2,VMAX_WM2,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; FETCH WM2_SENS; FETCH 8; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM2:YRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM2:YRAN?"; ENTER STACK FORMAT K; FETCH 8; DIV; ! range is 10x sensitivity ...; STORE WM2_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM2_OFFSET ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM2_OFFSET,VMIN_WM2,VMAX_WM2,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; OUTPUT WM2_OFFSET FORMAT '":WMEM2:YOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM2:YOFF?"; ENTER WM2_OFFSET FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM3_TIME_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM3_TIME_SENS ; SET ACTIONS ; FETCH WM3_TIME_SENS; FETCH 10; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM3:XRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM3:XRAN?"; ENTER STACK FORMAT K; FETCH 10; DIV; ! range is 10x sensitivity ...; STORE WM3_TIME_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM3_TIME_DELAY ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM3_TIME_DELAY ; SET ACTIONS ; OUTPUT WM3_TIME_DELAY FORMAT '":WMEM3:XOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM3:XOFF?"; ENTER WM3_TIME_DELAY FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM3_TIME_REF; TYPE DISCRETE; VALUES LEFT,CENTER,RIGHT; INITIAL CENTER; END COMPONENT ; COMPONENT WM3_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM3_SENS,VMIN_WM3,VMAX_WM3,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; FETCH WM3_SENS; FETCH 8; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM3:YRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM3:YRAN?"; ENTER STACK FORMAT K; FETCH 8; DIV; ! range is 10x sensitivity ...; STORE WM3_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM3_OFFSET ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM3_OFFSET,VMIN_WM3,VMAX_WM3,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; OUTPUT WM3_OFFSET FORMAT '":WMEM3:YOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM3:YOFF?"; ENTER WM3_OFFSET FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM4_TIME_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM4_TIME_SENS ; SET ACTIONS ; FETCH WM4_TIME_SENS; FETCH 10; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM4:XRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM4:XRAN?"; ENTER STACK FORMAT K; FETCH 10; DIV; ! range is 10x sensitivity ...; STORE WM4_TIME_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM4_TIME_DELAY ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM4_TIME_DELAY ; SET ACTIONS ; OUTPUT WM4_TIME_DELAY FORMAT '":WMEM4:XOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM4:XOFF?"; ENTER WM4_TIME_DELAY FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM4_TIME_REF; TYPE DISCRETE; VALUES LEFT,CENTER,RIGHT; INITIAL CENTER; END COMPONENT ; COMPONENT WM4_SENS ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM4_SENS,VMIN_WM4,VMAX_WM4,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; FETCH WM4_SENS; FETCH 8; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":WMEM4:YRAN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM4:YRAN?"; ENTER STACK FORMAT K; FETCH 8; DIV; ! range is 10x sensitivity ...; STORE WM4_SENS; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT WM4_OFFSET ; TYPE CONTINUOUS ; INITIAL INVALID ; !VALUES RANGE ; COUPLED WM4_OFFSET,VMIN_WM4,VMAX_WM4,VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; SET ACTIONS ; OUTPUT WM4_OFFSET FORMAT '":WMEM4:YOFF ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":WMEM4:YOFF?"; ENTER WM4_OFFSET FORMAT K; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; !================================= ! FFT SUBSYSTEM !================================= COMPONENT FFT_Display ; TYPE DISCRETE; VALUES OFF,ON ; INITIAL OFF; !COUPLED FFT_SENS , FFT_OFFSET ; ! The most curious occurance ! works in direct i/o ! but not thro driver after an autoscale !COUPLED FFT_MSpan, FFT_Center_freq, FFT_Span, FFT_Resolution, FFT_SENS, FFT_OFFSET ; SET Actions; OUTPUT FFT_Display TABLE ":FFT:DISP OFF;", ":FFT:DISP ON;"; !OUTPUT STRING "*OPC?" ; ENTER STACK FORMAT K ; DROP ; GET FFT_MSpan ; GET FFT_Center_freq ; GET FFT_Span ; GET FFT_Resolution ; GET FFT_SENS ; GET FFT_OFFSET ; SELECT FFT_display ; CASE On ; GET VMIN_FFT; GET VMAX_FFT; CASE Off ; END SELECT ; END ACTIONS; PANEL SET ACTIONS; IF FFT_DISPLAY THEN; GET WF_FFT ; END IF; END ACTIONS; GET Actions; OUTPUT STRING ":FFT:DISP?"; ENTER FFT_Display FORMAT K; END ACTIONS; END COMPONENT ; COMPONENT FFT_Source ; TYPE DISCRETE ; VALUES CH1,CH2,CH3,CH4,F1,F2,WM1,WM2,WM3,WM4,CONS ; INITIAL CH1 ; ! check it out COUPLED FFT_SENS , FFT_OFFSET, VMIN_FFT, VMAX_FFT ; SET ACTIONS ; OUTPUT STRING ":FFT:SOUR " ; OUTPUT FFT_Source TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2", "WMEM1","WMEM2","WMEM3","WMEM4","CONS"; FETCH 0 ; STORE FFT_Display ; SET FFT_Display ; END ACTIONS ; PANEL SET ACTIONS ; GOSUB Get_FFT_Ranges ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":FFT:SOUR?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "CHAN1" ; FETCH ( FFT_Source ) CH1 ; CASE "CHAN2" ; FETCH ( FFT_Source ) CH2 ; CASE "CHAN3" ; FETCH ( FFT_Source ) CH3 ; CASE "CHAN4" ; FETCH ( FFT_Source ) CH4 ; CASE "FUNC1" ; FETCH ( FFT_Source ) F1 ; CASE "FUNC2" ; FETCH ( FFT_Source ) F2 ; CASE "WMEM1" ; FETCH ( FFT_Source ) WM1 ; CASE "WMEM2" ; FETCH ( FFT_Source ) WM2 ; CASE "WMEM3" ; FETCH ( FFT_Source ) WM3 ; CASE "WMEM4" ; FETCH ( FFT_Source ) WM4 ; CASE "CONS" ; FETCH ( FFT_Source ) CONS ; CASE ELSE ; FETCH FFT_Source ; IF LIVEMODE THEN; NOTIFY "Bad CASE in SELECT Comp FFT_Source" ; END IF; END SELECT ; STORE FFT_Source ; END IF ; END ACTIONS ; END COMPONENT ; ACTIONS Fix_FFT_Source ; GET FFT_Source ; GOSUB Get_FFT_Ranges ; GET FFT_MSpan ; GET FFT_Center_freq ; GET FFT_Span ; GET FFT_Resolution ; GET FFT1_MSpan ; GET FFT1_Center_freq ; GET FFT1_Span ; GET FFT1_Resolution ; GET FFT2_MSpan ; GET FFT2_Center_freq ; GET FFT2_Span ; GET FFT2_Resolution ; END ACTIONS ; COMPONENT FFT_Window; TYPE DISCRETE; VALUES Rect, Hanning, Flattop; INITIAL Hanning; SET Actions; OUTPUT STRING ":FFT:WIND "; OUTPUT FFT_Window TABLE "RECT" "HANN" "FLAT"; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET Actions; OUTPUT STRING ":FFT:WIND?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "RECT"; FETCH (FFT_Window)Rect; CASE "HANN"; FETCH (FFT_Window)Hanning; CASE "FLAT"; FETCH (FFT_Window)Flattop; CASE ELSE; FETCH FFT_Window; END SELECT; STORE FFT_Window; END ACTIONS; END COMPONENT; COMPONENT FFT_Magnify; TYPE DISCRETE; VALUES OFF ON; INITIAL OFF; SET ACTIONS; OUTPUT FFT_Magnify TABLE ":FFT:MAGN OFF" ":FFT:MAGN ON"; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:MAGN?"; ENTER FFT_Magnify format K; END ACTIONS; END COMPONENT; COMPONENT FFT_MSpan; TYPE CONTINUOUS; !VALUES RANGE ???????; INITIAL INVALID; COUPLED FFT_MSpan,FFT_Center_freq,FFT_Span,FFT_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; ! check it out OUTPUT FFT_Span FORMAT '":FFT:MSPAN ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:MSPAN?"; ENTER FFT_MSpan FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT_Center_freq; TYPE CONTINUOUS; !VALUES RANGE 0 FFT1_Max_cf; INITIAL INVALID; COUPLED FFT_MSpan,FFT_Center_freq,FFT_Span,FFT_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT_Center_freq FORMAT '":FFT:FREQ ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:FREQ?"; ENTER FFT_Center_freq FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT_Span; TYPE CONTINUOUS; !VALUES RANGE 5,500E6; VALUES RANGE 50,Max_FFT_Span ; INITIAL INVALID; COUPLED FFT_MSpan,FFT_Center_freq,FFT_Span,FFT_Resolution,TIME_SENS,TIME_WIND_SENS ; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT_Span FORMAT '":FFT:SPAN ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:SPAN?"; ENTER FFT_Span FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT_Resolution; TYPE CONTINUOUS; !VALUES RANGE 5,500E6; INITIAL INVALID; COUPLED FFT_MSpan,FFT_Center_freq,FFT_Span,FFT_Resolution,TIME_SENS,TIME_WIND_SENS ; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT_Resolution FORMAT '":FFT:RES ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:RES?"; ENTER FFT_Resolution FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT_SENS ; TYPE CONTINUOUS; VALUES RANGE 100E-18,10E+15 ; ! LOG 3,1; INITIAL 10; COUPLED FFT_SENS,FFT_OFFSET,VMIN_FFT,VMAX_FFT; SET ACTIONS; FETCH FFT_SENS; FETCH 8; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":FFT:RANG ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:RANG? "; ENTER STACK FORMAT K; FETCH 8; DIV; ! range is 10x sensitivity ...; STORE FFT_SENS; !get Min_risetime; get Max_risetime; END ACTIONS; END COMPONENT; COMPONENT FFT_OFFSET; TYPE CONTINUOUS; !VALUES RANGE ???????? ; INITIAL -15; COUPLED FFT_OFFSET,FFT_SENS ,VMIN_FFT,VMAX_FFT; SET ACTIONS; OUTPUT FFT_OFFSET FORMAT '":FFT:OFFS ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FFT:OFFS? "; ENTER FFT_OFFSET FORMAT K; END ACTIONS; END COMPONENT; ACTIONS Get_FFT_Ranges ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; ! VALUES Channel1, Channel2, Channel3, Channel4,WM1,WM2,WM3,WM4,CONST; SELECT FFT_Source ; CASE CH1 ; FETCH Plug_in1 ; GOSUB FFT_Plug_In ; CASE CH2 ; FETCH Plug_in2 ; GOSUB FFT_Plug_In ; CASE CH3 ; FETCH Plug_in3 ; GOSUB FFT_Plug_In ; CASE CH4 ; FETCH Plug_in4 ; GOSUB FFT_Plug_In ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS FFT_Plug_In ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; SELECT STACK ; CASE 0 ; CASE 1 ; GOSUB Get_FFT_Range_11A ; CASE 2 ; GOSUB Get_FFT_Range_12A ; CASE 3 ; GOSUB Get_FFT_Range_13A ; CASE 4 ; GOSUB Get_FFT_Range_21A ; CASE 5 ; GOSUB Get_FFT_Range_22A ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS Get_FFT_Range_11A ; FETCH 1E+9 ; STORE Max_FFT_Span ; END ACTIONS ; ACTIONS Get_FFT_Range_12A ; FETCH 1E+9 ; STORE Max_FFT_Span ; END ACTIONS ; ACTIONS Get_FFT_Range_13A ; FETCH 1E+9 ; STORE Max_FFT_Span ; END ACTIONS ; ACTIONS Get_FFT_Range_21A ; FETCH 2E+9 ; STORE Max_FFT_Span ; END ACTIONS ; ACTIONS Get_FFT_Range_22A ; FETCH 4E+9 ; STORE Max_FFT_Span ; END ACTIONS ; COMPONENT Max_FFT_Span ; TYPE CONTINUOUS ; END COMPONENT ; COMPONENT VMIN_FFT NOERRCHECK; TYPE CONTINUOUS; GET ACTIONS; ! offset-range/2 ... FETCH FFT_offset; FETCH FFT_sens; FETCH 4; MUL; SUB; STORE VMIN_FFT ; END ACTIONS; END COMPONENT; COMPONENT VMAX_FFT NOERRCHECK; TYPE CONTINUOUS; GET ACTIONS; ! offset+range/2 ... FETCH FFT_offset; FETCH FFT_sens; FETCH 4 ; MUL; ADD ; STORE VMAX_FFT; END ACTIONS; END COMPONENT; COMPONENT FFT_store_wm1 notsaved; TYPE integer; set actions; if FFT_display then; ! otherwise instrument does not save - what peculiarities !! !output string ":STORE:WAV FUNC1,WMEM1"; ! GOK what purpose this serves !! OUTPUT STRING ":WMEM1:SAVE FFT" ; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; ! obviously these do not work get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_FFT; STORE VMIN_WM1; FETCH VMAX_FFT; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; FETCH (SOURCE_WM1)FFT; STORE SOURCE_WM1; FETCH (UNITS_WM1_DISP)DB ; STORE UNITS_WM1_DISP ; FETCH 1 ; STORE WM1_X_Axis_Units ; FETCH TIME_REF ; STORE WM1_TIME_REF ; GET WM1_TIME_SENS ; GET WM1_TIME_DELAY ; FETCH FFT_SENS ; STORE WM1_SENS ; FETCH FFT_offset ; STORE WM1_OFFSET ; else; if panelmode then; notify "Must turn ON the FFT Display"; end if; end if; end actions; PANEL SET ACTIONS; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT FFT_store_wm2 notsaved; TYPE integer; set actions; if FFT_display then; ! otherwise instrument does not save - what peculiarities !! !output string ":STORE:WAV FUNC1,WMEM1"; ! GOK what purpose this serves !! OUTPUT STRING ":WMEM2:SAVE FFT" ; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_FFT; STORE VMIN_WM2; FETCH VMAX_FFT; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; FETCH (SOURCE_WM2)FFT; STORE SOURCE_WM2; FETCH (UNITS_WM2_DISP)DB ; STORE UNITS_WM2_DISP ; FETCH 1 ; STORE WM2_X_Axis_Units ; FETCH TIME_REF ; STORE WM2_TIME_REF ; GET WM2_TIME_SENS ; GET WM2_TIME_DELAY ; FETCH FFT_SENS ; STORE WM2_SENS ; FETCH FFT_offset ; STORE WM2_OFFSET ; else; if panelmode then; notify "Must turn ON the FFT Display"; end if; end if; end actions; PANEL SET ACTIONS; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT FFT_store_wm3 notsaved; TYPE integer; set actions; if FFT_display then; ! otherwise instrument does not save - what peculiarities !! !output string ":STORE:WAV FUNC1,WMEM1"; ! GOK what purpose this serves !! OUTPUT STRING ":WMEM3:SAVE FFT" ; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_FFT; STORE VMIN_WM3; FETCH VMAX_FFT; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; FETCH (SOURCE_WM3)FFT; STORE SOURCE_WM3; FETCH (UNITS_WM3_DISP)DB ; STORE UNITS_WM3_DISP ; FETCH 1 ; STORE WM3_X_Axis_Units ; FETCH TIME_REF ; STORE WM3_TIME_REF ; GET WM3_TIME_SENS ; GET WM3_TIME_DELAY ; FETCH FFT_SENS ; STORE WM3_SENS ; FETCH FFT_offset ; STORE WM3_OFFSET ; else; if panelmode then; notify "Must turn ON the FFT Display"; end if; end if; end actions; PANEL SET ACTIONS; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT FFT_store_wm4 notsaved; TYPE integer; set actions; if FFT_display then; ! otherwise instrument does not save - what peculiarities !! !output string ":STORE:WAV FUNC1,WMEM1"; ! GOK what purpose this serves !! OUTPUT STRING ":WMEM4:SAVE FFT" ; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_FFT; STORE VMIN_WM4; FETCH VMAX_FFT; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; FETCH (SOURCE_WM4)FFT; STORE SOURCE_WM4; FETCH (UNITS_WM4_DISP)DB ; STORE UNITS_WM4_DISP ; FETCH 1 ; STORE WM4_X_Axis_Units ; FETCH TIME_REF ; STORE WM4_TIME_REF ; GET WM4_TIME_SENS ; GET WM4_TIME_DELAY ; FETCH FFT_SENS ; STORE WM4_SENS ; FETCH FFT_offset ; STORE WM4_OFFSET ; else; if panelmode then; notify "Must turn ON the FFT Display"; end if; end if; end actions; PANEL SET ACTIONS; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; !================================= ! DISPLAY SUBSYSTEM !================================= COMPONENT PERSIST; TYPE DISCRETE; VALUES MINIMUM,INFINITE,VARIABLE; INITIAL MINIMUM; SET ACTIONS; SELECT PERSIST ; CASE VARIABLE ; SET PERSIST_VALUE ; CASE ELSE ; OUTPUT PERSIST TABLE ":DISP:PERS MIN","DISP:PERS INF"; VALIDATE PERSIST ; DONTCARE PERSIST_VALUE; END SELECT ; END ACTIONS; GET ACTIONS; OUTPUT STRING ":DISP:PERS?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "INF"; FETCH (PERSIST)INFINITE; STORE PERSIST ; DONTCARE PERSIST_VALUE; CASE ELSE; FETCH CHARSTRING; TRIMSTR; VAL; STORE PERSIST_VALUE; IF PERSIST_VALUE THEN ; VALIDATE PERSIST_VALUE; FETCH ( PERSIST ) VARIABLE ; STORE PERSIST ; ELSE ; DONTCARE PERSIST_VALUE ; FETCH (PERSIST)MINIMUM ; STORE PERSIST ; VALIDATE PERSIST ; END IF ; END SELECT; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PERSIST_VALUE; TYPE CONTINUOUS; VALUES RANGE 0,40.00,100E-3; INITIAL 0,DONTCARE ; SET ACTIONS; OUTPUT PERSIST_VALUE FORMAT '":DISP:PERS ",K'; VALIDATE PERSIST_VALUE; FETCH ( PERSIST ) VARIABLE ; STORE PERSIST ; END ACTIONS; GET ACTIONS; GET PERSIST ; END ACTIONS; END COMPONENT; COMPONENT NUM_SCREENS; TYPE DISCRETE; VALUES ONE,TWO; INITIAL ONE; SET ACTIONS; OUTPUT STRING ":DISP:FORMAT "; OUTPUT NUM_SCREENS TABLE '1','2'; END ACTIONS; GET ACTIONS; OUTPUT STRING ":DISP:FORMAT?"; ENTER STACK FORMAT K; SELECT STACK; CASE 1; FETCH (NUM_SCREENS)ONE; CASE 2; FETCH (NUM_SCREENS)TWO; CASE ELSE; FETCH NUM_SCREENS; END SELECT; STORE NUM_SCREENS; END ACTIONS; END COMPONENT; COMPONENT UPPER_LOWER ; TYPE DISCRETE ; VALUES UPPER,LOWER ; INITIAL UPPER ; END COMPONENT ; COMPONENT Upper_source ; TYPE DISCRETE ; VALUES CH1,CH2,CH3,CH4,F1,F2,FFT,WM1,WM2,WM3,WM4 ; INITIAL INVALID ; ! check it out SET ACTIONS ; OUTPUT STRING ":DISP:ASS " ; OUTPUT Upper_source TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; OUTPUT STRING ",UPP" ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":DISP:ASS? " ; OUTPUT Upper_source TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "UPP" ; FETCH ( UPPER_LOWER ) UPPER ; FETCH Upper_Source ; STORE Upper_Source ; CASE "LOW" ; FETCH ( UPPER_LOWER ) LOWER ; FETCH Upper_Source ; STORE Lower_Source ; INVALIDATE Upper_Source ; CASe ELSE ; FETCH UPPER_LOWER ; IF LIVEMODE THEN; NOTIFY "Bad CASE in SELECT Comp UPPER_LOWER" ; END IF; END SELECT ; STORE UPPER_LOWER ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Lower_source ; TYPE DISCRETE ; VALUES CH1,CH2,CH3,CH4,F1,F2,FFT,WM1,WM2,WM3,WM4 ; INITIAL INVALID ; ! check it out SET ACTIONS ; OUTPUT STRING ":DISP:ASS " ; OUTPUT Lower_source TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; OUTPUT STRING ",LOW" ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":DISP:ASS? " ; OUTPUT Lower_source TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "UPP" ; FETCH ( UPPER_LOWER ) UPPER ; FETCH Lower_Source ; STORE Upper_Source ; INVALIDATE Lower_Source ; CASE "LOW" ; FETCH ( UPPER_LOWER ) LOWER ; FETCH Lower_Source ; STORE Lower_Source ; CASE ELSE ; FETCH UPPER_LOWER ; IF LIVEMODE THEN; NOTIFY "Bad CASE in SELECT Comp UPPER_LOWER" ; END IF; END SELECT ; STORE UPPER_LOWER ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT XY_GRAT1; ! peculiarities of id-lang ! TYPE DISCRETE; VALUES OFF,AXES,GRID,FRAME; INITIAL GRID; GET ACTIONS; FETCH XY_GRATICULE; FETCH 2; ADD; STORE XY_GRAT1; END ACTIONS; END COMPONENT; COMPONENT XY_GRATICULE; TYPE DISCRETE; VALUES GRID,FRAME ; INITIAL GRID; SET ACTIONS; OUTPUT STRING ":DISP:GRAT "; OUTPUT XY_GRATICULE TABLE 'GRID;','FRAME;'; GET XY_GRAT1 ; END ACTIONS; GET ACTIONS; OUTPUT STRING ":DISP:GRAT?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "GRID"; FETCH (XY_GRATICULE)GRID; CASE "FRAM"; FETCH (XY_GRATICULE)FRAME; CASE ELSE; FETCH XY_GRATICULE; END SELECT; STORE XY_GRATICULE; END ACTIONS; END COMPONENT; COMPONENT CONNECT_DOTS; TYPE DISCRETE; VALUES FAST,CDOT,HRES; INITIAL FAST; SET ACTIONS; OUTPUT STRING ":DISP:DWAV "; OUTPUT CONNECT_DOTS TABLE 'FAST;','CDOT;','HRES;'; END ACTIONS; GET ACTIONS; OUTPUT STRING ":DISP:DWAV?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "FAST"; FETCH (CONNECT_DOTS)FAST; CASE "CDOT"; FETCH (CONNECT_DOTS)CDOT; CASE "HRES"; FETCH (CONNECT_DOTS)HRES; CASE ELSE; FETCH CONNECT_DOTS; END SELECT; STORE CONNECT_DOTS; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT; COMPONENT MERGE_PM1 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; OUTPUT STRING ":MERGE "; END ACTIONS; END COMPONENT; COMPONENT RASTER NOTSAVED NOGEN; ! do a get of pixel memory at reset - check it out TYPE IARRAY 16383; INITIAL INVALID; ! ! Binary Block Format: ! ! #6014848 = ! '#800016576' 10-byte header ! < data block > 16576-byte binary data ( ie: 8288 int16's ) ! 'LF' 1-byte LF terminator ! GET ACTIONS; OUTPUT STRING ":DISP:DATA?;"; ! ENTER RASTER FORMAT INT16 8 8288; ! skips '#' at head, eats 'LF' at tail ENTER raster_string FORMAT "#,AA"; ENTER STACK FORMAT "#,DDDDDD"; FETCH 2; DIV; DUP ; STORE raster_length ; ENTER RASTER FORMAT INT16 0 STACK; ! skips '#' at head, eats 'LF' at tail ENTER CHARSTRING FORMAT K; ! consumes 'LF' terminator END ACTIONS; END COMPONENT; component upload_PM1 notsaved; ! COMPONENT RASTER - get actions type integer; set actions; output string ":DISP:SOUR PMEM1;"; GET RASTER ; end actions; end component; component raster_string ; type string 5 ; initial "" ; end component ; component raster_length ; type integer ; initial 0 ; end component ; component download_PM1 notsaved; type integer; set actions; if raster_length then ; output string "*CLS; *SRE 32; *ESE 1"; flush; output string ":DISP:SOUR PMEM1"; flush; OUTPUT STRING ":DISP:DATA "; OUTPUT raster_string FORMAT 'AA' ; FETCH raster_length ; FETCH 2; MUL ; VALSTR ; TRIMSTR ; DUP ; STORE CHARSTRING ; LENGTH ; FETCH raster_string ; FETCH 2 ; FETCH 1 ; SUBSTR ; VAL ; SWAP ; SUB ; DUP ; IF STACK THEN ; LOOP ; FETCH "0" ; FETCH CHARSTRING ; CATSTR ; STORE CHARSTRING ; FETCH 1 ; SUB ; IF STACK THEN ; DUP ; ELSE ; FETCH 1 ; EXIT IF STACK ; END IF ; END LOOP ; ELSE ; END IF ; FETCH CHARSTRING ; TRIMSTR ; OUTPUT stack FORMAT 'K' ; OUTPUT RASTER INT16 raster_length ; OUTPUT STRING " "; flush ; output string "*OPC"; flush; if livemode then; wait spoll bit 5; end if; else ; notify "Nothing saved into pixel memory" ; end if ; end actions; end component; component erase_PM1 notsaved; type integer; set actions; output string ":ERASE PMEM1"; invalidate data_PM1; end actions; end component; component data_PM1 notsaved nogen noerrcheck; type iarray 16383; initial invalid; end component; !>> CHAN1 views ... COMPONENT VIEW_CH1; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; COUPLED VIEW_WF_CH1; SET ACTIONS; FETCH Plug_in1; FETCH ADDR; NOT; OR; IF STACK THEN; SELECT VIEW_CH1; CASE OFF; OUTPUT STRING ":CHAN1:DISP OFF;"; CASE ON; OUTPUT STRING ":CHAN1:DISP ON;"; END SELECT; ELSE; FETCH 0; STORE VIEW_CH1; NOTIFY "Sorry, No Plug-In!!" ; END IF; END ACTIONS; PANEL SET ACTIONS; if VIEW_CH1 then; GET WF_CH1; end if; END ACTIONS; GET ACTIONS; ! Required to find out which signal to display as in instrument IF Plug_in1 THEN; !Something in the slot OUTPUT STRING ":CHAN1:DISP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (VIEW_CH1)OFF; CASE 1; FETCH (VIEW_CH1)ON; CASE ELSE; FETCH VIEW_CH1; END SELECT; STORE VIEW_CH1; ELSE; IF ADDR THEN; FETCH 0; STORE VIEW_CH1; END IF; END IF; END ACTIONS; END COMPONENT; COMPONENT VIEW_WF_CH1 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL ON; GET ACTIONS; SELECT VIEW_CH1; CASE OFF; FETCH (VIEW_WF_CH1)OFF; CASE ON; FETCH (VIEW_WF_CH1)ON; CASE ELSE; FETCH VIEW_WF_CH1; END SELECT; STORE VIEW_WF_CH1; END ACTIONS; END COMPONENT; !>> CHAN2 views ... COMPONENT VIEW_CH2; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; COUPLED VIEW_WF_CH2; SET ACTIONS; FETCH Plug_in2; FETCH ADDR; NOT; OR; IF STACK THEN; SELECT VIEW_CH2; CASE OFF; OUTPUT STRING ":CHAN2:DISP OFF;"; CASE ON; OUTPUT STRING ":CHAN2:DISP ON;"; END SELECT; ELSE; FETCH 0; STORE VIEW_CH2; NOTIFY "Sorry, No Plug-In!!" ; END IF; END ACTIONS; PANEL SET ACTIONS; if VIEW_CH2 then; GET WF_CH2; end if; END ACTIONS; GET ACTIONS; IF Plug_in2 THEN; !Something in the slot OUTPUT STRING ":CHAN2:DISP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (VIEW_CH2)OFF; CASE 1; FETCH (VIEW_CH2)ON; CASE ELSE; FETCH VIEW_CH2; END SELECT; STORE VIEW_CH2; ELSE; IF ADDR THEN; FETCH 0; STORE VIEW_CH2; END IF; END IF; END ACTIONS; END COMPONENT; COMPONENT VIEW_WF_CH2 NOGEN NOERRCHECK; TYPE DISCRETE ; VALUES OFF,ON; INITIAL OFF; GET ACTIONS; SELECT VIEW_CH2; CASE OFF; FETCH (VIEW_WF_CH2)OFF; CASE ON; FETCH (VIEW_WF_CH2)ON; CASE ELSE; FETCH VIEW_WF_CH2; END SELECT; STORE VIEW_WF_CH2; END ACTIONS; END COMPONENT; !>> CHAN3 views ... COMPONENT VIEW_CH3; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; COUPLED VIEW_WF_CH3; SET ACTIONS; FETCH Plug_in3; FETCH ADDR; NOT; OR; IF STACK THEN; SELECT VIEW_CH3; CASE OFF; OUTPUT STRING ":CHAN3:DISP OFF;"; CASE ON; OUTPUT STRING ":CHAN3:DISP ON;"; END SELECT; ELSE ; FETCH 0; STORE VIEW_CH3; NOTIFY "Sorry, No Plug-In!!" ; END IF; END ACTIONS; PANEL SET ACTIONS; if VIEW_CH3 then; GET WF_CH3; end if; END ACTIONS; GET ACTIONS; IF Plug_in3 THEN; !Something in the slot OUTPUT STRING ":CHAN3:DISP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (VIEW_CH3)OFF; CASE 1; FETCH (VIEW_CH3)ON; CASE ELSE; FETCH VIEW_CH3; END SELECT; STORE VIEW_CH3; ELSE; IF ADDR THEN; FETCH 0; STORE VIEW_CH3; END IF; END IF; END ACTIONS; END COMPONENT; COMPONENT VIEW_WF_CH3 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; GET ACTIONS; SELECT VIEW_CH3; CASE OFF; FETCH (VIEW_WF_CH3)OFF; CASE ON; FETCH (VIEW_WF_CH3)ON; CASE ELSE; FETCH VIEW_WF_CH3; END SELECT; STORE VIEW_WF_CH3; END ACTIONS; END COMPONENT; !>> CHAN4 views ... COMPONENT VIEW_CH4; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; COUPLED VIEW_WF_CH4; SET ACTIONS; FETCH Plug_in4; FETCH ADDR; NOT; OR; IF STACK THEN; SELECT VIEW_CH4; CASE OFF; OUTPUT STRING ":CHAN4:DISP OFF;"; CASE ON; OUTPUT STRING ":CHAN4:DISP ON;"; END SELECT; else ; FETCH ( VIEW_CH4 ) OFF ; STORE VIEW_CH4 ; NOTIFY "Sorry, No Plug-In!!" ; end if ; END ACTIONS; PANEL SET ACTIONS; if VIEW_CH4 then; GET WF_CH4; end if; END ACTIONS; GET ACTIONS; IF Plug_in4 THEN; !Something in the slot OUTPUT STRING ":CHAN4:DISP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (VIEW_CH4)OFF; CASE 1; FETCH (VIEW_CH4)ON; CASE ELSE; FETCH VIEW_CH4; END SELECT; STORE VIEW_CH4; ELSE; IF ADDR THEN; FETCH 0; STORE VIEW_CH4; END IF; END IF; END ACTIONS; END COMPONENT; COMPONENT VIEW_WF_CH4 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; GET ACTIONS; SELECT VIEW_CH4; CASE OFF; FETCH (VIEW_WF_CH4)OFF; CASE ON; FETCH (VIEW_WF_CH4)ON; CASE ELSE; FETCH VIEW_WF_CH4; END SELECT; STORE VIEW_WF_CH4; END ACTIONS; END COMPONENT; !----------- Memory views ------------------ COMPONENT VMIN_WM1 NOERRCHECK; TYPE CONTINUOUS; INITIAL -2; GET ACTIONS; ! offset-range/2 ... GET WM1_OFFSET ; GET WM1_SENS ; FETCH WM1_OFFSET ; FETCH WM1_SENS ; FETCH 4 ; MUL; SUB; STORE VMIN_WM1; END ACTIONS; END COMPONENT; COMPONENT VMAX_WM1 NOERRCHECK; TYPE CONTINUOUS; INITIAL 2; GET ACTIONS; ! offset+range/2 ... FETCH WM1_OFFSET ; FETCH WM1_SENS ; FETCH 4; MUL; ADD; STORE VMAX_WM1; END ACTIONS; END COMPONENT; COMPONENT VMIN_WM2 NOERRCHECK; TYPE CONTINUOUS; INITIAL -2; GET ACTIONS; ! offset-range/2 ... GET WM2_OFFSET ; GET WM2_SENS ; FETCH WM2_OFFSET ; FETCH WM2_SENS ; FETCH 4 ; MUL; SUB; STORE VMIN_WM2; END ACTIONS; END COMPONENT; COMPONENT VMAX_WM2 NOERRCHECK; TYPE CONTINUOUS; INITIAL 2; GET ACTIONS; ! offset+range/2 ... FETCH WM2_OFFSET ; FETCH WM2_SENS ; FETCH 4; MUL; ADD; STORE VMAX_WM2; END ACTIONS; END COMPONENT; COMPONENT VMIN_WM3 NOERRCHECK; TYPE CONTINUOUS; INITIAL -2; GET ACTIONS; ! offset-range/2 ... GET WM3_OFFSET ; GET WM3_SENS ; FETCH WM3_OFFSET ; FETCH WM3_SENS ; FETCH 4 ; MUL; SUB; STORE VMIN_WM3; END ACTIONS; END COMPONENT; COMPONENT VMAX_WM3 NOERRCHECK; TYPE CONTINUOUS; INITIAL 2; GET ACTIONS; ! offset+range/2 ... FETCH WM3_OFFSET ; FETCH WM3_SENS ; FETCH 4; MUL; ADD; STORE VMAX_WM3; END ACTIONS; END COMPONENT; COMPONENT VMIN_WM4 NOERRCHECK; TYPE CONTINUOUS; INITIAL -2; GET ACTIONS; ! offset-range/2 ... GET WM4_OFFSET ; GET WM4_SENS ; FETCH WM4_OFFSET ; FETCH WM4_SENS ; FETCH 4 ; MUL; SUB; STORE VMIN_WM4; END ACTIONS; END COMPONENT; COMPONENT VMAX_WM4 NOERRCHECK; TYPE CONTINUOUS; INITIAL 2; GET ACTIONS; ! offset+range/2 ... FETCH WM4_OFFSET ; FETCH WM4_SENS ; FETCH 4; MUL; ADD; STORE VMAX_WM4; END ACTIONS; END COMPONENT; COMPONENT VIEW_WF_WM1 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; OUTPUT VIEW_WF_WM1 TABLE ":WMEM1:DISP OFF",":WMEM1:DISP ON" ; IF VIEW_WF_WM1 THEN; IF WM1_OK THEN ; GET WF_WM1; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS ; IF WM1_OK THEN ; SELECT WAVEMEM ; CASE 0 ; IF VIEW_WF_WM1 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM1 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM1 ; END IF ; CASE ELSE ; END SELECT ; ELSE ; INVALIDATE WF_WM1 ; IF LIVEMODE THEN; NOTIFY "Waveform Data May Not Be Valid - Please Save Again !" ; END IF ; END IF ; END ACTIONS ; GET ACTIONS; OUTPUT STRING ":WMEM1:DISP?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "OFF" ; FETCH ( VIEW_WF_WM1 ) OFF ; CASE "ON" ; FETCH ( VIEW_WF_WM1 ) ON ; CASE ELSE ; FETCH VIEW_WF_WM1 ; END SELECT ; STORE VIEW_WF_WM1 ; END ACTIONS; PANEL GET ACTIONS ; IF VIEW_WF_WM1 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM1 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM1 ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT VIEW_WF_WM2 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; OUTPUT VIEW_WF_WM2 TABLE ":WMEM2:DISP OFF",":WMEM2:DISP ON" ; IF VIEW_WF_WM2 THEN; IF WM2_OK THEN ; GET WF_WM2; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS ; IF WM2_OK THEN ; SELECT WAVEMEM ; CASE 1 ; IF VIEW_WF_WM2 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM2 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM2 ; END IF ; CASE ELSE ; END SELECT ; ELSE ; INVALIDATE WF_WM2 ; IF LIVEMODE THEN; NOTIFY "Waveform Data May Not Be Valid - Please Save Again !" ; END IF ; END IF ; END ACTIONS ; GET ACTIONS; OUTPUT STRING ":WMEM2:DISP?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "OFF" ; FETCH ( VIEW_WF_WM2 ) OFF ; CASE "ON" ; FETCH ( VIEW_WF_WM2 ) ON ; CASE ELSE ; FETCH VIEW_WF_WM2 ; END SELECT ; STORE VIEW_WF_WM2 ; END ACTIONS; PANEL GET ACTIONS ; IF VIEW_WF_WM2 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM2 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM2 ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT VIEW_WF_WM3 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; OUTPUT VIEW_WF_WM3 TABLE ":WMEM3:DISP OFF",":WMEM3:DISP ON" ; IF VIEW_WF_WM3 THEN; IF WM3_OK THEN ; GET WF_WM3; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS ; IF WM3_OK THEN ; SELECT WAVEMEM ; CASE 2 ; IF VIEW_WF_WM3 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM3 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM3 ; END IF ; CASE ELSE ; END SELECT ; ELSE ; INVALIDATE WF_WM3 ; IF LIVEMODE THEN; NOTIFY "Waveform Data May Not Be Valid - Please Save Again !" ; END IF ; END IF ; END ACTIONS ; GET ACTIONS; OUTPUT STRING ":WMEM3:DISP?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "OFF" ; FETCH ( VIEW_WF_WM3 ) OFF ; CASE "ON" ; FETCH ( VIEW_WF_WM3 ) ON ; CASE ELSE ; FETCH VIEW_WF_WM3 ; END SELECT ; STORE VIEW_WF_WM3 ; END ACTIONS; PANEL GET ACTIONS ; IF VIEW_WF_WM3 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM3 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM3 ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT VIEW_WF_WM4 NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; OUTPUT VIEW_WF_WM4 TABLE ":WMEM1:DISP OFF",":WMEM1:DISP ON" ; IF VIEW_WF_WM4 THEN; IF WM4_OK THEN ; GET WF_WM4; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS ; IF WM4_OK THEN ; SELECT WAVEMEM ; CASE 3 ; IF VIEW_WF_WM4 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM4 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM4 ; END IF ; CASE ELSE ; END SELECT ; ELSE ; INVALIDATE WF_WM4 ; IF LIVEMODE THEN; NOTIFY "Waveform Data May Not Be Valid - Please Save Again !" ; END IF ; END IF ; END ACTIONS ; GET ACTIONS; OUTPUT STRING ":WMEM4:DISP?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "OFF" ; FETCH ( VIEW_WF_WM4 ) OFF ; CASE "ON" ; FETCH ( VIEW_WF_WM4 ) ON ; CASE ELSE ; FETCH VIEW_WF_WM4 ; END SELECT ; STORE VIEW_WF_WM4 ; END ACTIONS; PANEL GET ACTIONS ; IF VIEW_WF_WM4 THEN ; SHOW WMEMORY_MORE ; SHOW WMEMORY_SCR2_WM4 ; ELSE ; HIDE WMEMORY_MORE ; HIDE WMEMORY_SCR2_WM4 ; END IF ; END ACTIONS ; END COMPONENT; !============================== ! TIMEBASE SUBSYSTEM !============================== COMPONENT TIME_SENS ; TYPE CONTINUOUS; VALUES RANGE 100E-12,1 ; ! LOG 3,1; INITIAL 20E-6; COUPLED TIME_SENS,TIME_DELAY,WF_TMIN,WF_TMAX,NUM_POINTS,TIME_INCR,TIME_SENS_INCR, TIME_WIND_SENS,TIME_WIND_DELAY, TIME_DELAY_MAX,TIME_DELAY_MIN, WIN_TMIN, WIN_TMAX, MARKER_X1_MIN,MARKER_X2_MIN,MARKER_X1_MAX,MARKER_X2_MAX ; SET ACTIONS; FETCH TIME_SENS; FETCH 10; MUL; ! range is 10x sensitivity ...; OUTPUT STACK FORMAT '":TIM:RANG ",K'; END ACTIONS; GET ACTIONS; OUTPUT STRING ":TIM:RANG?"; ENTER STACK FORMAT K; FETCH 10; DIV; ! range is 10x sensitivity ...; STORE TIME_SENS; !get Min_risetime; get Max_risetime; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT TIME_DELAY; TYPE CONTINUOUS; !VALUES RANGE -10,10; VALUES RANGE TIME_DELAY_MIN, TIME_DELAY_MAX ; INITIAL 0; COUPLED TIME_DELAY,WF_TMIN,WF_TMAX,TIME_SENS_INCR,TIME_WIND_SENS,TIME_WIND_DELAY, WIN_TMIN,WIN_TMAX,MARKER_X1_MIN,MARKER_X2_MIN,MARKER_X1_MAX,MARKER_X2_MAX ; SET ACTIONS; OUTPUT TIME_DELAY FORMAT '":TIM:DEL ",K'; END ACTIONS; GET ACTIONS; OUTPUT STRING ":TIM:DEL?"; ENTER TIME_DELAY FORMAT K; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT TIME_DELAY_MAX NOGEN NOERRCHECK ; TYPE CONTINUOUS ; INITIAL +1 ; GET ACTIONS ; FETCH TIME_SENS ; FETCH 100E-3 ; LE ; IF STACK THEN ; !FETCH 1 ; STORE TIME_DELAY_MAX ; FETCH 1E+12; FETCH 1E-12; MUL ; STORE TIME_DELAY_MAX ; ELSE ; FETCH TIME_SENS ; FETCH 10 ; MUL ; STORE TIME_DELAY_MAX ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TIME_DELAY_MIN NOGEN, NOERRCHECK ; TYPE CONTINUOUS ; INITIAL -1 ; GET ACTIONS ; FETCH TIME_SENS ; FETCH 100E-3 ; LE ; IF STACK THEN ; !FETCH -1 ; STORE TIME_DELAY_MIN ; FETCH -1E+12; FETCH 1E-12; MUL ; STORE TIME_DELAY_MIN ; ELSE ; FETCH TIME_SENS ; FETCH 10 ; MUL ; FETCH -1 ; MUL ; STORE TIME_DELAY_MIN ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TIME_REF; TYPE DISCRETE; VALUES LEFT,CENTER,RIGHT; INITIAL CENTER; COUPLED WF_TMIN,WF_TMAX,TIME_WIND_DELAY, MARKER_X1_MIN,MARKER_X2_MIN,MARKER_X1_MAX,MARKER_X2_MAX ; ! TIME_DELAY SET ACTIONS; OUTPUT STRING ":TIM:REF "; OUTPUT TIME_REF TABLE 'LEFT','CENT','RIGHT'; !GET Time_Delay; ! check this out - this is in Jay's driver END ACTIONS; GET ACTIONS; OUTPUT STRING ":TIM:REF?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "LEFT"; FETCH (TIME_REF)LEFT; CASE "CENT"; FETCH (TIME_REF)CENTER; CASE "RIGHT"; FETCH (TIME_REF)RIGHT; CASE ELSE; FETCH TIME_REF; END SELECT; STORE TIME_REF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT WF_TMIN NOERRCHECK; TYPE CONTINUOUS; INITIAL -100E-6; GET ACTIONS; SELECT TIME_REF; CASE LEFT; FETCH TIME_DELAY; CASE CENTER; FETCH TIME_DELAY; FETCH TIME_SENS; FETCH 5; MUL; SUB; CASE RIGHT ; FETCH Time_Delay; FETCH Time_Sens; FETCH 10; MUL; SUB; END SELECT; STORE WF_TMIN; END ACTIONS; END COMPONENT; COMPONENT WF_TMAX NOERRCHECK; TYPE CONTINUOUS; INITIAL 100E-6; GET ACTIONS; SELECT TIME_REF; CASE LEFT; FETCH TIME_DELAY; FETCH TIME_SENS; FETCH 10; MUL; ADD; CASE CENTER; FETCH TIME_DELAY; FETCH TIME_SENS; FETCH 5; MUL; ADD; CASE RIGHT; FETCH Time_Delay; END SELECT; STORE WF_TMAX; END ACTIONS; END COMPONENT; COMPONENT Time_Incr NOTSAVED NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 200E-9; GET ACTIONS; FETCH Time_Sens; !FETCH 2; DIV; FETCH 100; DIV ; STORE Time_Incr; END ACTIONS; END COMPONENT; !modified for 1 COMPONENT Time_Sens_Incr NOGEN NOERRCHECK; TYPE CONTINUOUS; !INITIAL ?????; GET ACTIONS; FETCH Time_Sens; FETCH 5; DIV; STORE Time_Sens_Incr; END ACTIONS; END COMPONENT; COMPONENT Time_Wind_Stat ; TYPE DISCRETE ; VALUES MAIN,WIND ; INITIAL MAIN ; SET ACTIONS ; OUTPUT STRING ":TIM:VIEW " ; OUTPUT Time_Wind_Stat TABLE 'MAIN;','WIND;'; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; GET ACTIONS ; OUTPUT STRING ":TIM:VIEW?" ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "MAIN"; FETCH (Time_Wind_Stat) MAIN; CASE "WIND"; FETCH (Time_Wind_Stat) WIND; CASE ELSE; FETCH Time_Wind_Stat; END SELECT ; STORE Time_Wind_Stat; END ACTIONS ; END COMPONENT ; COMPONENT Time_Wind_Delay; TYPE CONTINUOUS; VALUES RANGE WIN_TMIN,WIN_TMAX; ! check this out INITIAL 0 ; COUPLED TIME_WIND_DELAY ; SET ACTIONS; OUTPUT STRING ":TIM:WIND:DEL "; OUTPUT Time_Wind_Delay FORMAT 'K,";"'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; GET ACTIONS; OUTPUT STRING ":TIM:WIND:DEL?;"; ENTER Time_Wind_Delay FORMAT K; END ACTIONS; END COMPONENT; COMPONENT Time_Wind_Sens; TYPE CONTINUOUS; VALUES RANGE 1E-12,TIME_SENS; ! check this out INITIAL 10E-6; COUPLED TIME_WIND_SENS,WIN_TMIN,WIN_TMAX,TIME_WIND_DELAY ; !TIME_INCR,TIME_SENS_INCR SET ACTIONS; FETCH Time_Wind_Sens; FETCH 10; MUL; ! range is 10x sensitivity ... OUTPUT STACK FORMAT '":TIM:WIND:RANG ",K,";"'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; GET ACTIONS; OUTPUT STRING ":TIM:WIND:RANG?;"; ENTER STACK FORMAT K; FETCH 10; DIV; ! range is 10x sensitivity ... STORE Time_Wind_Sens; END ACTIONS; END COMPONENT; COMPONENT WIN_TMIN NOERRCHECK; ! check it out with Ed - precision problem !! TYPE CONTINUOUS; INITIAL -50E-6; GET ACTIONS; FETCH TIME_SENS ; FETCH TIME_WIND_SENS ; EQ ; IF STACK THEN ; FETCH TIME_DELAY ; STORE WIN_TMIN ; ELSE ; SELECT TIME_REF; CASE LEFT; FETCH TIME_DELAY; CASE CENTER; FETCH TIME_DELAY; FETCH TIME_SENS ; FETCH TIME_WIND_SENS; SUB ;FETCH 5; MUL; SUB; CASE RIGHT ; FETCH Time_Delay; FETCH TIME_SENS ; FETCH Time_WIND_SENS; SUB ;FETCH 10; MUL; SUB; END SELECT; STORE WIN_TMIN; END IF ; END ACTIONS; END COMPONENT; COMPONENT WIN_TMAX NOERRCHECK; TYPE CONTINUOUS; INITIAL 50E-6; GET ACTIONS; FETCH TIME_SENS ; FETCH TIME_WIND_SENS ; EQ ; IF STACK THEN ; FETCH TIME_DELAY ; STORE WIN_TMAX ; ELSE ; SELECT TIME_REF; CASE LEFT; FETCH TIME_DELAY; FETCH TIME_SENS; FETCH TIME_WIND_SENS; SUB; FETCH 10; MUL; ADD; CASE CENTER; FETCH TIME_DELAY; FETCH TIME_SENS ;FETCH TIME_WIND_SENS; SUB; FETCH 5; MUL; ADD; CASE RIGHT; FETCH Time_Delay; END SELECT; STORE WIN_TMAX; END IF ; END ACTIONS; END COMPONENT; !============================== ! TRIGGER SUBSYSTEM !============================== COMPONENT TRIGGER_MODE; TYPE DISCRETE; VALUES EDGE,GLITCH,PATTERN,STATE,DEVENTS,DTIME; ! Some enabling/Disabling to be taken care of INITIAL EDGE; COUPLED TRIGGER_INCR,GLITCH_TRIGGER_GTLT ; ! TRIGGER_HOLDOFF SET ACTIONS; SELECT TRIGGER_MODE ; CASE GLITCH ; SET GLITCH_TRIGGER_GTLT ; CASE ELSE ; OUTPUT STRING ":TRIG:MODE "; OUTPUT TRIGGER_MODE TABLE 'EDGE;','GLIT;','PATT;','STAT;','DEV','DTIM'; END SELECT ; END ACTIONS; PANEL SET ACTIONS ; SET TRIGGER_LEVEL_UNITS ; HIDE TRIGGER_SUBSYSTEM, EDGE_MODE; HIDE TRIGGER_SUBSYSTEM, GLITCH_MODE ; HIDE TRIGGER_SUBSYSTEM, PATTERN_MODE; HIDE TRIGGER_SUBSYSTEM, STATE_MODE; HIDE TRIGGER_SUBSYSTEM, DEVENT_MODE ; HIDE TRIGGER_SUBSYSTEM, DTIME_MODE ; SELECT TRIGGER_MODE; CASE EDGE; SHOW TRIGGER_SUBSYSTEM, EDGE_MODE; GOSUB Get_Edge_Trigger_Levels ; CASE GLITCH ; SHOW TRIGGER_SUBSYSTEM, GLITCH_MODE; GOSUB Get_Glitch_Trigger_Levels ; CASE PATTERN; SHOW TRIGGER_SUBSYSTEM, PATTERN_MODE; CASE STATE; SHOW TRIGGER_SUBSYSTEM, STATE_MODE; GOSUB Get_State_Trigger_Levels ; CASE DEVENTS ; SHOW TRIGGER_SUBSYSTEM, DEVENT_MODE; GOSUB Get_Devent_Trigger_Levels ; GOSUB Get_Devent_Arm_Levels ; GOSUB Get_Devent_Event_Levels ; CASE DTIME ; SHOW TRIGGER_SUBSYSTEM, DTIME_MODE; GOSUB Get_Dtime_Trigger_Levels ; GOSUB Get_Dtime_Arm_Levels ; END SELECT; END ACTIONS ; GET ACTIONS; OUTPUT STRING ":TRIG:MODE?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "EDGE"; FETCH (TRIGGER_MODE)EDGE ; CASE "GLIT"; FETCH (TRIGGER_MODE)GLITCH ; CASE "PATT"; FETCH (TRIGGER_MODE)PATTERN; CASE "STAT"; FETCH (TRIGGER_MODE)STATE; CASE "DEV" ; FETCH (TRIGGER_MODE)DEVENTS ; CASE "DTIM" ; FETCH (TRIGGER_MODE)DTIME ; CASE ELSE; FETCH TRIGGER_MODE; ! impt. as GGTH is not trapped here END SELECT; STORE TRIGGER_MODE; END ACTIONS; END COMPONENT; COMPONENT SWEEP_MODE; ! 'TIMEBASE' command, but always used here ... TYPE DISCRETE; VALUES AUTO,TRIGGER; INITIAL AUTO; SET ACTIONS; OUTPUT STRING ":TRIG:SWE "; OUTPUT SWEEP_MODE TABLE 'AUTO;','TRIG;'; END ACTIONS; PANEL SET ACTIONS; HIDE No_Trigger; !! GOSUB UPDATE_TRACE_DATA; END ACTIONS; GET ACTIONS; OUTPUT STRING ":TRIG:SWE?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "AUTO"; FETCH (SWEEP_MODE)AUTO; CASE "TRIG"; FETCH (SWEEP_MODE)TRIGGER; CASE ELSE; FETCH SWEEP_MODE; END SELECT; STORE SWEEP_MODE; END ACTIONS; PANEL GET ACTIONS; HIDE No_Trigger; END ACTIONS; END COMPONENT; COMPONENT MIN_TRIG_LVL_CH1 ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT MAX_TRIG_LVL_CH1 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT MIN_TRIG_LVL_CH2 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT MAX_TRIG_LVL_CH2 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT MIN_TRIG_LVL_CH3 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT MAX_TRIG_LVL_CH3 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT MIN_TRIG_LVL_CH4 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT MAX_TRIG_LVL_CH4 CLONE MIN_TRIG_LVL_CH1 ; COMPONENT TRIGGER_LEVEL_UNITS NOGEN ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; SET ACTIONS ; SELECT TRIGGER_MODE ; CASE EDGE ; FETCH EDGE_TRIGGER_SOURCE ; GOSUB Set_Trigger_Units ; CASE GLITCH; FETCH GLITCH_TRIGGER_SOURCE ; GOSUB Set_Trigger_Units ; CASE PATTERN; CASE STATE; FETCH STATE_TRIGGER_SOURCE ; GOSUB Set_Trigger_Units ; CASE DEVENTS; FETCH DEVENT_ARM_SOURCE ; GOSUB Set_Trigger_Units ; FETCH TRIGGER_LEVEL_UNITS ; STORE DEVENTS_ARM_UNITS ; FETCH DEVENT_TRIGGER_SOURCE ; GOSUB Set_Trigger_Units ; FETCH TRIGGER_LEVEL_UNITS ; STORE DEVENTS_TRIGGER_UNITS ; FETCH DEVENT_EVENT_SOURCE ; GOSUB Set_Trigger_Units ; FETCH TRIGGER_LEVEL_UNITS ; STORE DEVENTS_EVENT_UNITS ; CASE DTIME; FETCH DTIME_ARM_SOURCE ; GOSUB Set_Trigger_Units ; FETCH TRIGGER_LEVEL_UNITS ; STORE DTIME_ARM_UNITS ; FETCH DTIME_TRIGGER_SOURCE ; GOSUB Set_Trigger_Units ; FETCH TRIGGER_LEVEL_UNITS ; STORE DTIME_TRIGGER_UNITS ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT DEVENTS_ARM_UNITS NOGEN ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; END COMPONENT ; COMPONENT DEVENTS_TRIGGER_UNITS CLONE DEVENTS_ARM_UNITS ; COMPONENT DEVENTS_EVENT_UNITS CLONE DEVENTS_ARM_UNITS ; COMPONENT DTIME_ARM_UNITS CLONE DEVENTS_ARM_UNITS ; COMPONENT DTIME_TRIGGER_UNITS CLONE DEVENTS_ARM_UNITS ; ACTIONS Set_Trigger_Units ; SELECT STACK ; CASE 0 ; FETCH UNITS_CH1_DISP ; CASE 1 ; FETCH UNITS_CH2_DISP ; CASE 2 ; FETCH UNITS_CH3_DISP ; CASE 3 ; FETCH UNITS_CH4_DISP ; END SELECT ; STORE TRIGGER_LEVEL_UNITS ; END ACTIONS ; COMPONENT TRIGGER_LEVEL_CH1; TYPE CONTINUOUS; VALUES RANGE MIN_TRIG_LVL_CH1,MAX_TRIG_LVL_CH1 ; INITIAL 0.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; ! Valid since these are psuedo-GETs ... SET ACTIONS; IF Plug_In1 THEN ; OUTPUT TRIGGER_LEVEL_CH1 FORMAT '":TRIG:LEV CHAN1, ",K,";"'; END IF ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; GET ACTIONS; IF Plug_In1 THEN ; ! Thanks to Rev 2.02 OUTPUT STRING ":TRIG:LEV? CHAN1;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH1 FORMAT K; END IF ; END ACTIONS; END COMPONENT; COMPONENT TRIGGER_LEVEL_CH2; TYPE CONTINUOUS; VALUES RANGE MIN_TRIG_LVL_CH2,MAX_TRIG_LVL_CH2 ; INITIAL 0.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE; ! Valid since these are psuedo-GETs ... SET ACTIONS; IF Plug_In2 THEN ; OUTPUT TRIGGER_LEVEL_CH2 FORMAT '":TRIG:LEV CHAN2, ",K,";"'; ELSE ; FETCH SLOT_21A ; FETCH 1 ; EQ ; IF STACK THEN ; OUTPUT TRIGGER_LEVEL_CH2 FORMAT '":TRIG:LEV CHAN2, ",K,";"'; END IF ; END IF ; END ACTIONS; GET ACTIONS; IF Plug_In2 THEN ; OUTPUT STRING ":TRIG:LEV? CHAN2;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH2 FORMAT K; ELSE ; FETCH SLOT_21A ; FETCH 1 ; EQ ; IF STACK THEN ; OUTPUT STRING ":TRIG:LEV? CHAN2;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH2 FORMAT K; END IF ; END IF ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT TRIGGER_LEVEL_CH3; TYPE CONTINUOUS; VALUES RANGE MIN_TRIG_LVL_CH3,MAX_TRIG_LVL_CH3 ; INITIAL 0.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; ! Valid since these are psuedo-GETs ... SET ACTIONS; IF Plug_In3 THEN ; OUTPUT TRIGGER_LEVEL_CH3 FORMAT '":TRIG:LEV CHAN3, ",K,";"'; ELSE ; FETCH SLOT_21A ; FETCH 2 ; EQ ; IF STACK THEN ; OUTPUT TRIGGER_LEVEL_CH3 FORMAT '":TRIG:LEV CHAN3, ",K,";"'; END IF ; END IF ; END ACTIONS; GET ACTIONS; If Plug_In3 THEN ; OUTPUT STRING ":TRIG:LEV? CHAN3;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH3 FORMAT K; ELSE ; FETCH SLOT_21A ; FETCH 2 ; EQ ; IF STACK THEN ; OUTPUT STRING ":TRIG:LEV? CHAN3;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH3 FORMAT K; END IF ; END IF ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT TRIGGER_LEVEL_CH4; TYPE CONTINUOUS; VALUES RANGE MIN_TRIG_LVL_CH4,MAX_TRIG_LVL_CH4 ; INITIAL 0.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; ! Valid since these are psuedo-GETs ... SET ACTIONS; IF Plug_In4 THEN ; OUTPUT TRIGGER_LEVEL_CH4 FORMAT '":TRIG:LEV CHAN4, ",K,";"'; ELSE ; FETCH SLOT_21A ; FETCH 3 ; EQ ; IF STACK THEN ; OUTPUT TRIGGER_LEVEL_CH4 FORMAT '":TRIG:LEV CHAN4, ",K,";"'; END IF ; END IF ; END ACTIONS; GET ACTIONS; If Plug_In4 THEN ; OUTPUT STRING ":TRIG:LEV? CHAN4;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH4 FORMAT K; ELSE ; FETCH SLOT_21A ; FETCH 3 ; EQ ; IF STACK THEN ; OUTPUT STRING ":TRIG:LEV? CHAN4;"; !ENTER STACK FORMAT "#,K" ; DROP ; ENTER TRIGGER_LEVEL_CH4 FORMAT K; END IF ; END IF ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; ACTIONS Get_Trigger_Ranges ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; SELECT STACK ; CASE 0 ; CASE 1 ; GOSUB Get_Trigger_Range_11A ; CASE 2 ; GOSUB Get_Trigger_Range_12A ; CASE 3 ; GOSUB Get_Trigger_Range_13A ; CASE 4 ; GOSUB Get_Trigger_Range_21A ; CASE 5 ; GOSUB Get_Trigger_Range_22A ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS Get_Trigger_Range_11A ; FETCH TRIG_11A_PROBE ; FETCH 1 ; MUL ; DUP ; FETCH -1 ; MUL ; SELECT SLOT_11A ; CASE 0 ; CASE 1 ; STORE MIN_TRIG_LVL_CH1 ; STORE MAX_TRIG_LVL_CH1 ; CASE 2 ; STORE MIN_TRIG_LVL_CH2 ; STORE MAX_TRIG_LVL_CH2 ; CASE 3 ; STORE MIN_TRIG_LVL_CH3 ; STORE MAX_TRIG_LVL_CH3 ; CASE 4 ; STORE MIN_TRIG_LVL_CH4 ; STORE MAX_TRIG_LVL_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Trigger_Range_12A ; SELECT SLOT_12A ; CASE 0 ; FETCH 0; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; FETCH 12 ; MUL ; DUP ; FETCH -1 ; MUL ; SELECT SLOT_12A ; CASE 0 ; CASE 1 ; STORE MIN_TRIG_LVL_CH1 ; STORE MAX_TRIG_LVL_CH1 ; CASE 2 ; STORE MIN_TRIG_LVL_CH2 ; STORE MAX_TRIG_LVL_CH2 ; CASE 3 ; STORE MIN_TRIG_LVL_CH3 ; STORE MAX_TRIG_LVL_CH3 ; CASE 4 ; STORE MIN_TRIG_LVL_CH4 ; STORE MAX_TRIG_LVL_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Trigger_Range_13A ; SELECT SLOT_13A ; CASE 0 ; FETCH 0; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; FETCH 12 ; MUL ; DUP ; FETCH -1 ; MUL ; SELECT SLOT_13A ; CASE 0; CASE 1 ; STORE MIN_TRIG_LVL_CH1 ; STORE MAX_TRIG_LVL_CH1 ; CASE 2 ; STORE MIN_TRIG_LVL_CH2 ; STORE MAX_TRIG_LVL_CH2 ; CASE 3 ; STORE MIN_TRIG_LVL_CH3 ; STORE MAX_TRIG_LVL_CH3 ; CASE 4 ; STORE MIN_TRIG_LVL_CH4 ; STORE MAX_TRIG_LVL_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Trigger_Range_21A ; SELECT SLOT_21A ; CASE 0 ; FETCH 0; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; FETCH 12 ; MUL ; DUP ; FETCH -1 ; MUL ; SELECT SLOT_21A ; CASE 0 ; CASE 1 ; STORE MIN_TRIG_LVL_CH1 ; STORE MAX_TRIG_LVL_CH1 ; FETCH 1 ; FETCH TRIG_21A_PROBE ; MUL ; DUP ; FETCH -1 ; MUL ; STORE MIN_TRIG_LVL_CH2 ; STORE MAX_TRIG_LVL_CH2 ; CASE 2 ; STORE MIN_TRIG_LVL_CH2 ; STORE MAX_TRIG_LVL_CH2 ; FETCH 1 ; FETCH TRIG_21A_PROBE ; MUL ; DUP ; FETCH -1 ; MUL ; STORE MIN_TRIG_LVL_CH3 ; STORE MAX_TRIG_LVL_CH3 ; CASE 3 ; STORE MIN_TRIG_LVL_CH3 ; STORE MAX_TRIG_LVL_CH3 ; FETCH 1 ; FETCH TRIG_21A_PROBE ; MUL ; DUP ; FETCH -1 ; MUL ; STORE MIN_TRIG_LVL_CH4 ; STORE MAX_TRIG_LVL_CH4 ; CASE 4 ; STORE MIN_TRIG_LVL_CH4 ; STORE MAX_TRIG_LVL_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Trigger_Range_22A ; FETCH TRIG_22A_PROBE_1 ; FETCH 1 ; MUL ; DUP ; FETCH -1 ; MUL ; STORE MIN_TRIG_LVL_CH1 ; STORE MAX_TRIG_LVL_CH1 ; FETCH TRIG_22A_PROBE_2 ; FETCH 1 ; MUL ; DUP ; FETCH -1 ; MUL ; STORE MIN_TRIG_LVL_CH4 ; STORE MAX_TRIG_LVL_CH4 ; END ACTIONS ; COMPONENT TRIGGER_HOLDOFF; TYPE CONTINUOUS; VALUES RANGE 60E-9,320E-9; ! check it out - Jay - 40E-9,320E-3 INITIAL 140E-9; COUPLED TRIGGER_HOLDOFF ; SET ACTIONS; ! Assumes proper trigger mode already set ... OUTPUT STRING ":TRIG:HOLD "; OUTPUT TRIGGER_HOLDOFF FORMAT 'K,";"'; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... OUTPUT STRING ":TRIG:HOLD?;"; ! ENTER CHARSTRING FORMAT "#,5A"; ! consumes "TIME," header ... ENTER TRIGGER_HOLDOFF FORMAT K; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT TRIGGER_HYSTERSIS; TYPE DISCRETE; VALUES NREJ,NORM,HSEN; INITIAL NORM; SET ACTIONS; OUTPUT STRING ":TRIG:HYST "; OUTPUT TRIGGER_HYSTERSIS TABLE 'NREJ;','NORM;','HSEN;'; END ACTIONS; GET ACTIONS; OUTPUT STRING ":TRIG:HYST?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NREJ"; FETCH (TRIGGER_HYSTERSIS)NREJ ; CASE "NORM"; FETCH (TRIGGER_HYSTERSIS)NORM ; CASE "HSEN"; FETCH (TRIGGER_HYSTERSIS)HSEN; CASE ELSE; FETCH TRIGGER_HYSTERSIS; END SELECT; STORE TRIGGER_HYSTERSIS; END ACTIONS; END COMPONENT; !>> 'EDGE' mode COMPONENT EDGE_TRIGGER_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED EDGE_TRIGGER_SLOPE,EDGE_TRIGGER_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 0; OUTPUT STRING ":TRIG:SOURCE "; OUTPUT EDGE_TRIGGER_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 0; OUTPUT STRING ":TRIG:SOURCE?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (EDGE_TRIGGER_SOURCE)CH1; CASE "TRIG1"; FETCH (EDGE_TRIGGER_SOURCE)CH1; CASE "CHAN2"; FETCH (EDGE_TRIGGER_SOURCE)CH2; CASE "TRIG2"; FETCH (EDGE_TRIGGER_SOURCE)CH2; CASE "CHAN3"; FETCH (EDGE_TRIGGER_SOURCE)CH3; CASE "TRIG3"; FETCH (EDGE_TRIGGER_SOURCE)CH3; CASE "CHAN4"; FETCH (EDGE_TRIGGER_SOURCE)CH4; CASE "TRIG4"; FETCH (EDGE_TRIGGER_SOURCE)CH4; CASE ELSE; FETCH EDGE_TRIGGER_SOURCE; END SELECT; STORE EDGE_TRIGGER_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; !GOSUB UPDATE_TRACE_DATA; SELECT TRIGGER_MODE; CASE 0; GOSUB Get_Edge_Trigger_Levels ; CASE ELSE ; END SELECT ; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; END COMPONENT; COMPONENT EDGE_TRIGGER_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL POSITIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 0; OUTPUT STRING ":TRIG:SLOPE "; OUTPUT EDGE_TRIGGER_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 0; OUTPUT STRING ":TRIG:SLOPE?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (EDGE_TRIGGER_SLOPE)NEGATIVE; CASE "POS"; FETCH (EDGE_TRIGGER_SLOPE)POSITIVE; CASE ELSE; FETCH EDGE_TRIGGER_SLOPE; END SELECT; STORE EDGE_TRIGGER_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT EDGE_TRIG_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT EDGE_TRIG_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Edge_Trigger_Levels ; SELECT EDGE_TRIGGER_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE EDGE_TRIG_MIN_LVL ; SELECT EDGE_TRIGGER_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE EDGE_TRIG_MAX_LVL ; END ACTIONS ; COMPONENT EDGE_TRIGGER_LEVEL NOTSAVED NOGEN; TYPE CONTINUOUS; VALUES RANGE EDGE_TRIG_MIN_LVL,EDGE_TRIG_MAX_LVL ; !values range -1E4 1E4 1E-9; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH EDGE_TRIGGER_LEVEL; SELECT EDGE_TRIGGER_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE EDGE_TRIGGER_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT EDGE_TRIGGER_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE EDGE_TRIGGER_LEVEL; END ACTIONS; END COMPONENT; COMPONENT EDGE_TRIGGER_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT EDGE_TRIGGER_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE EDGE_TRIGGER_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; !>> 'GLITCH' mode COMPONENT GLITCH_TRIGGER_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED GLITCH_TRIGGER_SLOPE,GLITCH_TRIGGER_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 1; ! GLITCH Mode OUTPUT STRING ":TRIG:GLIT:SOUR "; OUTPUT GLITCH_TRIGGER_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 1; OUTPUT STRING ":TRIG:GLIT:SOUR?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (GLITCH_TRIGGER_SOURCE)CH1; CASE "TRIG1"; FETCH (GLITCH_TRIGGER_SOURCE)CH1; CASE "CHAN2"; FETCH (GLITCH_TRIGGER_SOURCE)CH2; CASE "TRIG2"; FETCH (GLITCH_TRIGGER_SOURCE)CH2; CASE "CHAN3"; FETCH (GLITCH_TRIGGER_SOURCE)CH3; CASE "TRIG3"; FETCH (GLITCH_TRIGGER_SOURCE)CH3; CASE "CHAN4"; FETCH (GLITCH_TRIGGER_SOURCE)CH4; CASE "TRIG4"; FETCH (GLITCH_TRIGGER_SOURCE)CH4; CASE ELSE; FETCH GLITCH_TRIGGER_SOURCE; END SELECT; STORE GLITCH_TRIGGER_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 1 ; GOSUB Get_Glitch_Trigger_Levels ; CASE ELSE ; END SELECT ; SET TRIGGER_LEVEL_UNITS ; !GOSUB UPDATE_TRACE_DATA; END ACTIONS ; END COMPONENT; COMPONENT GLITCH_TRIGGER_GTLT ; ! Check it out - HPIB command does not seem to work ! TYPE DISCRETE; VALUES LTH,GTH; INITIAL LTH; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 1; OUTPUT STRING ":TRIG:MODE "; OUTPUT GLITCH_TRIGGER_GTLT TABLE 'GLTH;','GGTH;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 1; OUTPUT STRING ":TRIG:MODE?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "GLTH"; FETCH (GLITCH_TRIGGER_GTLT)LTH; STORE GLITCH_TRIGGER_GTLT; CASE "GGTH"; FETCH (GLITCH_TRIGGER_GTLT)GTH; STORE GLITCH_TRIGGER_GTLT; CASE ELSE; END SELECT; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT GLITCH_TRIGGER_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL NEGATIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 1; OUTPUT STRING ":TRIG:GLIT:POL "; OUTPUT GLITCH_TRIGGER_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 1; OUTPUT STRING ":TRIG:GLIT:POL?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (GLITCH_TRIGGER_SLOPE)NEGATIVE; CASE "POS"; FETCH (GLITCH_TRIGGER_SLOPE)POSITIVE; CASE ELSE; FETCH GLITCH_TRIGGER_SLOPE; END SELECT; STORE GLITCH_TRIGGER_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT GLITCH_TRIG_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT GLITCH_TRIG_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Glitch_Trigger_Levels ; SELECT GLITCH_TRIGGER_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE GLITCH_TRIG_MIN_LVL ; SELECT GLITCH_TRIGGER_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE GLITCH_TRIG_MAX_LVL ; END ACTIONS ; COMPONENT GLITCH_TRIGGER_LEVEL NOTSAVED NOGEN; TYPE CONTINUOUS; VALUES RANGE GLITCH_TRIG_MIN_LVL, GLITCH_TRIG_MAX_LVL ; !values range -1E4 1E4 1E-9; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH GLITCH_TRIGGER_LEVEL; SELECT GLITCH_TRIGGER_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE GLITCH_TRIGGER_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT GLITCH_TRIGGER_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE GLITCH_TRIGGER_LEVEL; END ACTIONS; END COMPONENT; COMPONENT GLITCH_TRIGGER_WIDTH ; TYPE CONTINUOUS; VALUES RANGE 3E-9,160E-9; ! check it out - Jay - 40E-9,320E-3 INITIAL 20E-9; COUPLED GLITCH_TRIGGER_WIDTH ; SET ACTIONS; ! Assumes proper trigger mode already set ... SELECT TRIGGER_MODE ; CASE 1 ; OUTPUT STRING ":TRIG:GLIT:WIDTH "; OUTPUT GLITCH_TRIGGER_WIDTH FORMAT 'K,";"'; CASE ELSE ; END SELECT ; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... SELECT TRIGGER_MODE ; CASE 1 ; OUTPUT STRING ":TRIG:GLIT:WIDTH?;"; ! ENTER CHARSTRING FORMAT "#,5A"; ! consumes "TIME," header ... ENTER GLITCH_TRIGGER_WIDTH FORMAT K; CASE ELSE ; END SELECT ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT GLITCH_TRIGGER_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT GLITCH_TRIGGER_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE GLITCH_TRIGGER_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; !>> 'STATE' mode COMPONENT STATE_TRIGGER_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED STATE_TRIGGER_SLOPE,STATE_TRIGGER_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:CLOC "; OUTPUT STATE_TRIGGER_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 3; OUTPUT STRING ":TRIG:STAT:CLOC?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "1"; FETCH (STATE_TRIGGER_SOURCE)CH1; CASE "2"; FETCH (STATE_TRIGGER_SOURCE)CH2; CASE "3"; FETCH (STATE_TRIGGER_SOURCE)CH3; CASE "4"; FETCH (STATE_TRIGGER_SOURCE)CH4; CASE ELSE; FETCH STATE_TRIGGER_SOURCE; END SELECT; STORE STATE_TRIGGER_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 3 ; GOSUB Get_State_Trigger_Levels ; CASE ELSE ; END SELECT ; SET TRIGGER_LEVEL_UNITS ; !GOSUB UPDATE_TRACE_DATA; END ACTIONS ; END COMPONENT; COMPONENT STATE_TRIGGER_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL POSITIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:SLOPE "; OUTPUT STATE_TRIGGER_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:SLOPE?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (STATE_TRIGGER_SLOPE)NEGATIVE; CASE "POS"; FETCH (STATE_TRIGGER_SLOPE)POSITIVE; CASE ELSE; FETCH STATE_TRIGGER_SLOPE; END SELECT; STORE STATE_TRIGGER_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT STATE_TRIG_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT STATE_TRIG_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_State_Trigger_Levels ; SELECT STATE_TRIGGER_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE STATE_TRIG_MIN_LVL ; SELECT STATE_TRIGGER_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE STATE_TRIG_MAX_LVL ; END ACTIONS ; COMPONENT STATE_TRIGGER_LEVEL NOGEN; TYPE CONTINUOUS; VALUES RANGE STATE_TRIG_MIN_LVL,STATE_TRIG_MAX_LVL ; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH STATE_TRIGGER_LEVEL; SELECT STATE_TRIGGER_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE STATE_TRIGGER_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT STATE_TRIGGER_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE STATE_TRIGGER_LEVEL; END ACTIONS; END COMPONENT; COMPONENT STATE_TRIGGER_UPDATE NOTSAVED NOGEN NOERRCHECK; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT STATE_TRIGGER_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE STATE_TRIGGER_LEVEL; END ACTIONS; END COMPONENT; !>> STATE LOGIC COMPONENT STATE_LOGIC_CH1; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:LOGIC CHAN1,"; OUTPUT STATE_LOGIC_CH1 TABLE 'HIGH;','LOW;','DONTCARE;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:LOGIC? CHAN1;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (STATE_LOGIC_CH1)H; CASE "LOW"; FETCH (STATE_LOGIC_CH1)L; CASE "DONT"; FETCH (STATE_LOGIC_CH1)X; CASE ELSE; FETCH STATE_LOGIC_CH1; END SELECT; STORE STATE_LOGIC_CH1; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT STATE_LOGIC_CH2; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:LOGIC CHAN2,"; OUTPUT STATE_LOGIC_CH2 TABLE 'HIGH;','LOW;','DONTCARE;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:LOGIC? CHAN2;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (STATE_LOGIC_CH2)H; CASE "LOW"; FETCH (STATE_LOGIC_CH2)L; CASE "DONT"; FETCH (STATE_LOGIC_CH2)X; CASE ELSE; FETCH STATE_LOGIC_CH2; END SELECT; STORE STATE_LOGIC_CH2; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT STATE_LOGIC_CH3; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; SELECT TRIGGER_MODE; CASE 3; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:STAT:LOGIC CHAN3,"; OUTPUT STATE_LOGIC_CH3 TABLE 'HIGH;','LOW;','DONTCARE;'; CASE ELSE ; END SELECT ; END ACTIONS; GET ACTIONS; SELECT TRIGGER_MODE; CASE 3; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:STAT:LOGIC? CHAN3;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (STATE_LOGIC_CH3)H; CASE "LOW"; FETCH (STATE_LOGIC_CH3)L; CASE "DONT"; FETCH (STATE_LOGIC_CH3)X; CASE ELSE; FETCH STATE_LOGIC_CH3; END SELECT; STORE STATE_LOGIC_CH3; CASE ELSE ; END SELECT ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT STATE_LOGIC_CH4; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; SELECT TRIGGER_MODE; CASE 3; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:STAT:LOGIC CHAN4,"; OUTPUT STATE_LOGIC_CH4 TABLE 'HIGH;','LOW;','DONTCARE;'; CASE ELSE ; END SELECT ; END ACTIONS; GET ACTIONS; SELECT TRIGGER_MODE; CASE 3; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:STAT:LOGIC? CHAN4;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (STATE_LOGIC_CH4)H; CASE "LOW"; FETCH (STATE_LOGIC_CH4)L; CASE "DONT"; FETCH (STATE_LOGIC_CH4)X; CASE ELSE; FETCH STATE_LOGIC_CH4; END SELECT; STORE STATE_LOGIC_CH4; CASE ELSE ; END SELECT ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT STATE_TRIGGER_COND; TYPE DISCRETE; VALUES ISNOT_PRESENT,IS_PRESENT; INITIAL IS_PRESENT; SET ACTIONS; ! Assumes that MODE already set to 'STATE' ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:COND "; OUTPUT STATE_TRIGGER_COND TABLE 'FALSE;','TRUE;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes that MODE already set to 'STATE' ... SELECT TRIGGER_MODE; CASE 3; OUTPUT STRING ":TRIG:STAT:COND?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "TRUE"; FETCH (STATE_TRIGGER_COND)IS_PRESENT; CASE "FALS"; FETCH (STATE_TRIGGER_COND)ISNOT_PRESENT; CASE ELSE; FETCH STATE_TRIGGER_COND; END SELECT; STORE STATE_TRIGGER_COND; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; !>> 'PATTERN' MODE COMPONENT PATTERN_DISPLAY NOGEN NOERRCHECK; TYPE DISCRETE; VALUES LOGIC,LEVELS; INITIAL LOGIC; END COMPONENT; COMPONENT PATTERN_LOGIC_CH1; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:LOGIC CHAN1,"; OUTPUT PATTERN_LOGIC_CH1 TABLE 'HIGH;','LOW;','DONT;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:LOGIC? CHAN1;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (PATTERN_LOGIC_CH1)H; CASE "LOW"; FETCH (PATTERN_LOGIC_CH1)L; CASE "DONT"; FETCH (PATTERN_LOGIC_CH1)X; CASE ELSE; FETCH PATTERN_LOGIC_CH1; END SELECT; STORE PATTERN_LOGIC_CH1; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PATTERN_LOGIC_CH2; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:LOGIC CHAN2,"; OUTPUT PATTERN_LOGIC_CH2 TABLE 'HIGH;','LOW;','DONT;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:LOGIC? CHAN2;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (PATTERN_LOGIC_CH2)H; CASE "LOW"; FETCH (PATTERN_LOGIC_CH2)L; CASE "DONT"; FETCH (PATTERN_LOGIC_CH2)X; CASE ELSE; FETCH PATTERN_LOGIC_CH2; END SELECT; STORE PATTERN_LOGIC_CH2; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PATTERN_LOGIC_CH3; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; SELECT TRIGGER_MODE; CASE 2; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:PATT:LOGIC CHAN3,"; OUTPUT PATTERN_LOGIC_CH3 TABLE 'HIGH;','LOW;','DONTCARE;'; CASE ELSE ; END SELECT ; END ACTIONS; GET ACTIONS; SELECT TRIGGER_MODE; CASE 2; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:PATT:LOGIC? CHAN3;"; ENTER STACK FORMAT "#,K" ; DROP ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (PATTERN_LOGIC_CH3)H; CASE "LOW"; FETCH (PATTERN_LOGIC_CH3)L; CASE "DONT"; FETCH (PATTERN_LOGIC_CH3)X; CASE ELSE; FETCH PATTERN_LOGIC_CH3; END SELECT; STORE PATTERN_LOGIC_CH3; CASE ELSE ; END SELECT ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PATTERN_LOGIC_CH4; TYPE DISCRETE; VALUES H,L,X; INITIAL X; SET ACTIONS; SELECT TRIGGER_MODE; CASE 2; ! Assumes that trigger mode already set ... OUTPUT STRING ":TRIG:PATT:LOGIC CHAN4,"; OUTPUT PATTERN_LOGIC_CH4 TABLE 'HIGH;','LOW;','DONTCARE;'; CASE ELSE ; END SELECT ; END ACTIONS; GET ACTIONS; ! Assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:LOGIC? CHAN4;"; ENTER STACK FORMAT "#,K" ; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "HIGH"; FETCH (PATTERN_LOGIC_CH4)H; CASE "LOW"; FETCH (PATTERN_LOGIC_CH4)L; CASE "DONT"; FETCH (PATTERN_LOGIC_CH4)X; CASE ELSE; FETCH PATTERN_LOGIC_CH4; END SELECT; STORE PATTERN_LOGIC_CH4; CASE ELSE ; END SELECT ; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PATTERN_TRIGGER_COND NOGEN; TYPE DISCRETE; VALUES ENTERED,EXITED,MORETHAN,LESSTHAN,BETWEEN; INITIAL ENTERED; SET ACTIONS; GOSUB SET_PATTERN_TIMING; END ACTIONS; GET ACTIONS; GOSUB GET_PATTERN_TIMING; END ACTIONS; PANEL SET ACTIONS; !GOSUB UPDATE_TRACE_DATA; ! CODEGEN SET PATTERN_TRIGGER_COND; SELECT PATTERN_TRIGGER_COND; CASE ENTERED; CASE EXITED; CASE MORETHAN; CODEGEN SET PATTERN_PRESENT_MORETHAN; CASE LESSTHAN; CODEGEN SET PATTERN_PRESENT_LESSTHAN; CASE BETWEEN; CODEGEN SET PATTERN_PRESENT_START; CODEGEN SET PATTERN_PRESENT_STOP; END SELECT; END ACTIONS; PANEL GET ACTIONS; CODEGEN GET PATTERN_TRIGGER_COND; SELECT PATTERN_TRIGGER_COND; CASE ENTERED; CASE EXITED; CASE MORETHAN; CODEGEN PEEK PATTERN_PRESENT_MORETHAN; CASE LESSTHAN; CODEGEN PEEK PATTERN_PRESENT_LESSTHAN; CASE BETWEEN; CODEGEN PEEK PATTERN_PRESENT_START; CODEGEN PEEK PATTERN_PRESENT_STOP; END SELECT; END ACTIONS; END COMPONENT; COMPONENT PATTERN_PRESENT_MORETHAN NOGEN; TYPE CONTINUOUS; VALUES RANGE 20E-9,160E-3; INITIAL 20E-9; SET ACTIONS; GOSUB SET_PATTERN_TIMING; END ACTIONS; GET ACTIONS; GOSUB GET_PATTERN_TIMING; END ACTIONS; PANEL SET ACTIONS; GOSUB GET_PATTERN_TIMING; !GOSUB UPDATE_TRACE_DATA; CODEGEN SET PATTERN_PRESENT_MORETHAN; END ACTIONS; PANEL GET ACTIONS; CODEGEN GET PATTERN_PRESENT_MORETHAN; END ACTIONS; END COMPONENT; COMPONENT PATTERN_PRESENT_LESSTHAN NOGEN; TYPE CONTINUOUS; VALUES RANGE 20E-9,160E-3; INITIAL 50E-9; SET ACTIONS; GOSUB SET_PATTERN_TIMING; END ACTIONS; GET ACTIONS; GOSUB GET_PATTERN_TIMING; END ACTIONS; PANEL SET ACTIONS; GOSUB GET_PATTERN_TIMING; !GOSUB UPDATE_TRACE_DATA; CODEGEN SET PATTERN_PRESENT_LESSTHAN; END ACTIONS; PANEL GET ACTIONS; CODEGEN GET PATTERN_PRESENT_LESSTHAN; END ACTIONS; END COMPONENT; COMPONENT PATTERN_PRESENT_START NOGEN; TYPE CONTINUOUS; VALUES RANGE 20E-9,159.999E-3; INITIAL 20E-9; SET ACTIONS; GOSUB SET_PATTERN_TIMING; END ACTIONS; GET ACTIONS; GOSUB GET_PATTERN_TIMING; END ACTIONS; PANEL SET ACTIONS; GOSUB GET_PATTERN_TIMING; !GOSUB UPDATE_TRACE_DATA; CODEGEN SET PATTERN_PRESENT_START; END ACTIONS; PANEL GET ACTIONS; CODEGEN GET PATTERN_PRESENT_START; END ACTIONS; END COMPONENT; COMPONENT PATTERN_PRESENT_STOP NOGEN; TYPE CONTINUOUS; VALUES RANGE 30E-9,160E-9; INITIAL 50E-9; SET ACTIONS; GOSUB SET_PATTERN_TIMING; END ACTIONS; GET ACTIONS; GOSUB GET_PATTERN_TIMING; END ACTIONS; PANEL SET ACTIONS; GOSUB GET_PATTERN_TIMING; !GOSUB UPDATE_TRACE_DATA; CODEGEN SET PATTERN_PRESENT_STOP; END ACTIONS; PANEL GET ACTIONS; CODEGEN GET PATTERN_PRESENT_STOP; END ACTIONS; END COMPONENT; ACTIONS SET_PATTERN_TIMING; ! assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:COND "; SELECT PATTERN_TRIGGER_COND; CASE ENTERED; OUTPUT STRING "ENT;"; CASE EXITED; OUTPUT STRING "EXIT;"; CASE MORETHAN; OUTPUT PATTERN_PRESENT_MORETHAN FORMAT '"GT,",K,";"'; CASE LESSTHAN; OUTPUT PATTERN_PRESENT_LESSTHAN FORMAT '"LT,",K,";"'; CASE BETWEEN; OUTPUT PATTERN_PRESENT_START FORMAT '"RANG,",K'; OUTPUT PATTERN_PRESENT_STOP FORMAT '",",K,";"'; END SELECT; CASE ELSE; END SELECT; END ACTIONS; ACTIONS GET_PATTERN_TIMING; ! assumes that trigger mode already set ... SELECT TRIGGER_MODE; CASE 2; OUTPUT STRING ":TRIG:PATT:COND?;" ; ENTER CHARSTRING FORMAT "#,AA"; SELECT CHARSTRING; CASE "EN"; ENTER CHARSTRING FORMAT K; ! finishes entry ... FETCH (PATTERN_TRIGGER_COND)ENTERED; CASE "EX"; ENTER CHARSTRING FORMAT K; ! finishes entry ... FETCH (PATTERN_TRIGGER_COND)EXITED; CASE "GT"; ENTER PATTERN_PRESENT_MORETHAN FORMAT '",",K'; FETCH (PATTERN_TRIGGER_COND)MORETHAN; CASE "LT"; ENTER PATTERN_PRESENT_LESSTHAN FORMAT '",",K'; FETCH (PATTERN_TRIGGER_COND)LESSTHAN; CASE "RA"; ENTER CHARSTRING FORMAT '#,AA'; ! finishes entry ... ENTER PATTERN_PRESENT_START FORMAT '#,",",K'; ENTER PATTERN_PRESENT_STOP FORMAT '",",K'; FETCH (PATTERN_TRIGGER_COND)BETWEEN; CASE ELSE; FETCH 0; END SELECT; STORE PATTERN_TRIGGER_COND; CASE ELSE; END SELECT; END ACTIONS; !<< Delay Event Trigger COMPONENT DEVENT_ARM_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED DEVENT_ARM_SLOPE,DEVENT_ARM_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 4; ! GLITCH Mode OUTPUT STRING ":TRIG:DEV:ARM:SOUR "; OUTPUT DEVENT_ARM_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 4; OUTPUT STRING ":TRIG:DEV:ARM:SOUR?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (DEVENT_ARM_SOURCE)CH1; CASE "TRIG1"; FETCH (DEVENT_ARM_SOURCE)CH1; CASE "CHAN2"; FETCH (DEVENT_ARM_SOURCE)CH2; CASE "TRIG2"; FETCH (DEVENT_ARM_SOURCE)CH2; CASE "CHAN3"; FETCH (DEVENT_ARM_SOURCE)CH3; CASE "TRIG3"; FETCH (DEVENT_ARM_SOURCE)CH3; CASE "CHAN4"; FETCH (DEVENT_ARM_SOURCE)CH4; CASE "TRIG4"; FETCH (DEVENT_ARM_SOURCE)CH4; CASE ELSE; FETCH DEVENT_ARM_SOURCE; END SELECT; STORE DEVENT_ARM_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 4; GOSUB Get_Devent_Arm_Levels ; CASE ELSE ; END SELECT ; SET TRIGGER_LEVEL_UNITS ; !GOSUB UPDATE_TRACE_DATA; END ACTIONS ; END COMPONENT; COMPONENT DEVENT_ARM_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL NEGATIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 4; OUTPUT STRING ":TRIG:DEV:ARM:SLOP "; OUTPUT DEVENT_ARM_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 4; OUTPUT STRING ":TRIG:DEV:ARM:SLOP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (DEVENT_ARM_SLOPE)NEGATIVE; CASE "POS"; FETCH (DEVENT_ARM_SLOPE)POSITIVE; CASE ELSE; FETCH DEVENT_ARM_SLOPE; END SELECT; STORE DEVENT_ARM_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT DEVENT_ARM_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT DEVENT_ARM_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Devent_Arm_Levels ; SELECT DEVENT_ARM_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE DEVENT_ARM_MIN_LVL ; SELECT DEVENT_ARM_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE DEVENT_ARM_MAX_LVL ; END ACTIONS ; COMPONENT DEVENT_ARM_LEVEL NOGEN; TYPE CONTINUOUS; VALUES RANGE DEVENT_ARM_MIN_LVL,DEVENT_ARM_MAX_LVL ; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH DEVENT_ARM_LEVEL; SELECT DEVENT_ARM_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_ARM_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT DEVENT_ARM_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_ARM_LEVEL; END ACTIONS; END COMPONENT; COMPONENT DEVENT_ARM_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT DEVENT_ARM_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_ARM_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; COMPONENT DEVENT_EVENT_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED DEVENT_EVENT_SLOPE,DEVENT_EVENT_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 4; ! GLITCH Mode OUTPUT STRING ":TRIG:DEV:EVEN:SOUR "; OUTPUT DEVENT_EVENT_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 4; OUTPUT STRING ":TRIG:DEV:EVEN:SOUR?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (DEVENT_EVENT_SOURCE)CH1; CASE "TRIG1"; FETCH (DEVENT_EVENT_SOURCE)CH1; CASE "CHAN2"; FETCH (DEVENT_EVENT_SOURCE)CH2; CASE "TRIG2"; FETCH (DEVENT_EVENT_SOURCE)CH2; CASE "CHAN3"; FETCH (DEVENT_EVENT_SOURCE)CH3; CASE "TRIG3"; FETCH (DEVENT_EVENT_SOURCE)CH3; CASE "CHAN4"; FETCH (DEVENT_EVENT_SOURCE)CH4; CASE "TRIG4"; FETCH (DEVENT_EVENT_SOURCE)CH4; CASE ELSE; FETCH DEVENT_EVENT_SOURCE; END SELECT; STORE DEVENT_EVENT_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 4; GOSUB Get_Devent_Event_Levels ; CASE ELSE ; END SELECT ; !GOSUB UPDATE_TRACE_DATA; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; END COMPONENT; COMPONENT DEVENT_EVENT_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL NEGATIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 4; OUTPUT STRING ":TRIG:DEV:EVEN:SLOP "; OUTPUT DEVENT_EVENT_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 4; OUTPUT STRING ":TRIG:DEV:EVEN:SLOP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (DEVENT_EVENT_SLOPE)NEGATIVE; CASE "POS"; FETCH (DEVENT_EVENT_SLOPE)POSITIVE; CASE ELSE; FETCH DEVENT_EVENT_SLOPE; END SELECT; STORE DEVENT_EVENT_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT DEVENT_EVENT_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT DEVENT_EVENT_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Devent_Event_Levels ; SELECT DEVENT_EVENT_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE DEVENT_EVENT_MIN_LVL ; SELECT DEVENT_EVENT_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE DEVENT_EVENT_MAX_LVL ; END ACTIONS ; COMPONENT DEVENT_EVENT_LEVEL NOGEN; TYPE CONTINUOUS; VALUES RANGE DEVENT_EVENT_MIN_LVL,DEVENT_EVENT_MAX_LVL ; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH DEVENT_EVENT_LEVEL; SELECT DEVENT_EVENT_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_EVENT_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT DEVENT_EVENT_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_EVENT_LEVEL; END ACTIONS; END COMPONENT; COMPONENT DEVENT_EVENT_DELAY NOGEN; TYPE CONTINUOUS; VALUES RANGE 1,16000000 ; INITIAL 0; SET ACTIONS; SELECT TRIGGER_MODE ; CASE 4 ; OUTPUT DEVENT_EVENT_DELAY FORMAT '":TRIG:DEV:EVEN:DEL ",K,";"' ; CASE ELSE ; END SELECT ; END ACTIONS ; GET ACTIONS ; SELECT TRIGGER_MODE ; CASE 4 ; OUTPUT ":TRIG:DEV:EVEN:DEL?" ; ENTER DEVENT_EVENT_DELAY FORMAT 'K' ; CASE ELSE ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT DEVENT_EVENT_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT DEVENT_EVENT_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_EVENT_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; COMPONENT DEVENT_TRIGGER_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED DEVENT_TRIGGER_SLOPE,DEVENT_TRIGGER_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 4; ! GLITCH Mode OUTPUT STRING ":TRIG:DEV:TRIG:SOUR "; OUTPUT DEVENT_TRIGGER_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 4; OUTPUT STRING ":TRIG:DEV:TRIG:SOUR?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (DEVENT_TRIGGER_SOURCE)CH1; CASE "TRIG1"; FETCH (DEVENT_TRIGGER_SOURCE)CH1; CASE "CHAN2"; FETCH (DEVENT_TRIGGER_SOURCE)CH2; CASE "TRIG2"; FETCH (DEVENT_TRIGGER_SOURCE)CH2; CASE "CHAN3"; FETCH (DEVENT_TRIGGER_SOURCE)CH3; CASE "TRIG3"; FETCH (DEVENT_TRIGGER_SOURCE)CH3; CASE "CHAN4"; FETCH (DEVENT_TRIGGER_SOURCE)CH4; CASE "TRIG4"; FETCH (DEVENT_TRIGGER_SOURCE)CH4; CASE ELSE; FETCH DEVENT_TRIGGER_SOURCE; END SELECT; STORE DEVENT_TRIGGER_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 4 ; GOSUB Get_Devent_Trigger_Levels ; CASE ELSE ; END SELECT ; !GOSUB UPDATE_TRACE_DATA; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; END COMPONENT; COMPONENT DEVENT_TRIGGER_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL NEGATIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 4; OUTPUT STRING ":TRIG:DEV:TRIG:SLOP "; OUTPUT DEVENT_TRIGGER_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 4; OUTPUT STRING ":TRIG:DEV:TRIG:SLOP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (DEVENT_TRIGGER_SLOPE)NEGATIVE; CASE "POS"; FETCH (DEVENT_TRIGGER_SLOPE)POSITIVE; CASE ELSE; FETCH DEVENT_TRIGGER_SLOPE; END SELECT; STORE DEVENT_TRIGGER_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT DEVENT_TRIG_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT DEVENT_TRIG_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Devent_Trigger_Levels ; SELECT DEVENT_TRIGGER_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE DEVENT_TRIG_MIN_LVL ; SELECT DEVENT_TRIGGER_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE DEVENT_TRIG_MAX_LVL ; END ACTIONS ; COMPONENT DEVENT_TRIGGER_LEVEL NOGEN; TYPE CONTINUOUS; VALUES RANGE DEVENT_TRIG_MIN_LVL, DEVENT_TRIG_MAX_LVL ; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH DEVENT_TRIGGER_LEVEL; SELECT DEVENT_TRIGGER_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_TRIGGER_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT DEVENT_TRIGGER_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_TRIGGER_LEVEL; END ACTIONS; END COMPONENT; COMPONENT DEVENT_TRIGGER_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT DEVENT_TRIGGER_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DEVENT_TRIGGER_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; !<< Delay Time Trigger COMPONENT DTIME_ARM_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED DTIME_ARM_SLOPE,DTIME_ARM_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 5; ! OUTPUT STRING ":TRIG:DTIM:ARM:SOUR "; OUTPUT DTIME_ARM_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 5; OUTPUT STRING ":TRIG:DTIM:ARM:SOUR?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (DTIME_ARM_SOURCE)CH1; CASE "TRIG1"; FETCH (DTIME_ARM_SOURCE)CH1; CASE "CHAN2"; FETCH (DTIME_ARM_SOURCE)CH2; CASE "TRIG2" ; FETCH (DTIME_ARM_SOURCE)CH2; CASE "CHAN3"; FETCH (DTIME_ARM_SOURCE)CH3; CASE "TRIG3"; FETCH (DTIME_ARM_SOURCE)CH3; CASE "CHAN4"; FETCH (DTIME_ARM_SOURCE)CH4; CASE "TRIG4"; FETCH (DTIME_ARM_SOURCE)CH4; CASE ELSE; FETCH DTIME_ARM_SOURCE; END SELECT; STORE DTIME_ARM_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 5 ; GOSUB Get_Dtime_Arm_Levels ; CASE ELSE ; END SELECT ; !GOSUB UPDATE_TRACE_DATA; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; END COMPONENT; COMPONENT DTIME_ARM_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL NEGATIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 5; OUTPUT STRING ":TRIG:DTIM:ARM:SLOP "; OUTPUT DTIME_ARM_SLOPE TABLE 'NEG;','POS;'; GOSUB Get_Dtime_Arm_Levels ; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 5; OUTPUT STRING ":TRIG:DTIM:ARM:SLOP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (DTIME_ARM_SLOPE)NEGATIVE; CASE "POS"; FETCH (DTIME_ARM_SLOPE)POSITIVE; CASE ELSE; FETCH DTIME_ARM_SLOPE; END SELECT; STORE DTIME_ARM_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT DTIME_ARM_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT DTIME_ARM_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Dtime_Arm_Levels ; SELECT DTIME_ARM_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE DTIME_ARM_MIN_LVL ; SELECT DTIME_ARM_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE DTIME_ARM_MAX_LVL ; END ACTIONS ; COMPONENT DTIME_ARM_LEVEL NOGEN; TYPE CONTINUOUS; VALUES RANGE DTIME_ARM_MIN_LVL,DTIME_ARM_MAX_LVL ; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH DTIME_ARM_LEVEL; SELECT DTIME_ARM_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DTIME_ARM_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT DTIME_ARM_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DTIME_ARM_LEVEL; END ACTIONS; END COMPONENT; COMPONENT DTIME_ARM_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT DTIME_ARM_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DTIME_ARM_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; COMPONENT DTIME_TRIGGER_SOURCE; TYPE DISCRETE; VALUES CH1,CH2,CH3,CH4; INITIAL CH1; COUPLED DTIME_TRIGGER_SLOPE,DTIME_TRIGGER_UPDATE,TRIGGER_INCR; SET ACTIONS; ! Assumes proper trigger mode already set ...pattern mode not valid SELECT TRIGGER_MODE; CASE 5; ! OUTPUT STRING ":TRIG:DTIM:TRIG:SOUR "; OUTPUT DTIME_TRIGGER_SOURCE TABLE 'CHAN1;','CHAN2;','CHAN3;','CHAN4;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode already set ... !SELECT TRIGGER_MODE; !CASE 5; OUTPUT STRING ":TRIG:DTIM:TRIG:SOUR?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "CHAN1"; FETCH (DTIME_TRIGGER_SOURCE)CH1; CASE "TRIG1"; FETCH (DTIME_TRIGGER_SOURCE)CH1; CASE "CHAN2"; FETCH (DTIME_TRIGGER_SOURCE)CH2; CASE "TRIG2"; FETCH (DTIME_TRIGGER_SOURCE)CH2; CASE "CHAN3"; FETCH (DTIME_TRIGGER_SOURCE)CH3; CASE "TRIG3"; FETCH (DTIME_TRIGGER_SOURCE)CH3; CASE "CHAN4"; FETCH (DTIME_TRIGGER_SOURCE)CH4; CASE "TRIG4"; FETCH (DTIME_TRIGGER_SOURCE)CH4; CASE ELSE; FETCH DTIME_TRIGGER_SOURCE; END SELECT; STORE DTIME_TRIGGER_SOURCE; !CASE ELSE; !END SELECT; END ACTIONS; PANEL SET ACTIONS ; SELECT TRIGGER_MODE ; CASE 5 ; GOSUB Get_Dtime_Trigger_Levels ; CASE ELSE ; END SELECT ; SET TRIGGER_LEVEL_UNITS ; !GOSUB UPDATE_TRACE_DATA; END ACTIONS ; END COMPONENT; COMPONENT DTIME_TRIGGER_SLOPE; TYPE DISCRETE; VALUES NEGATIVE,POSITIVE; INITIAL NEGATIVE; SET ACTIONS; ! Assumes that trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 5; OUTPUT STRING ":TRIG:DTIM:TRIG:SLOP "; OUTPUT DTIME_TRIGGER_SLOPE TABLE 'NEG;','POS;'; CASE ELSE; END SELECT; END ACTIONS; GET ACTIONS; ! Assumes proper trigger mode and source already set ... SELECT TRIGGER_MODE; CASE 5; OUTPUT STRING ":TRIG:DTIM:TRIG:SLOP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NEG"; FETCH (DTIME_TRIGGER_SLOPE)NEGATIVE; CASE "POS"; FETCH (DTIME_TRIGGER_SLOPE)POSITIVE; CASE ELSE; FETCH DTIME_TRIGGER_SLOPE; END SELECT; STORE DTIME_TRIGGER_SLOPE; CASE ELSE; END SELECT; END ACTIONS; !PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT DTIME_TRIG_MIN_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT DTIME_TRIG_MAX_LVL ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; ACTIONS Get_Dtime_Trigger_Levels ; SELECT DTIME_TRIGGER_SOURCE ; CASE CH1 ; FETCH MIN_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MIN_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MIN_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MIN_TRIG_LVL_CH4 ; END SELECT ; STORE DTIME_TRIG_MIN_LVL ; SELECT DTIME_TRIGGER_SOURCE ; CASE CH1 ; FETCH MAX_TRIG_LVL_CH1 ; CASE CH2 ; FETCH MAX_TRIG_LVL_CH2 ; CASE CH3 ; FETCH MAX_TRIG_LVL_CH3 ; CASE CH4 ; FETCH MAX_TRIG_LVL_CH4 ; END SELECT ; STORE DTIME_TRIG_MAX_LVL ; END ACTIONS ; COMPONENT DTIME_TRIGGER_LEVEL NOGEN; TYPE CONTINUOUS; VALUES RANGE DTIME_TRIG_MIN_LVL,DTIME_TRIG_MAX_LVL ; INITIAL 0; SET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... FETCH DTIME_TRIGGER_LEVEL; SELECT DTIME_TRIGGER_SOURCE; CASE CH1; STORE TRIGGER_LEVEL_CH1; SET TRIGGER_LEVEL_CH1; CODEGEN SET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; STORE TRIGGER_LEVEL_CH2; SET TRIGGER_LEVEL_CH2; CODEGEN SET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; STORE TRIGGER_LEVEL_CH3; SET TRIGGER_LEVEL_CH3; CODEGEN SET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; STORE TRIGGER_LEVEL_CH4; SET TRIGGER_LEVEL_CH4; CODEGEN SET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DTIME_TRIGGER_LEVEL; ! Note that SET on TL? did a verify ... END ACTIONS; GET ACTIONS; ! Note that CODEGEN must exist here rather than in HIT ACTIONS ! because of the need to handle both SETs and GETs ... SELECT DTIME_TRIGGER_SOURCE; CASE CH1; CODEGEN GET TRIGGER_LEVEL_CH1; GET TRIGGER_LEVEL_CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; CODEGEN GET TRIGGER_LEVEL_CH2; GET TRIGGER_LEVEL_CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; CODEGEN GET TRIGGER_LEVEL_CH3; GET TRIGGER_LEVEL_CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; CODEGEN GET TRIGGER_LEVEL_CH4; GET TRIGGER_LEVEL_CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DTIME_TRIGGER_LEVEL; END ACTIONS; END COMPONENT; COMPONENT DTIME_TRIGGER_DELAY NOGEN; TYPE CONTINUOUS; VALUES RANGE 30E-9,160E-3 ; INITIAL 30E-9; SET ACTIONS; SELECT TRIGGER_MODE ; CASE 5 ; OUTPUT DTIME_TRIGGER_DELAY FORMAT '":TRIG:DTIM:DEL ",K,";"' ; CASE ELSE ; END SELECT ; END ACTIONS ; GET ACTIONS ; SELECT TRIGGER_MODE ; CASE 5 ; OUTPUT ":TRIG:DTIM:DEL?" ; ENTER DTIME_TRIGGER_DELAY FORMAT 'K' ; CASE ELSE ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT DTIME_TRIGGER_UPDATE NOTSAVED NOGEN; TYPE INTEGER; INITIAL DONTCARE; ! This exists as a component rather than an ACTIONS sub due ! to the need to control the order of execution of COUPLINGs from ! numerous other components -- as a component this can be included ! in a COUPLED list whereas an ACTIONS sub could only be called ! from the PANEL SET ACTIONS of the effecting component and thus ! cannot be done after certain other couplings ... GET ACTIONS; SELECT DTIME_TRIGGER_SOURCE; CASE CH1; FETCH TRIGGER_LEVEL_CH1; CASE CH2; FETCH TRIGGER_LEVEL_CH2; CASE CH3; FETCH TRIGGER_LEVEL_CH3; CASE CH4; FETCH TRIGGER_LEVEL_CH4; END SELECT; STORE DTIME_TRIGGER_LEVEL; ! the STORE causes view update ... END ACTIONS; END COMPONENT; COMPONENT TRIGGER_INCR NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 80E-3; GET ACTIONS; ! Reaction to 'coupled' links from trigger_source SELECT TRIGGER_MODE; CASE EDGE; FETCH EDGE_TRIGGER_SOURCE; GOSUB Get_Trigger_Incr ; CASE GLITCH ; FETCH GLITCH_TRIGGER_SOURCE ; GOSUB Get_Trigger_Incr ; CASE STATE ; FETCH STATE_TRIGGER_SOURCE ; GOSUB Get_Trigger_Incr ; CASE DEVENTS ; FETCH DEVENT_ARM_SOURCE ; GOSUB Get_Trigger_Incr ; FETCH DEVENT_EVENT_SOURCE ; GOSUB Get_Trigger_Incr ; FETCH DEVENT_TRIGGER_SOURCE ; GOSUB Get_Trigger_Incr ; CASE DTIME; FETCH DTIME_ARM_SOURCE ; GOSUB Get_Trigger_Incr ; FETCH DTIME_TRIGGER_SOURCE ; GOSUB Get_Trigger_Incr ; CASE ELSE ; END SELECT ; END ACTIONS ; END COMPONENT ; ACTIONS Get_Trigger_Incr ; SELECT STACK ; CASE 0; FETCH SENS_INCR_CH1; CASE 1; FETCH SENS_INCR_CH2; CASE 2; FETCH SENS_INCR_CH3; CASE 3; FETCH SENS_INCR_CH4; CASE ELSE ; FETCH TRIGGER_INCR ; END SELECT; STORE TRIGGER_INCR; END ACTIONS ; ACTIONS Fix_Trigger_Inputs ; ! Fix the wandering trigger sources IF PANELMODE THEN ; IF First_Plug_In THEN ; ELSE ; ! if nothing has been plugged in DISABLE TRIGGER_MODE,GLITCH,PATTERN,STATE,DEVENTS,DTIME ; DONTCARE Edge_Trigger_Source ; END IF ; IF SLOT_11A THEN ; FETCH SLOT_12A ; FETCH SLOT_13A ; ADD ; FETCH SLOT_21A ; ADD ; FETCH 0 ; EQ ; !only 11A prset IF STACK THEN ; DISABLE TRIGGER_MODE,GLITCH,PATTERN,STATE,DEVENTS,DTIME ; END IF ; ELSE ; END IF ; IF SLOT_22A THEN ; DISABLE TRIGGER_MODE,STATE,DEVENTS,DTIME ; END IF ; GET Edge_Trigger_Source ; GET Glitch_Trigger_Source ; GET State_Trigger_Source ; ! Clock GET DEVENT_ARM_SOURCE ; GET DEVENT_TRIGGER_SOURCE ; GET DEVENT_EVENT_SOURCE ; GET DTIME_ARM_SOURCE ; GET DTIME_TRIGGER_SOURCE ; SELECT SLOT_11A ; CASE 1 ; GOSUB Disable_Trigger1 ; CASE 2 ; GOSUB Disable_Trigger2 ; CASE 3 ; GOSUB Disable_Trigger3 ; CASE 4 ; GOSUB Disable_Trigger4 ; CASE ELSE ; END SELECT ; IF Plug_in1 THEN ; ELSE ; GOSUB Disable_Trigger1 ; DISABLE Edge_Trigger_Source,CH1 ; END IF ; IF Plug_in2 THEN ; ELSE ; FETCH SLOT_21A ; FETCH 1 ; EQ ; IF STACK THEN ; ELSE ; GOSUB Disable_Trigger2 ; DISABLE Edge_Trigger_Source,CH2 ; END IF ; END IF ; IF Plug_in3 THEN ; ELSE ; FETCH SLOT_21A ; FETCH 2 ; EQ ; IF STACK THEN ; ELSE ; GOSUB Disable_Trigger3 ; DISABLE Edge_Trigger_Source,CH3 ; END IF ; END IF ; IF Plug_in4 THEN ; ELSE ; FETCH SLOT_21A ; FETCH 3 ; EQ ; IF STACK THEN ; ELSE ; FETCH SLOT_22A ; FETCH 1 ; EQ ; IF STACK THEN ; ELSE ; GOSUB Disable_Trigger4 ; DISABLE Edge_Trigger_Source,CH4 ; END IF ; END IF ; END IF ; END IF ; END ACTIONS ; ACTIONS Disable_Trigger1 ; DISABLE STATE_TRIGGER_SOURCE,CH1 ; ! Clock Input DONTCARE STATE_LOGIC_CH1 ; DONTCARE PATTERN_LOGIC_CH1 ; DISABLE GLITCH_TRIGGER_SOURCE,CH1 ; DISABLE DEVENT_ARM_SOURCE,CH1 ; DISABLE DEVENT_TRIGGER_SOURCE,CH1 ; DISABLE DEVENT_EVENT_SOURCE,CH1 ; DISABLE DTIME_ARM_SOURCE,CH1 ; DISABLE DTIME_TRIGGER_SOURCE,CH1 ; END ACTIONS ; ACTIONS Disable_Trigger2 ; DISABLE STATE_TRIGGER_SOURCE,CH2 ; DONTCARE STATE_LOGIC_CH2 ; DONTCARE PATTERN_LOGIC_CH2 ; DISABLE GLITCH_TRIGGER_SOURCE,CH2 ; DISABLE DEVENT_ARM_SOURCE,CH2 ; DISABLE DEVENT_TRIGGER_SOURCE,CH2 ; DISABLE DEVENT_EVENT_SOURCE,CH2 ; DISABLE DTIME_ARM_SOURCE,CH2 ; DISABLE DTIME_TRIGGER_SOURCE,CH1 ; END ACTIONS ; ACTIONS Disable_Trigger3 ; DISABLE STATE_TRIGGER_SOURCE,CH3 ; DONTCARE STATE_LOGIC_CH3 ; DONTCARE PATTERN_LOGIC_CH3 ; DISABLE GLITCH_TRIGGER_SOURCE,CH3 ; DISABLE DEVENT_ARM_SOURCE,CH3 ; DISABLE DEVENT_TRIGGER_SOURCE,CH3 ; DISABLE DEVENT_EVENT_SOURCE,CH3 ; DISABLE DTIME_ARM_SOURCE,CH3 ; DISABLE DTIME_TRIGGER_SOURCE,CH3 ; END ACTIONS ; ACTIONS Disable_Trigger4 ; DISABLE STATE_TRIGGER_SOURCE,CH4 ; DONTCARE STATE_LOGIC_CH4 ; DONTCARE PATTERN_LOGIC_CH4 ; DISABLE GLITCH_TRIGGER_SOURCE,CH4 ; DISABLE DEVENT_ARM_SOURCE,CH4 ; DISABLE DEVENT_TRIGGER_SOURCE,CH4 ; DISABLE DEVENT_EVENT_SOURCE,CH4 ; DISABLE DTIME_ARM_SOURCE,CH4 ; DISABLE DTIME_TRIGGER_SOURCE,CH4 ; END ACTIONS ; !============================== ! TRIGGER N SUBSYSTEM !============================== COMPONENT TRIG_11A_PROBE NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS; OUTPUT SLOT_11A FORMAT '":TRIG",K,":PROB "' ; OUTPUT TRIG_11A_PROBE FORMAT K ; OUTPUT TRIG_11A_PROBE_UNITS TABLE ',RAT',',DEC' ; IF RECALLING THEN ; ELSE ; SELECT SLOT_11A ; CASE 1 ; GET TRIGGER_LEVEL_CH1 ; CASE 2 ; GET TRIGGER_LEVEL_CH2 ; CASE 3 ; GET TRIGGER_LEVEL_CH3 ; CASE 4 ; GET TRIGGER_LEVEL_CH4 ; END SELECT ; END IF ; END ACTIONS; GET ACTIONS; OUTPUT SLOT_11A FORMAT '":TRIG",K,":PROB?"'; ENTER TRIG_11A_PROBE FORMAT "#,K"; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "RAT" ; FETCH 0 ; CASE "DEC" ; FETCH 1 ; END SELECT ; STORE TRIG_11A_PROBE_UNITS ; END ACTIONS; PANEL SET ACTIONS ; GOSUB Get_Trigger_Range_11A ; SELECT TRIGGER_MODE ; CASE EDGE; GOSUB Get_Edge_Trigger_Levels ; CASE GLITCH ; GOSUB Get_Glitch_Trigger_Levels ; CASE PATTERN; CASE STATE; GOSUB Get_State_Trigger_Levels ; CASE DEVENTS ; GOSUB Get_Devent_Trigger_Levels ; GOSUB Get_Devent_Arm_Levels ; GOSUB Get_Devent_Event_Levels ; CASE DTIME ; GOSUB Get_Dtime_Trigger_Levels ; GOSUB Get_Dtime_Arm_Levels ; END SELECT ; !GOSUB UPDATE_TRACE_DATA ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_11A_PROBE_UNITS ; TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET TRIG_11A_PROBE ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_11A_BWL ; TYPE DISCRETE ; VALUES OFF,ON ; INITIAL OFF ; SET ACTIONS ; OUTPUT SLOT_11A FORMAT '":TRIG",K,":BWL "' ; OUTPUT TRIG_11A_BWL TABLE "OFF","ON"; END ACTIONS ; GET ACTIONS ; OUTPUT SLOT_11A FORMAT '":TRIG",K,":BWL?"' ; ENTER TRIG_11A_BWL FORMAT K ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_21A_PROBE NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS; OUTPUT SLOT_21A FORMAT '":TRIG",K,":PROB "' ; OUTPUT TRIG_21A_PROBE FORMAT K ; OUTPUT TRIG_21A_PROBE_UNITS TABLE ',RAT',',DEC' ; IF RECALLING THEN ; ELSE ; SELECT SLOT_21A ; CASE 1 ; GET TRIGGER_LEVEL_CH1 ; CASE 2 ; GET TRIGGER_LEVEL_CH2 ; CASE 3 ; GET TRIGGER_LEVEL_CH3 ; CASE 4 ; GET TRIGGER_LEVEL_CH4 ; END SELECT ; END IF ; END ACTIONS; GET ACTIONS; OUTPUT SLOT_21A FORMAT '":TRIG",K,":PROB?"'; ENTER TRIG_21A_PROBE FORMAT "#,K"; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "RAT" ; FETCH 0 ; CASE "DEC" ; FETCH 1 ; END SELECT ; STORE TRIG_21A_PROBE_UNITS ; END ACTIONS; PANEL SET ACTIONS ; GOSUB Get_Trigger_Range_21A ; SELECT TRIGGER_MODE ; CASE EDGE; GOSUB Get_Edge_Trigger_Levels ; CASE GLITCH ; GOSUB Get_Glitch_Trigger_Levels ; CASE PATTERN; CASE STATE; GOSUB Get_State_Trigger_Levels ; CASE DEVENTS ; GOSUB Get_Devent_Trigger_Levels ; GOSUB Get_Devent_Arm_Levels ; GOSUB Get_Devent_Event_Levels ; CASE DTIME ; GOSUB Get_Dtime_Trigger_Levels ; GOSUB Get_Dtime_Arm_Levels ; END SELECT ; !GOSUB UPDATE_TRACE_DATA ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_21A_PROBE_UNITS ; TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET TRIG_21A_PROBE ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_22A_PROBE_1 NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS; OUTPUT STRING ":TRIG1:PROB " ; OUTPUT TRIG_22A_PROBE_1 FORMAT K ; OUTPUT TRIG_22A_PROBE_UNITS TABLE ',RAT',',DEC' ; IF RECALLING THEN ; ELSE ; GET TRIGGER_LEVEL_CH1 ; END IF ; END ACTIONS; GET ACTIONS; OUTPUT STRING ":TRIG1:PROB?"; ENTER TRIG_22A_PROBE_1 FORMAT "#,K"; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "RAT" ; FETCH 0 ; CASE "DEC" ; FETCH 1 ; END SELECT ; STORE TRIG_22A_PROBE_UNITS ; END ACTIONS; PANEL SET ACTIONS ; GOSUB Get_Trigger_Range_22A ; SELECT TRIGGER_MODE ; CASE EDGE; GOSUB Get_Edge_Trigger_Levels ; CASE GLITCH ; GOSUB Get_Glitch_Trigger_Levels ; CASE PATTERN; CASE STATE; GOSUB Get_State_Trigger_Levels ; CASE DEVENTS ; GOSUB Get_Devent_Trigger_Levels ; GOSUB Get_Devent_Arm_Levels ; GOSUB Get_Devent_Event_Levels ; CASE DTIME ; GOSUB Get_Dtime_Trigger_Levels ; GOSUB Get_Dtime_Arm_Levels ; END SELECT ; !GOSUB UPDATE_TRACE_DATA ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_22A_PROBE_2 NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS; OUTPUT STRING ":TRIG4:PROB " ; OUTPUT TRIG_22A_PROBE_2 FORMAT K ; OUTPUT TRIG_22A_PROBE_UNITS TABLE ',RAT',',DEC' ; IF RECALLING THEN ; ELSE ; GET TRIGGER_LEVEL_CH4 ; END IF ; END ACTIONS; GET ACTIONS; OUTPUT STRING ":TRIG4:PROB?"; ENTER TRIG_22A_PROBE_2 FORMAT "#,K"; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "RAT" ; FETCH 0 ; CASE "DEC" ; FETCH 1 ; END SELECT ; STORE TRIG_22A_PROBE_UNITS ; END ACTIONS; PANEL SET ACTIONS ; GOSUB Get_Trigger_Range_22A ; SELECT TRIGGER_MODE ; CASE EDGE; GOSUB Get_Edge_Trigger_Levels ; CASE GLITCH ; GOSUB Get_Glitch_Trigger_Levels ; CASE PATTERN; CASE STATE; GOSUB Get_State_Trigger_Levels ; CASE DEVENTS ; GOSUB Get_Devent_Trigger_Levels ; GOSUB Get_Devent_Arm_Levels ; GOSUB Get_Devent_Event_Levels ; CASE DTIME ; GOSUB Get_Dtime_Trigger_Levels ; GOSUB Get_Dtime_Arm_Levels ; END SELECT ; !GOSUB UPDATE_TRACE_DATA ; END ACTIONS ; END COMPONENT ; COMPONENT TRIG_22A_PROBE_UNITS ; TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET TRIG_22A_PROBE_1 ; SET TRIG_22A_PROBE_2 ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TO_TRIG_21A NOTSAVED NOGEN NOERRCHECK ; TYPE INTEGER ; PANEL SET ACTIONS ; IF SLOT_21A THEN ; HIDE TRIGGER_N_SUBSYSTEM,TRIGGER_N_11A ; SHOW TRIGGER_N_SUBSYSTEM,TRIGGER_N_21A ; HIDE TRIGGER_N_SUBSYSTEM,TRIGGER_N_22A ; ELSE ; NOTIFY "HP54721 - Not Plugged In" ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TO_TRIG_11A NOTSAVED NOGEN NOERRCHECK ; TYPE INTEGER ; PANEL SET ACTIONS ; IF SLOT_11A THEN ; HIDE TRIGGER_N_SUBSYSTEM,TRIGGER_N_21A ; SHOW TRIGGER_N_SUBSYSTEM,TRIGGER_N_11A ; HIDE TRIGGER_N_SUBSYSTEM,TRIGGER_N_22A ; ELSE ; NOTIFY "HP54711 - Not Plugged In" ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT TO_TRIG_22A NOTSAVED NOGEN NOERRCHECK ; TYPE INTEGER ; PANEL SET ACTIONS ; IF SLOT_22A THEN ; HIDE TRIGGER_N_SUBSYSTEM,TRIGGER_N_11A ; HIDE TRIGGER_N_SUBSYSTEM,TRIGGER_N_21A ; SHOW TRIGGER_N_SUBSYSTEM,TRIGGER_N_22A ; ELSE ; NOTIFY "HP54722 - Not Plugged In" ; END IF ; END ACTIONS ; END COMPONENT ; !============================== ! CHANNEL SUBSYSTEM !============================== COMPONENT CHANNEL NOGEN NOERRCHECK; TYPE DISCRETE; VALUES dummy,CH1,CH2,CH3,CH4; INITIAL CH1; panel set actions; HIDE CH1; HIDE CH1_SCR1 ; HIDE CH1_SCR2 ; HIDE STORE_WF_CH1 ; HIDE CH2; HIDE CH2_SCR1 ; HIDE CH2_SCR2 ; HIDE STORE_WF_CH2 ; HIDE CH3; HIDE CH3_SCR1 ; HIDE CH3_SCR2 ; HIDE STORE_WF_CH3 ; HIDE CH4; HIDE CH4_SCR1 ; HIDE CH4_SCR2 ; HIDE STORE_WF_CH4 ; SELECT CHANNEL; CASE dummy ; NOTIFY "Sorry, Nothing Plugged In!!" ; CASE CH1; SHOW CH1; SHOW CH1_SCR1 ; SHOW STORE_WF_CH1 ; CASE CH2; SHOW CH2; SHOW CH2_SCR1 ; SHOW STORE_WF_CH2 ; CASE CH3; SHOW CH3; SHOW CH3_SCR1 ; SHOW STORE_WF_CH3 ; CASE CH4; SHOW CH4; SHOW CH4_SCR1 ; SHOW STORE_WF_CH4 ; END SELECT; output string ":MENU CHAN"; OUTPUT Channel FORMAT K ; end actions; END COMPONENT; !>> CHANNEL #1 ... COMPONENT PROBE_CH1 NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED PROBE_CH1,MIN_SENS_CH1,MAX_SENS_CH1,SENS_CH1, OFFSET_CH1,VMIN_CH1,VMAX_CH1,SENS_INCR_CH1, TRIGGER_LEVEL_CH1,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in1 THEN; OUTPUT PROBE_CH1 FORMAT '":CHAN1:PROB ",K'; OUTPUT PROBE_UNITS_CH1 TABLE ',RAT',',DEC' ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE PROBE_CH1; DONTCARE PROBE_UNITS_CH1 ; END IF ; END IF ; END IF ; END ACTIONS; GET ACTIONS; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:PROB?"; ENTER PROBE_CH1 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE PROBE_CH1; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PROBE_UNITS_CH1 ; ! the instrument might always store it as RAT - check it out TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET PROBE_CH1 ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MIN_SENS_CH1 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 1E-3; GET ACTIONS; SELECT Plug_in1; CASE (Plug_in1)HP54711A; FETCH 21E-3; CASE (Plug_in1)HP54712A; FETCH 1E-3; CASE (Plug_in1)HP54713A; FETCH 1E-3; CASE (Plug_in1)HP54721A; FETCH 1E-3; CASE (Plug_in1)HP54722A; FETCH 1E-3; !!!!! ????? CASE ELSE; FETCH 1E-3; END SELECT; FETCH PROBE_CH1; MUL; FETCH UNITS_ATT_CH1 ; DIV ; STORE MIN_SENS_CH1; END ACTIONS; END COMPONENT; COMPONENT MAX_SENS_CH1 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 5; GET ACTIONS; SELECT Plug_in1; CASE (Plug_in1)HP54711A; FETCH 1; CASE (Plug_in1)HP54712A; FETCH 1; CASE (Plug_in1)HP54713A; FETCH 5; CASE (Plug_in1)HP54721A; FETCH 1; CASE (Plug_in1)HP54722A; FETCH 5; !!!!! ????? CASE ELSE; FETCH 5; END SELECT; FETCH PROBE_CH1; MUL; FETCH UNITS_ATT_CH1 ; DIV ; ! check it out STORE MAX_SENS_CH1; END ACTIONS; END COMPONENT; COMPONENT SENS_CH1; TYPE CONTINUOUS; VALUES RANGE MIN_SENS_CH1,MAX_SENS_CH1; ! check it out - what effect UNITS has on scale ranges?? INITIAL 1; ! It also depends on UNITS ATT - inversely proportional COUPLED OFFSET_CH1,VMIN_CH1,VMAX_CH1,SENS_INCR_CH1, TRIGGER_LEVEL_CH1,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in1 THEN; OUTPUT SENS_CH1 FORMAT '":CHAN1:SCAL ",K'; IF RECALLING THEN ; ELSE ; GET SENS_CH1 ; END IF ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE SENS_CH1; END IF; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:SCAL?"; ENTER SENS_CH1 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE SENS_CH1; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS; FETCH Plug_in1 ; GOSUB Get_Offset_Ranges ; FETCH Plug_In1 ; GOSUB Get_Trigger_Ranges ; GOSUB UPDATE_TRACE_DATA; END ACTIONS; END COMPONENT; COMPONENT OFFSET_CH1_MIN ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH1_MAX ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH1; TYPE CONTINUOUS; VALUES RANGE OFFSET_CH1_Min,OFFSET_CH1_MAX ; INITIAL 0; COUPLED OFFSET_CH1,VMIN_CH1,VMAX_CH1,SENS_INCR_CH1, TRIGGER_LEVEL_CH1,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in1 THEN; OUTPUT OFFSET_CH1 FORMAT '":CHAN1:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE OFFSET_CH1; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:OFFS?"; ENTER OFFSET_CH1 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE OFFSET_CH1; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT VMIN_CH1 NOERRCHECK; TYPE CONTINUOUS; INITIAL -4; GET ACTIONS; ! offset-range/2 ... FETCH OFFSET_CH1; FETCH SENS_CH1; FETCH 4 ; MUL; SUB; STORE VMIN_CH1; END ACTIONS; END COMPONENT; COMPONENT VMAX_CH1 NOERRCHECK; TYPE CONTINUOUS; INITIAL 4; GET ACTIONS; ! offset+range/2 ... FETCH OFFSET_CH1; FETCH SENS_CH1; FETCH 4; MUL; ADD; STORE VMAX_CH1; END ACTIONS; END COMPONENT; COMPONENT SENS_INCR_CH1 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 10E-3; ! 1% of range ... GET ACTIONS; FETCH VMAX_CH1; FETCH VMIN_CH1; SUB; FETCH 80; DIV; STORE SENS_INCR_CH1; END ACTIONS; END COMPONENT; COMPONENT UNITS_CH1_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_CH1 ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; SET ACTIONS ; IF Plug_in1 THEN ; OUTPUT STRING ":CHAN1:UNIT " ; OUTPUT UNITS_CH1 TABLE 'VOLT','AMP','WATT','UNKN' ; ELSE ; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH1 ; END IF ; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS ; FETCH UNITS_CH1 ; STORE UNITS_CH1_DISP ; SET MARKER_DISP_UNITS_1 ; SET MARKER_DISP_UNITS_2 ; SET UNITS_FN1_DISP ; SET UNITS_FN2_DISP ; SET MEAS_DISP_UNITS ; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; GET ACTIONS ; IF Plug_in1 THEN ; OUTPUT STRING ":CHAN1:UNIT?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "VOLT" ; FETCH (UNITS_CH1) VOLT ; CASE "AMP" ; FETCH (UNITS_CH1) AMP ; CASE "WATT" ; FETCH (UNITS_CH1) WATT ; CASE "UNKN" ; FETCH (UNITS_CH1) UNKN ; END SELECT ; DUP ; STORE UNITS_CH1 ; STORE UNITS_CH1_DISP ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH1 ; END IF ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT UNITS_ATT_CH1 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? ; ! looks like it is limitless - check it out INITIAL 1 ; COUPLED UNITS_ATT_CH1,SENS_CH1,OFFSET_CH1,TRIGGER_LEVEL_CH1,MIN_SENS_CH1,MAX_SENS_CH1, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in1 THEN; OUTPUT UNITS_ATT_CH1 FORMAT '":CHAN1:UNIT:ATT ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH1; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:UNIT:ATT?"; ENTER UNITS_ATT_CH1 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH1; END IF ; END IF; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT UNITS_OFF_CH1 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? ! check it out - some relationship between channel offset INITIAL 0 ; COUPLED UNITS_OFF_CH1,SENS_CH1,OFFSET_CH1,TRIGGER_LEVEL_CH1, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in1 THEN; OUTPUT UNITS_OFF_CH1 FORMAT '":CHAN1:UNIT:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH1; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:UNIT:OFFS?"; ENTER UNITS_OFF_CH1 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH1; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT BWLIMIT_CH1; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in1; FETCH (Plug_in1)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN1:BWL "; OUTPUT BWLIMIT_CH1 TABLE 'OFF;','ON;'; ELSE; DONTCARE BWLIMIT_CH1; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in1; FETCH (Plug_in1)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN1:BWL?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (BWLIMIT_CH1)OFF; CASE 1; FETCH (BWLIMIT_CH1)ON; CASE ELSE; FETCH BWLIMIT_CH1; END SELECT; STORE BWLIMIT_CH1; ELSE; DONTCARE BWLIMIT_CH1; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT CALOUT_CH1 ; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in1; FETCH (Plug_in1)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN1:OUTP "; OUTPUT CALOUT_CH1 TABLE 'OFF;','ON;'; ELSE; DONTCARE CALOUT_CH1; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in1; FETCH (Plug_in1)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN1:OUTP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (CALOUT_CH1)OFF; CASE 1; FETCH (CALOUT_CH1)ON; CASE ELSE; FETCH CALOUT_CH1; END SELECT; STORE CALOUT_CH1; ELSE; DONTCARE CALOUT_CH1; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT SENS_711A_CH1 ; TYPE DISCRETE; VALUES MAX,DEF; INITIAL DEF; SET ACTIONS; FETCH Plug_in1; FETCH (Plug_in1)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN1:SENS "; OUTPUT SENS_711A_CH1 TABLE 'MAX;','DEF;'; ELSE; DONTCARE SENS_711A_CH1; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in1; FETCH (Plug_in1)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN1:SENS?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "MAX"; FETCH (SENS_711A_CH1)MAX; CASE "DEF"; FETCH (SENS_711A_CH1)DEF; CASE ELSE; FETCH SENS_711A_CH1; END SELECT; STORE SENS_711A_CH1; ELSE; DONTCARE SENS_711A_CH1; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT COUPLING_CH1; TYPE DISCRETE; VALUES DC,DC50,LF1_50,LF1,LF2 ; INITIAL DC50; SET ACTIONS; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:INP "; OUTPUT COUPLING_CH1 TABLE 'DC;','DC50;','LF1_50;','LF1;','LF2;'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE COUPLING_CH1; ! this only serves the purpose of space in store-state ? END IF ; END IF ; ! check it out END IF; END ACTIONS; GET ACTIONS; IF Plug_in1 THEN; OUTPUT STRING ":CHAN1:INP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "DC"; FETCH (COUPLING_CH1)DC; CASE "DC50"; FETCH (COUPLING_CH1)DC50; CASE "LF1"; FETCH (COUPLING_CH1)LF1; CASE "LF2"; FETCH (COUPLING_CH1)LF2; CASE "LF1_50"; FETCH (COUPLING_CH1)LF1_50; CASE ELSE; FETCH COUPLING_CH1; END SELECT; STORE COUPLING_CH1; ELSE; IF LIVEMODE THEN ; DONTCARE COUPLING_CH1; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT SKEW_CH1 ; TYPE CONTINUOUS ; VALUES RANGE -100E-6,100E-6 ; INITIAL 0.0; SET ACTIONS ; OUTPUT SKEW_CH1 FORMAT '":CAL:SKEW CHAN1,",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING "CAL:SKEW? CHAN1" ; ENTER SKEW_CH1 FORMAT 'K' ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT STORE_CH1_WM1 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN1,WMEM1;"; OUTPUT STRING ":WMEM1:SAVE CHAN1"; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; !If VIEW_WF_WM1 THEN; ! get wf_WM1; !end if; FETCH VMIN_CH1; STORE VMIN_WM1; FETCH VMAX_CH1; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; FETCH (SOURCE_WM1)CHAN1; STORE SOURCE_WM1; FETCH UNITS_CH1_DISP ; STORE UNITS_WM1_DISP ; FETCH 0 ; STORE WM1_X_Axis_Units ; FETCH TIME_SENS ;STORE WM1_TIME_SENS ; FETCH TIME_DELAY ; STORE WM1_TIME_DELAY ; FETCH TIME_REF ; STORE WM1_TIME_REF ; FETCH SENS_CH1 ; STORE WM1_SENS ; FETCH OFFSET_CH1 ; STORE WM1_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM1; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH1_WM2 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN1,WMEM2;"; OUTPUT STRING ":WMEM2:SAVE CHAN1"; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM2; get X_MIN; fetch X_MIN; store XMIN_WM2; FETCH VMIN_CH1; STORE VMIN_WM2; FETCH VMAX_CH1; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM2 THEN; ! get wf_WM2; !end if; FETCH (SOURCE_WM2)CHAN1; STORE SOURCE_WM2; FETCH UNITS_CH1_DISP ; STORE UNITS_WM2_DISP ; FETCH 0 ; STORE WM2_X_Axis_Units ; FETCH TIME_SENS ;STORE WM2_TIME_SENS ; FETCH TIME_DELAY ; STORE WM2_TIME_DELAY ; FETCH TIME_REF ; STORE WM2_TIME_REF ; FETCH SENS_CH1 ; STORE WM2_SENS ; FETCH OFFSET_CH1 ; STORE WM2_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM2; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH1_WM3 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN1,WMEM3;"; OUTPUT STRING ":WMEM3:SAVE CHAN1"; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM3; get X_MIN; fetch X_MIN; store XMIN_WM3; FETCH VMIN_CH1; STORE VMIN_WM3; FETCH VMAX_CH1; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM3 THEN; ! get wf_WM3; !end if; FETCH (SOURCE_WM3)CHAN1; STORE SOURCE_WM3; FETCH UNITS_CH1_DISP ; STORE UNITS_WM3_DISP ; FETCH 0 ; STORE WM3_X_Axis_Units ; FETCH TIME_SENS ;STORE WM3_TIME_SENS ; FETCH TIME_DELAY ; STORE WM3_TIME_DELAY ; FETCH TIME_REF ; STORE WM3_TIME_REF ; FETCH SENS_CH1 ; STORE WM3_SENS ; FETCH OFFSET_CH1 ; STORE WM3_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM3; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH1_WM4 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN1,WMEM4;"; OUTPUT STRING ":WMEM4:SAVE CHAN1"; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM4; get X_MIN; fetch X_MIN; store XMIN_WM4; FETCH VMIN_CH1; STORE VMIN_WM4; FETCH VMAX_CH1; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM4 THEN; ! get wf_WM4; !end if; FETCH (SOURCE_WM4)CHAN1; STORE SOURCE_WM4; FETCH UNITS_CH1_DISP ; STORE UNITS_WM4_DISP ; FETCH 0 ; STORE WM4_X_Axis_Units ; FETCH TIME_SENS ;STORE WM4_TIME_SENS ; FETCH TIME_DELAY ; STORE WM4_TIME_DELAY ; FETCH TIME_REF ; STORE WM4_TIME_REF ; FETCH SENS_CH1 ; STORE WM4_SENS ; FETCH OFFSET_CH1 ; STORE WM4_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM4; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; !>> CHANNEL #2 ... COMPONENT PROBE_CH2 NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED PROBE_CH2,MIN_SENS_CH2,MAX_SENS_CH2,SENS_CH2, OFFSET_CH2,VMIN_CH2,VMAX_CH2,SENS_INCR_CH2, TRIGGER_LEVEL_CH2,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2 ; SET ACTIONS; IF Plug_in2 THEN; OUTPUT PROBE_CH2 FORMAT '":CHAN2:PROB ",K'; OUTPUT PROBE_UNITS_CH2 TABLE ',RAT',',DEC' ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE PROBE_CH2; DONTCARE PROBE_UNITS_CH2; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:PROB?"; ENTER PROBE_CH2 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE PROBE_CH2; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS; GOSUB UPDATE_TRACE_DATA; END ACTIONS; END COMPONENT; COMPONENT PROBE_UNITS_CH2 ; ! the instrument might always store it as RAT - check it out TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET PROBE_CH2 ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MIN_SENS_CH2 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 1E-3; GET ACTIONS; SELECT Plug_in2; CASE (Plug_in2)HP54711A; FETCH 21E-3; CASE (Plug_in2)HP54712A; FETCH 1E-3; CASE (Plug_in2)HP54713A; FETCH 1E-3; CASE (Plug_in2)HP54721A; FETCH 1E-3; CASE ELSE; FETCH 1E-3; END SELECT; FETCH PROBE_CH2; MUL; FETCH UNITS_ATT_CH2 ; DIV ; STORE MIN_SENS_CH2; END ACTIONS; END COMPONENT; COMPONENT MAX_SENS_CH2 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 5; GET ACTIONS; SELECT Plug_in2; CASE (Plug_in2)HP54711A; FETCH 1; CASE (Plug_in2)HP54712A; FETCH 1; CASE (Plug_in2)HP54713A; FETCH 5; CASE (Plug_in2)HP54721A; FETCH 1; CASE ELSE; FETCH 5; END SELECT; FETCH PROBE_CH2; MUL; FETCH UNITS_ATT_CH2 ; DIV ; STORE MAX_SENS_CH2; END ACTIONS; END COMPONENT; COMPONENT SENS_CH2; TYPE CONTINUOUS; VALUES RANGE MIN_SENS_CH2,MAX_SENS_CH2; INITIAL 1; COUPLED OFFSET_CH2,VMIN_CH2,VMAX_CH2,SENS_INCR_CH2, TRIGGER_LEVEL_CH2,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in2 THEN; OUTPUT SENS_CH2 FORMAT '":CHAN2:SCAL ",K'; IF RECALLING THEN ; ELSE ; GET SENS_CH2 ; END IF ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE SENS_CH2; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:SCAL?"; ENTER SENS_CH2 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE SENS_CH2; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS; FETCH Plug_in2 ; GOSUB Get_Offset_Ranges ; FETCH Plug_in2 ; GOSUB Get_Trigger_Ranges ; GOSUB UPDATE_TRACE_DATA; END ACTIONS; END COMPONENT; COMPONENT OFFSET_CH2_MIN ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH2_MAX ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH2; TYPE CONTINUOUS; VALUES RANGE OFFSET_CH2_MIN,OFFSET_CH2_MAX; INITIAL 0; COUPLED OFFSET_CH2,VMIN_CH2,VMAX_CH2,SENS_INCR_CH2, TRIGGER_LEVEL_CH2,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in2 THEN; OUTPUT OFFSET_CH2 FORMAT '":CHAN2:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE OFFSET_CH2; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:OFFS?"; ENTER OFFSET_CH2 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE OFFSET_CH2; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT VMIN_CH2 NOERRCHECK; TYPE CONTINUOUS; INITIAL -4; GET ACTIONS; ! offset-range/2 ... FETCH OFFSET_CH2; FETCH SENS_CH2; FETCH 4; MUL; SUB; STORE VMIN_CH2; END ACTIONS; END COMPONENT; COMPONENT VMAX_CH2 NOERRCHECK; TYPE CONTINUOUS; INITIAL +4; GET ACTIONS; ! offset+range/2 ... FETCH OFFSET_CH2; FETCH SENS_CH2; FETCH 4; MUL; ADD; STORE VMAX_CH2; END ACTIONS; END COMPONENT; COMPONENT SENS_INCR_CH2 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 10E-3; ! 1% of range ... GET ACTIONS; FETCH VMAX_CH2; FETCH VMIN_CH2; SUB; FETCH 80; DIV; STORE SENS_INCR_CH2; END ACTIONS; END COMPONENT; COMPONENT UNITS_CH2_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_CH2 ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; SET ACTIONS ; IF Plug_in2 THEN ; OUTPUT STRING ":CHAN2:UNIT " ; OUTPUT UNITS_CH2 TABLE 'VOLT','AMP','WATT','UNKN' ; ELSE ; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH2 ; END IF ; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS ; FETCH UNITS_CH2 ; STORE UNITS_CH2_DISP ; SET MARKER_DISP_UNITS_1 ; SET MARKER_DISP_UNITS_2 ; SET UNITS_FN1_DISP ; SET UNITS_FN2_DISP ; SET MEAS_DISP_UNITS ; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; GET ACTIONS ; IF Plug_in2 THEN ; OUTPUT STRING ":CHAN2:UNIT?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "VOLT" ; FETCH (UNITS_CH2) VOLT ; CASE "AMP" ; FETCH (UNITS_CH2) AMP ; CASE "WATT" ; FETCH (UNITS_CH2) WATT ; CASE "UNKN" ; FETCH (UNITS_CH2) UNKN ; END SELECT ; DUP ; STORE UNITS_CH2 ; STORE UNITS_CH2_DISP ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH2 ; END IF ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT UNITS_ATT_CH2 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? ; INITIAL 1 ; COUPLED UNITS_ATT_CH2,SENS_CH2,OFFSET_CH2,TRIGGER_LEVEL_CH2,MIN_SENS_CH2,MAX_SENS_CH2, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in2 THEN; OUTPUT UNITS_ATT_CH2 FORMAT '":CHAN2:UNIT:ATT ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH2; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:UNIT:ATT?"; ENTER UNITS_ATT_CH2 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH2; END IF ; END IF; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT UNITS_OFF_CH2 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? INITIAL 0 ; COUPLED UNITS_OFF_CH2,SENS_CH2,OFFSET_CH2,TRIGGER_LEVEL_CH2, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in2 THEN; OUTPUT UNITS_OFF_CH2 FORMAT '":CHAN2:UNIT:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH2; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:UNIT:OFFS?"; ENTER UNITS_OFF_CH2 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH2; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT BWLIMIT_CH2; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in2; FETCH (Plug_in2)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN2:BWL "; OUTPUT BWLIMIT_CH2 TABLE 'OFF;','ON;'; ELSE; DONTCARE BWLIMIT_CH2; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in2; FETCH (Plug_in2)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN2:BWL?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (BWLIMIT_CH2)OFF; CASE 1; FETCH (BWLIMIT_CH2)ON; CASE ELSE; FETCH BWLIMIT_CH2; END SELECT; STORE BWLIMIT_CH2; ELSE; DONTCARE BWLIMIT_CH2; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT CALOUT_CH2 ; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in2; FETCH (Plug_in2)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN2:OUTP "; OUTPUT CALOUT_CH2 TABLE 'OFF;','ON;'; ELSE; DONTCARE CALOUT_CH2; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in2; FETCH (Plug_in2)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN2:OUTP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (CALOUT_CH2)OFF; CASE 1; FETCH (CALOUT_CH2)ON; CASE ELSE; FETCH CALOUT_CH2; END SELECT; STORE CALOUT_CH2; ELSE; DONTCARE CALOUT_CH2; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT SENS_711A_CH2 ; TYPE DISCRETE; VALUES MAX,DEF; INITIAL DEF; SET ACTIONS; FETCH Plug_in2; FETCH (Plug_in2)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN2:SENS "; OUTPUT SENS_711A_CH2 TABLE 'MAX;','DEF;'; ELSE; DONTCARE SENS_711A_CH2; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in2; FETCH (Plug_in2)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN2:SENS?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "MAX"; FETCH (SENS_711A_CH2)MAX; CASE "DEF"; FETCH (SENS_711A_CH2)DEF; CASE ELSE; FETCH SENS_711A_CH2; END SELECT; STORE SENS_711A_CH2; ELSE; DONTCARE SENS_711A_CH2; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT COUPLING_CH2; TYPE DISCRETE; VALUES DC,DC50,LF1_50,LF1,LF2 ; INITIAL DC50; SET ACTIONS; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:INP "; OUTPUT COUPLING_CH2 TABLE 'DC;','DC50;','LF1_50;','LF1;','LF2;'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE COUPLING_CH2; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in2 THEN; OUTPUT STRING ":CHAN2:INP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "DC"; FETCH (COUPLING_CH2)DC; CASE "DC50"; FETCH (COUPLING_CH2)DC50; CASE "LF1"; FETCH (COUPLING_CH2)LF1; CASE "LF2"; FETCH (COUPLING_CH2)LF2; CASE "LF1_50"; FETCH (COUPLING_CH2)LF1_50; CASE ELSE; FETCH COUPLING_CH2; END SELECT; STORE COUPLING_CH2; ELSE; IF LIVEMODE THEN ; DONTCARE COUPLING_CH2; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT SKEW_CH2 ; TYPE CONTINUOUS ; VALUES RANGE -100E-6,100E-6 ; INITIAL 0.0; SET ACTIONS ; OUTPUT SKEW_CH2 FORMAT '":CAL:SKEW CHAN2,",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING "CAL:SKEW? CHAN2" ; ENTER SKEW_CH2 FORMAT 'K' ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT STORE_CH2_WM1 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN2,WMEM1;"; OUTPUT STRING ":WMEM1:SAVE CHAN2"; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_CH2; STORE VMIN_WM1; FETCH VMAX_CH2; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM1 THEN; ! get wf_WM1; !end if; FETCH (SOURCE_WM1)CHAN2; STORE SOURCE_WM1; FETCH UNITS_CH2_DISP ; STORE UNITS_WM1_DISP ; FETCH 0 ; STORE WM1_X_Axis_Units ; FETCH TIME_SENS ;STORE WM1_TIME_SENS ; FETCH TIME_DELAY ; STORE WM1_TIME_DELAY ; FETCH TIME_REF ; STORE WM1_TIME_REF ; FETCH SENS_CH2 ; STORE WM1_SENS ; FETCH OFFSET_CH2 ; STORE WM1_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM1; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH2_WM2 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN2,WMEM2;"; OUTPUT STRING ":WMEM2:SAVE CHAN2"; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM2; get X_MIN; fetch X_MIN; store XMIN_WM2; FETCH VMIN_CH2; STORE VMIN_WM2; FETCH VMAX_CH2; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM2 THEN; ! get wf_WM2; !end if; FETCH (SOURCE_WM2)CHAN2; STORE SOURCE_WM2; FETCH UNITS_CH2_DISP ; STORE UNITS_WM2_DISP ; FETCH 0 ; STORE WM2_X_Axis_Units ; FETCH TIME_SENS ;STORE WM2_TIME_SENS ; FETCH TIME_DELAY ; STORE WM2_TIME_DELAY ; FETCH TIME_REF ; STORE WM2_TIME_REF ; FETCH SENS_CH2 ; STORE WM2_SENS ; FETCH OFFSET_CH2 ; STORE WM2_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM2; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH2_WM3 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN2,WMEM3;"; OUTPUT STRING ":WMEM3:SAVE CHAN2"; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM3; get X_MIN; fetch X_MIN; store XMIN_WM3; FETCH VMIN_CH2; STORE VMIN_WM3; FETCH VMAX_CH2; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM3 THEN; ! get wf_WM3; !end if; FETCH (SOURCE_WM3)CHAN2; STORE SOURCE_WM3; FETCH UNITS_CH2_DISP ; STORE UNITS_WM3_DISP ; FETCH 0 ; STORE WM3_X_Axis_Units ; FETCH TIME_SENS ;STORE WM3_TIME_SENS ; FETCH TIME_DELAY ; STORE WM3_TIME_DELAY ; FETCH TIME_REF ; STORE WM3_TIME_REF ; FETCH SENS_CH2 ; STORE WM3_SENS ; FETCH OFFSET_CH2 ; STORE WM3_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM3; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH2_WM4 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN2,WMEM4;"; OUTPUT STRING ":WMEM4:SAVE CHAN2"; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM4; get X_MIN; fetch X_MIN; store XMIN_WM4; FETCH VMIN_CH2; STORE VMIN_WM4; FETCH VMAX_CH2; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM4 THEN; ! get wf_WM4; !end if; FETCH (SOURCE_WM4)CHAN2; STORE SOURCE_WM4; FETCH UNITS_CH2_DISP ; STORE UNITS_WM4_DISP ; FETCH 0 ; STORE WM4_X_Axis_Units ; FETCH TIME_SENS ;STORE WM4_TIME_SENS ; FETCH TIME_DELAY ; STORE WM4_TIME_DELAY ; FETCH TIME_REF ; STORE WM4_TIME_REF ; FETCH SENS_CH2 ; STORE WM4_SENS ; FETCH OFFSET_CH2 ; STORE WM4_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM4; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; !>> CHANNEL #3 ... COMPONENT PROBE_CH3 NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED PROBE_CH3,MIN_SENS_CH3,MAX_SENS_CH3,SENS_CH3, OFFSET_CH3,VMIN_CH3,VMAX_CH3,SENS_INCR_CH3, TRIGGER_LEVEL_CH3,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in3 THEN; OUTPUT PROBE_CH3 FORMAT '":CHAN3:PROB ",K'; OUTPUT PROBE_UNITS_CH3 TABLE ',RAT',',DEC' ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE PROBE_CH3; DONTCARE PROBE_UNITS_CH3; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:PROB?"; ENTER PROBE_CH3 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE PROBE_CH3; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PROBE_UNITS_CH3 ; ! the instrument might always store it as RAT - check it out TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET PROBE_CH3 ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MIN_SENS_CH3 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 1E-3; GET ACTIONS; SELECT Plug_in3; CASE (Plug_in3)HP54711A; FETCH 21E-3; CASE (Plug_in3)HP54712A; FETCH 1E-3; CASE (Plug_in3)HP54713A; FETCH 1E-3; CASE (Plug_in3)HP54721A; FETCH 1E-3; CASE ELSE; FETCH 1E-3; END SELECT; FETCH PROBE_CH3; MUL; FETCH UNITS_ATT_CH3 ; DIV ; STORE MIN_SENS_CH3; END ACTIONS; END COMPONENT; COMPONENT MAX_SENS_CH3 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 5; GET ACTIONS; SELECT Plug_in3; CASE (Plug_in3)HP54711A; FETCH 1; CASE (Plug_in3)HP54712A; FETCH 1; CASE (Plug_in3)HP54713A; FETCH 5; CASE (Plug_in3)HP54721A; FETCH 1; CASE ELSE; FETCH 5; END SELECT; FETCH PROBE_CH3; MUL; FETCH UNITS_ATT_CH3 ; DIV ; STORE MAX_SENS_CH3; END ACTIONS; END COMPONENT; COMPONENT SENS_CH3; TYPE CONTINUOUS; VALUES RANGE MIN_SENS_CH3,MAX_SENS_CH3; INITIAL 1; COUPLED OFFSET_CH3,VMIN_CH3,VMAX_CH3,SENS_INCR_CH3, TRIGGER_LEVEL_CH3,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in3 THEN; OUTPUT SENS_CH3 FORMAT '":CHAN3:SCAL ",K'; IF RECALLING THEN ; ELSE ; GET SENS_CH3 ; END IF ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE SENS_CH3; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:SCAL?"; ENTER SENS_CH3 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE SENS_CH3; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS; GOSUB UPDATE_TRACE_DATA; FETCH Plug_in3 ; GOSUB Get_Offset_Ranges ; FETCH Plug_in3 ; GOSUB Get_Trigger_Ranges ; END ACTIONS; END COMPONENT; COMPONENT OFFSET_CH3_MIN ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH3_MAX ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH3; TYPE CONTINUOUS; VALUES RANGE OFFSET_CH3_MIN,OFFSET_CH3_MAX; INITIAL 0; COUPLED OFFSET_CH3,VMIN_CH3,VMAX_CH3,SENS_INCR_CH3, TRIGGER_LEVEL_CH3,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in3 THEN; OUTPUT OFFSET_CH3 FORMAT '":CHAN3:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODe THEN ; DONTCARE OFFSET_CH3; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:OFFS?"; ENTER OFFSET_CH3 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE OFFSET_CH3; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT VMIN_CH3 NOERRCHECK; TYPE CONTINUOUS; INITIAL -4; GET ACTIONS; ! offset-range/2 ... FETCH OFFSET_CH3; FETCH SENS_CH3; FETCH 4; MUL; SUB; STORE VMIN_CH3; END ACTIONS; END COMPONENT; COMPONENT VMAX_CH3 NOERRCHECK; TYPE CONTINUOUS; INITIAL +4; GET ACTIONS; ! offset+range/2 ... FETCH OFFSET_CH3; FETCH SENS_CH3; FETCH 4; MUL; ADD; STORE VMAX_CH3; END ACTIONS; END COMPONENT; COMPONENT SENS_INCR_CH3 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 10E-3; ! 1% of range ... GET ACTIONS; FETCH VMAX_CH3; FETCH VMIN_CH3; SUB; FETCH 80; DIV; STORE SENS_INCR_CH3; END ACTIONS; END COMPONENT; COMPONENT UNITS_CH3_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_CH3 ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; SET ACTIONS ; IF Plug_in3 THEN ; OUTPUT STRING ":CHAN3:UNIT " ; OUTPUT UNITS_CH3 TABLE 'VOLT','AMP','WATT','UNKN' ; ELSE ; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH3 ; END IF ; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS ; FETCH UNITS_CH3 ; STORE UNITS_CH3_DISP ; SET MARKER_DISP_UNITS_1 ; SET MARKER_DISP_UNITS_2 ; SET UNITS_FN1_DISP ; SET UNITS_FN2_DISP ; SET MEAS_DISP_UNITS ;SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; GET ACTIONS ; IF Plug_in3 THEN ; OUTPUT STRING ":CHAN3:UNIT?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "VOLT" ; FETCH (UNITS_CH3) VOLT ; CASE "AMP" ; FETCH (UNITS_CH3) AMP ; CASE "WATT" ; FETCH (UNITS_CH3) WATT ; CASE "UNKN" ; FETCH (UNITS_CH3) UNKN ; END SELECT ; DUP ; STORE UNITS_CH3 ; STORE UNITS_CH3_DISP ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH3 ; END IF ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT UNITS_ATT_CH3 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? ; INITIAL 1 ; COUPLED UNITS_ATT_CH3,SENS_CH3,OFFSET_CH3,TRIGGER_LEVEL_CH3,MIN_SENS_CH3,MAX_SENS_CH3, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in3 THEN; OUTPUT UNITS_ATT_CH3 FORMAT '":CHAN3:UNIT:ATT ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH3; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:UNIT:ATT?"; ENTER UNITS_ATT_CH3 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH3; END IF ; END IF; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT UNITS_OFF_CH3 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? INITIAL 0 ; COUPLED UNITS_OFF_CH3,SENS_CH3,OFFSET_CH3,TRIGGER_LEVEL_CH3, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in3 THEN; OUTPUT UNITS_OFF_CH3 FORMAT '":CHAN3:UNIT:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH3; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:UNIT:OFFS?"; ENTER UNITS_OFF_CH3 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH3; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT BWLIMIT_CH3; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in3; FETCH (Plug_in3)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN3:BWL "; OUTPUT BWLIMIT_CH3 TABLE 'OFF;','ON;'; ELSE; DONTCARE BWLIMIT_CH3; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in3; FETCH (Plug_in3)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN3:BWL?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (BWLIMIT_CH3)OFF; CASE 1; FETCH (BWLIMIT_CH3)ON; CASE ELSE; FETCH BWLIMIT_CH3; END SELECT; STORE BWLIMIT_CH3; ELSE; DONTCARE BWLIMIT_CH3; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT CALOUT_CH3 ; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in3; FETCH (Plug_in3)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN3:OUTP "; OUTPUT CALOUT_CH3 TABLE 'OFF;','ON;'; ELSE; DONTCARE CALOUT_CH3; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in3; FETCH (Plug_in3)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN3:OUTP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (CALOUT_CH3)OFF; CASE 1; FETCH (CALOUT_CH3)ON; CASE ELSE; FETCH CALOUT_CH3; END SELECT; STORE CALOUT_CH3; ELSE; DONTCARE CALOUT_CH3; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT SENS_711A_CH3 ; TYPE DISCRETE; VALUES MAX,DEF; INITIAL DEF; SET ACTIONS; FETCH Plug_in3; FETCH (Plug_in3)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN3:SENS "; OUTPUT SENS_711A_CH3 TABLE 'MAX;','DEF;'; ELSE; DONTCARE SENS_711A_CH3; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in3; FETCH (Plug_in3)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN3:SENS?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "MAX"; FETCH (SENS_711A_CH3)MAX; CASE "DEF"; FETCH (SENS_711A_CH3)DEF; CASE ELSE; FETCH SENS_711A_CH3; END SELECT; STORE SENS_711A_CH3; ELSE; DONTCARE SENS_711A_CH3; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT COUPLING_CH3; TYPE DISCRETE; VALUES DC,DC50,LF1_50,LF1,LF2 ; INITIAL DC50; SET ACTIONS; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:INP "; OUTPUT COUPLING_CH3 TABLE 'DC;','DC50;','LF1_50;','LF1;','LF2;'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE COUPLING_CH3; ! this only serves the purpose of space in store-state ? END IF ; END IF ; ! check it out END IF; END ACTIONS; GET ACTIONS; IF Plug_in3 THEN; OUTPUT STRING ":CHAN3:INP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "DC"; FETCH (COUPLING_CH3)DC; CASE "DC50"; FETCH (COUPLING_CH3)DC50; CASE "LF1"; FETCH (COUPLING_CH3)LF1; CASE "LF2"; FETCH (COUPLING_CH3)LF2; CASE "LF1_50"; FETCH (COUPLING_CH3)LF1_50; CASE ELSE; FETCH COUPLING_CH3; END SELECT; STORE COUPLING_CH3; ELSE; IF LIVEMODE THEN ; DONTCARE COUPLING_CH3; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT SKEW_CH3 ; TYPE CONTINUOUS ; VALUES RANGE -100E-6,100E-6 ; INITIAL 0.0; SET ACTIONS ; OUTPUT SKEW_CH3 FORMAT '":CAL:SKEW CHAN3,",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING "CAL:SKEW? CHAN3" ; ENTER SKEW_CH3 FORMAT 'K' ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT STORE_CH3_WM1 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN3,WMEM1;"; OUTPUT STRING ":WMEM1:SAVE CHAN3"; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_CH3; STORE VMIN_WM1; FETCH VMAX_CH3; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM1 THEN; ! get wf_WM1; !end if; FETCH (SOURCE_WM1)CHAN3; STORE SOURCE_WM1; FETCH UNITS_CH3_DISP ; STORE UNITS_WM1_DISP ; FETCH 0 ; STORE WM1_X_Axis_Units ; FETCH TIME_SENS ;STORE WM1_TIME_SENS ; FETCH TIME_DELAY ; STORE WM1_TIME_DELAY ; FETCH TIME_REF ; STORE WM1_TIME_REF ; FETCH SENS_CH3 ; STORE WM1_SENS ; FETCH OFFSET_CH3 ; STORE WM1_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM1; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH3_WM2 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN3,WMEM2;"; OUTPUT STRING ":WMEM2:SAVE CHAN3"; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM2; get X_MIN; fetch X_MIN; store XMIN_WM2; FETCH VMIN_CH3; STORE VMIN_WM2; FETCH VMAX_CH3; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM2 THEN; ! get wf_WM2; !end if; FETCH (SOURCE_WM2)CHAN3; STORE SOURCE_WM2; FETCH UNITS_CH3_DISP ; STORE UNITS_WM2_DISP ; FETCH 0 ; STORE WM2_X_Axis_Units ; FETCH TIME_SENS ;STORE WM2_TIME_SENS ; FETCH TIME_DELAY ; STORE WM2_TIME_DELAY ; FETCH TIME_REF ; STORE WM2_TIME_REF ; FETCH SENS_CH3 ; STORE WM2_SENS ; FETCH OFFSET_CH3 ; STORE WM2_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM2; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH3_WM3 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN3,WMEM3;"; OUTPUT STRING ":WMEM3:SAVE CHAN3"; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM3; get X_MIN; fetch X_MIN; store XMIN_WM3; FETCH VMIN_CH3; STORE VMIN_WM3; FETCH VMAX_CH3; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM3 THEN; ! get wf_WM3; !end if; FETCH (SOURCE_WM3)CHAN3; STORE SOURCE_WM3; FETCH UNITS_CH3_DISP ; STORE UNITS_WM3_DISP ; FETCH 0 ; STORE WM3_X_Axis_Units ; FETCH TIME_SENS ;STORE WM3_TIME_SENS ; FETCH TIME_DELAY ; STORE WM3_TIME_DELAY ; FETCH TIME_REF ; STORE WM3_TIME_REF ; FETCH SENS_CH3 ; STORE WM3_SENS ; FETCH OFFSET_CH3 ; STORE WM3_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM3; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH3_WM4 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN3,WMEM4;"; OUTPUT STRING ":WMEM4:SAVE CHAN3"; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM4; get X_MIN; fetch X_MIN; store XMIN_WM4; FETCH VMIN_CH3; STORE VMIN_WM4; FETCH VMAX_CH3; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM4 THEN; ! get wf_WM4; !end if; FETCH (SOURCE_WM4)CHAN3; STORE SOURCE_WM4; FETCH UNITS_CH3_DISP ; STORE UNITS_WM4_DISP ; FETCH 0 ; STORE WM4_X_Axis_Units ; FETCH TIME_SENS ;STORE WM4_TIME_SENS ; FETCH TIME_DELAY ; STORE WM4_TIME_DELAY ; FETCH TIME_REF ; STORE WM4_TIME_REF ; FETCH SENS_CH3 ; STORE WM4_SENS ; FETCH OFFSET_CH3 ; STORE WM4_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM4; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; !>> CHANNEL #4 ... COMPONENT PROBE_CH4 NOPOKEINITIAL ; TYPE CONTINUOUS ; VALUES RANGE 1E-4,1E+6; INITIAL 1.0; COUPLED PROBE_CH4,MIN_SENS_CH4,MAX_SENS_CH4,SENS_CH4, OFFSET_CH4,VMIN_CH4,VMAX_CH4,SENS_INCR_CH4, TRIGGER_LEVEL_CH4,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in4 THEN; OUTPUT PROBE_CH4 FORMAT '":CHAN4:PROB ",K'; OUTPUT PROBE_UNITS_CH4 TABLE ',RAT',',DEC' ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE PROBE_CH4; DONTCARE PROBE_UNITS_CH4; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:PROB?"; ENTER PROBE_CH4 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE PROBE_CH4; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT PROBE_UNITS_CH4 ; ! the instrument might always store it as RAT - check it out TYPE DISCRETE ; VALUES RAT,DEC ; INITIAL RAT ; SET ACTIONS ; IF RECALLING THEN ; ELSE ; SET PROBE_CH4 ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MIN_SENS_CH4 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 1E-3; GET ACTIONS; SELECT Plug_in4; CASE (Plug_in4)HP54711A; FETCH 21E-3; CASE (Plug_in4)HP54712A; FETCH 1E-3; CASE (Plug_in4)HP54713A; FETCH 1E-3; CASE (Plug_in4)HP54721A; FETCH 1E-3; CASE ELSE; FETCH 1E-3; END SELECT; FETCH PROBE_CH4; MUL; FETCH UNITS_ATT_CH4 ; DIV ; STORE MIN_SENS_CH4; END ACTIONS; END COMPONENT; COMPONENT MAX_SENS_CH4 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 5; GET ACTIONS; SELECT Plug_in4; CASE (Plug_in4)HP54711A; FETCH 1; CASE (Plug_in4)HP54712A; FETCH 1; CASE (Plug_in4)HP54713A; FETCH 5; CASE (Plug_in4)HP54721A; FETCH 1; CASE ELSE; FETCH 5; END SELECT; FETCH PROBE_CH4; MUL; FETCH UNITS_ATT_CH4 ; DIV ; STORE MAX_SENS_CH4; END ACTIONS; END COMPONENT; COMPONENT SENS_CH4; TYPE CONTINUOUS; VALUES RANGE MIN_SENS_CH4,MAX_SENS_CH4; INITIAL 1; COUPLED OFFSET_CH4,VMIN_CH4,VMAX_CH4,SENS_INCR_CH4, TRIGGER_LEVEL_CH4,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_range,Fn2_range,Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in4 THEN; OUTPUT SENS_CH4 FORMAT '":CHAN4:SCAL ",K'; IF RECALLING THEN ; ELSE ; GET SENS_CH4 ; END IF ; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE SENS_CH4; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:SCAL?"; ENTER SENS_CH4 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE SENS_CH4; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS; GOSUB UPDATE_TRACE_DATA; FETCH Plug_in4 ; GOSUB Get_Offset_Ranges ; FETCH Plug_in4 ; GOSUB Get_Trigger_Ranges ; END ACTIONS; END COMPONENT; COMPONENT OFFSET_CH4_MIN ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH4_MAX ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT OFFSET_CH4; TYPE CONTINUOUS; VALUES RANGE OFFSET_CH4_MIN,OFFSET_CH4_MAX; INITIAL 0; COUPLED OFFSET_CH4,VMIN_CH4,VMAX_CH4,SENS_INCR_CH4, TRIGGER_LEVEL_CH4,EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE, Fn1_offset,Fn2_offset, VMIN_FN1,VMAX_FN1,VMIN_FN2,VMAX_FN2, VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2; SET ACTIONS; IF Plug_in4 THEN; OUTPUT OFFSET_CH4 FORMAT '":CHAN4:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE OFFSET_CH4; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:OFFS?"; ENTER OFFSET_CH4 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE OFFSET_CH4; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT VMIN_CH4 NOERRCHECK; TYPE CONTINUOUS; INITIAL -4; GET ACTIONS; ! offset-range/2 ... FETCH OFFSET_CH4; FETCH SENS_CH4; FETCH 4; MUL; SUB; STORE VMIN_CH4; END ACTIONS; END COMPONENT; COMPONENT VMAX_CH4 NOERRCHECK; TYPE CONTINUOUS; INITIAL +4; GET ACTIONS; ! offset+range/2 ... FETCH OFFSET_CH4; FETCH SENS_CH4; FETCH 4 ; MUL; ADD; STORE VMAX_CH4; END ACTIONS; END COMPONENT; COMPONENT SENS_INCR_CH4 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 10E-3; ! 1% of range ... GET ACTIONS; FETCH VMAX_CH4; FETCH VMIN_CH4; SUB; FETCH 80; DIV; STORE SENS_INCR_CH4; END ACTIONS; END COMPONENT; COMPONENT UNITS_CH4_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; END COMPONENT ; COMPONENT UNITS_CH4 ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN ; INITIAL VOLT ; SET ACTIONS ; IF Plug_in4 THEN ; OUTPUT STRING ":CHAN4:UNIT " ; OUTPUT UNITS_CH4 TABLE 'VOLT','AMP','WATT','UNKN' ; ELSE ; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH4 ; END IF ; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS ; FETCH UNITS_CH4 ; STORE UNITS_CH4_DISP ; SET MARKER_DISP_UNITS_1 ; SET MARKER_DISP_UNITS_2 ; SET UNITS_FN1_DISP ; SET UNITS_FN2_DISP ; SET MEAS_DISP_UNITS ; SET TRIGGER_LEVEL_UNITS ; END ACTIONS ; GET ACTIONS ; IF Plug_in4 THEN ; OUTPUT STRING ":CHAN4:UNIT?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "VOLT" ; FETCH (UNITS_CH4) VOLT ; CASE "AMP" ; FETCH (UNITS_CH4) AMP ; CASE "WATT" ; FETCH (UNITS_CH4) WATT ; CASE "UNKN" ; FETCH (UNITS_CH4) UNKN ; END SELECT ; DUP ; STORE UNITS_CH4 ; STORE UNITS_CH4_DISP ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_CH4 ; END IF ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT UNITS_ATT_CH4 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? ; INITIAL 1 ; COUPLED UNITS_ATT_CH4,SENS_CH4,OFFSET_CH4,TRIGGER_LEVEL_CH4,MIN_SENS_CH4,MAX_SENS_CH4, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in4 THEN; OUTPUT UNITS_ATT_CH4 FORMAT '":CHAN4:UNIT:ATT ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH4; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:UNIT:ATT?"; ENTER UNITS_ATT_CH4 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_ATT_CH4; END IF ; END IF; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT UNITS_OFF_CH4 ; TYPE CONTINUOUS ; !VALUES RANGE ??????? INITIAL 0 ; COUPLED UNITS_OFF_CH4,SENS_CH4,OFFSET_CH4,TRIGGER_LEVEL_CH4, EDGE_TRIGGER_UPDATE,STATE_TRIGGER_UPDATE,GLITCH_TRIGGER_UPDATE, DEVENT_ARM_UPDATE,DEVENT_EVENT_UPDATE,DEVENT_TRIGGER_UPDATE, DTIME_ARM_UPDATE,DTIME_TRIGGER_UPDATE ; SET ACTIONS ; IF Plug_in4 THEN; OUTPUT UNITS_OFF_CH4 FORMAT '":CHAN4:UNIT:OFFS ",K'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH4; END IF ; END IF ; END IF; END ACTIONS ; GET ACTIONS ; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:UNIT:OFFS?"; ENTER UNITS_OFF_CH4 FORMAT K; ELSE; IF LIVEMODE THEN ; DONTCARE UNITS_OFF_CH4; END IF ; END IF ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT BWLIMIT_CH4; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in4; FETCH (Plug_in4)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN4:BWL "; OUTPUT BWLIMIT_CH4 TABLE 'OFF;','ON;'; ELSE; DONTCARE BWLIMIT_CH4; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in4; FETCH (Plug_in4)HP54713A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN4:BWL?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (BWLIMIT_CH4)OFF; CASE 1; FETCH (BWLIMIT_CH4)ON; CASE ELSE; FETCH BWLIMIT_CH4; END SELECT; STORE BWLIMIT_CH4; ELSE; DONTCARE BWLIMIT_CH4; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT CALOUT_CH4 ; TYPE DISCRETE; VALUES OFF,ON; INITIAL OFF; SET ACTIONS; FETCH Plug_in4; FETCH (Plug_in4)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN4:OUTP "; OUTPUT CALOUT_CH4 TABLE 'OFF;','ON;'; ELSE; DONTCARE CALOUT_CH4; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in4; FETCH (Plug_in4)HP54721A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN4:OUTP?;"; ENTER STACK FORMAT K; SELECT STACK; CASE 0; FETCH (CALOUT_CH4)OFF; CASE 1; FETCH (CALOUT_CH4)ON; CASE ELSE; FETCH CALOUT_CH4; END SELECT; STORE CALOUT_CH4; ELSE; DONTCARE CALOUT_CH4; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT SENS_711A_CH4 ; TYPE DISCRETE; VALUES MAX,DEF; INITIAL DEF; SET ACTIONS; FETCH Plug_in4; FETCH (Plug_in4)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN4:SENS "; OUTPUT SENS_711A_CH4 TABLE 'MAX;','DEF;'; ELSE; DONTCARE SENS_711A_CH4; END IF; END ACTIONS; GET ACTIONS; FETCH Plug_in4; FETCH (Plug_in4)HP54711A; EQ; IF STACK THEN; OUTPUT STRING ":CHAN4:SENS?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "MAX"; FETCH (SENS_711A_CH4)MAX; CASE "DEF"; FETCH (SENS_711A_CH4)DEF; CASE ELSE; FETCH SENS_711A_CH4; END SELECT; STORE SENS_711A_CH4; ELSE; DONTCARE SENS_711A_CH4; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; COMPONENT COUPLING_CH4; TYPE DISCRETE; VALUES DC,DC50,LF1_50,LF1,LF2 ; INITIAL DC50; SET ACTIONS; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:INP "; OUTPUT COUPLING_CH4 TABLE 'DC;','DC50;','LF1_50;','LF1;','LF2;'; ELSE; IF RECALLING THEN ; ELSE ; IF LIVEMODE THEN ; DONTCARE COUPLING_CH4; END IF ; END IF ; END IF; END ACTIONS; GET ACTIONS; IF Plug_in4 THEN; OUTPUT STRING ":CHAN4:INP?;"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "DC"; FETCH (COUPLING_CH4)DC; CASE "DC50"; FETCH (COUPLING_CH4)DC50; CASE "LF1"; FETCH (COUPLING_CH4)LF1; CASE "LF2"; FETCH (COUPLING_CH4)LF2; CASE "LF1_50"; FETCH (COUPLING_CH4)LF1_50; CASE ELSE; FETCH COUPLING_CH4; END SELECT; STORE COUPLING_CH4; ELSE; IF LIVEMODE THEN ; DONTCARE COUPLING_CH4; END IF ; END IF; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT; COMPONENT SKEW_CH4 ; TYPE CONTINUOUS ; VALUES RANGE -100E-6,100E-6 ; INITIAL 0.0; SET ACTIONS ; OUTPUT SKEW_CH4 FORMAT '":CAL:SKEW CHAN4,",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING "CAL:SKEW? CHAN4" ; ENTER SKEW_CH4 FORMAT 'K' ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA; END COMPONENT ; ! the foll ranges are saved as they are configuration dependent ! also all the MIN/MAX variables are also saved COMPONENT OFFSET_INCR_CH1 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL INVALID ; GET ACTIONS; FETCH SENS_CH1 ; FETCH 50; DIV ; STORE OFFSET_INCR_CH1 ; END ACTIONS; END COMPONENT; COMPONENT OFFSET_INCR_CH2 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL INVALID ; GET ACTIONS; FETCH SENS_CH2 ; FETCH 50; DIV ; STORE OFFSET_INCR_CH2 ; END ACTIONS; END COMPONENT; COMPONENT OFFSET_INCR_CH3 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL INVALID ; GET ACTIONS; FETCH SENS_CH3 ; FETCH 50; DIV ; STORE OFFSET_INCR_CH3 ; END ACTIONS; END COMPONENT; COMPONENT OFFSET_INCR_CH4 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL INVALID ; GET ACTIONS; FETCH SENS_CH4 ; FETCH 50; DIV ; STORE OFFSET_INCR_CH4 ; END ACTIONS; END COMPONENT; ACTIONS Get_Offset_Ranges ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; SELECT STACK ; CASE 0 ; CASE 1 ; GOSUB Get_Offset_Range_11A ; CASE 2 ; GOSUB Get_Offset_Range_12A ; CASE 3 ; GOSUB Get_Offset_Range_13A ; CASE 4 ; GOSUB Get_Offset_Range_21A ; CASE 5 ; GOSUB Get_Offset_Range_22A ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS Get_Offset_Range_13A ; SELECT SLOT_13A ; CASE 0 ; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; DUP ; DUP ; FETCH 49E-3 ; LE ; IF STACK THEN ; DROP; DROP; FETCH -2; FETCH +2; ELSE ; FETCH 249E-3; LE ; IF STACK THEN ; DROP ; FETCH -10;FETCH +10; ELSE ; FETCH 1.24 ; LE ; IF STACK THEN ; FETCH -50 ; FETCH 50 ; ELSE ; FETCH -250 ; FETCH 250 ; END IF ; END IF ; END IF ; SELECT SLOT_13A ; CASE 0 ; CASE 1 ; STORE OFFSET_CH1_MAX ; STORE OFFSET_CH1_MIN ; GET OFFSET_INCR_CH1 ; CASE 2 ; STORE OFFSET_CH2_MAX ; STORE OFFSET_CH2_MIN ; GET OFFSET_INCR_CH2 ; CASE 3 ; STORE OFFSET_CH3_MAX ; STORE OFFSET_CH3_MIN ; GET OFFSET_INCR_CH3 ; CASE 4 ; STORE OFFSET_CH4_MAX ; STORE OFFSET_CH4_MIN ; GET OFFSET_INCR_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Offset_Range_11A ; SELECT SLOT_11A ; CASE 0 ; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; FETCH -11 ; MUL ; DUP ; FETCH -1 ; MUL ; !DUP ; DUP ; DUP ; !FETCH 50E-3 ; !LE ; !IF STACK THEN ; ! DROP ; DROP ; DROP ; FETCH -440E-3; FETCH 440E-3 ; !ELSE ; ! FETCH 100E-3 ; ! LE ; ! IF STACK THEN ; ! DROP ; DROP ; FETCH -550E-3 ; FETCH 550E-3 ; ! ELSE ; ! FETCH 200E-3 ; ! LE ; ! IF STACK THEN ; ! DROP ; FETCH -1.1 ; FETCH 1.1 ; ! ELSE ; ! FETCH 500E-3 ; ! LE ; ! IF STACK THEN ; ! FETCH -5.5 ; FETCH 5.5 ; ! ELSE ; ! FETCH -11 ; FETCH 11 ; ! END IF ; ! END IF ; ! END IF ; !END IF ; SELECT SLOT_11A ; CASE 0 ; CASE 1 ; STORE OFFSET_CH1_MAX ; STORE OFFSET_CH1_MIN ; GET OFFSET_INCR_CH1 ; CASE 2 ; STORE OFFSET_CH2_MAX ; STORE OFFSET_CH2_MIN ; GET OFFSET_INCR_CH2 ; CASE 3 ; STORE OFFSET_CH3_MAX ; STORE OFFSET_CH3_MIN ; GET OFFSET_INCR_CH3 ; CASE 4 ; STORE OFFSET_CH4_MAX ; STORE OFFSET_CH4_MIN ; GET OFFSET_INCR_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Offset_Range_21A ; SELECT SLOT_21A ; CASE 0 ; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; !FETCH 10; !LE ; !IF STACK THEN ; ! FETCH -120 ; FETCH +120 ; !ELSE ; ! FETCH -12 ; MUL ; DUP ; FETCH -1 ; MUL ; !END IF ; DUP ; DUP ; DUP ; DUP ; DUP ; FETCH 10E-3 ; LE ; IF STACK THEN ; DROP ; DROP ; DROP ; DROP ; DROP ; FETCH -120E-3 ; FETCH 120E-3 ; ELSE ; FETCH 20E-3 ; LE ; IF STACK THEN ; DROP ; DROP ; DROP ; DROP ; FETCH -240E-3 ; FETCH 240E-3 ; ELSE ; FETCH 50E-3 ; LE ; IF STACK THEN ; DROP ; DROP ; DROP ; FETCH -600E-3 ; FETCH 600E-3 ; ELSE ; FETCH 100E-3 ; LE ; IF STACK THEN ; DROP ; DROP ; FETCH -1.2; FETCH 1.2; ELSE ; FETCH 200E-3 ; LE ; IF STACK THEN ; DROP ; FETCH -2.4 ; FETCH 2.4; ELSE ; FETCH 500E-3 ; LE ; IF STACK THEN ; FETCH -6.0 ; FETCH 6.0 ; ELSE ; FETCH -12 ; FETCH 12 ; END IF ; END IF ; END IF ; END IF ; END IF ; END IF ; SELECT SLOT_21A ; CASE 0 ; CASE 1 ; STORE OFFSET_CH1_MAX ; STORE OFFSET_CH1_MIN ; GET OFFSET_INCR_CH1 ; CASE 2 ; STORE OFFSET_CH2_MAX ; STORE OFFSET_CH2_MIN ; GET OFFSET_INCR_CH2 ; CASE 3 ; STORE OFFSET_CH3_MAX ; STORE OFFSET_CH3_MIN ; GET OFFSET_INCR_CH3 ; CASE 4 ; STORE OFFSET_CH4_MAX ; STORE OFFSET_CH4_MIN ; GET OFFSET_INCR_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Offset_Range_12A ; SELECT SLOT_12A ; CASE 0 ; CASE 1 ; FETCH SENS_CH1 ; CASE 2 ; FETCH SENS_CH2 ; CASE 3 ; FETCH SENS_CH3 ; CASE 4 ; FETCH SENS_CH4 ; END SELECT ; FETCH -12 ; MUL ; DUP ; FETCH -1 ; MUL ; !!Insert the correct code here - check it out SELECT SLOT_12A ; CASE 0 ; CASE 1 ; STORE OFFSET_CH1_MAX ; STORE OFFSET_CH1_MIN ; GET OFFSET_INCR_CH1 ; CASE 2 ; STORE OFFSET_CH2_MAX ; STORE OFFSET_CH2_MIN ; GET OFFSET_INCR_CH2 ; CASE 3 ; STORE OFFSET_CH3_MAX ; STORE OFFSET_CH3_MIN ; GET OFFSET_INCR_CH3 ; CASE 4 ; STORE OFFSET_CH4_MAX ; STORE OFFSET_CH4_MIN ; GET OFFSET_INCR_CH4 ; END SELECT ; END ACTIONS ; ACTIONS Get_Offset_Range_22A ; FETCH SENS_CH1 ; FETCH -11 ; MUL ; DUP ; FETCH -1 ; MUL ; STORE OFFSET_CH1_MAX ; STORE OFFSET_CH1_MIN ; GET OFFSET_INCR_CH1 ; END ACTIONS ; COMPONENT STORE_CH4_WM1 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN4,WMEM1;"; OUTPUT STRING ":WMEM1:SAVE CHAN4"; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_CH4; STORE VMIN_WM1; FETCH VMAX_CH4; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM1 THEN; ! get wf_WM1; !end if; FETCH (SOURCE_WM1)CHAN4; STORE SOURCE_WM1; FETCH UNITS_CH4_DISP ; STORE UNITS_WM1_DISP ; FETCH 0 ; STORE WM1_X_Axis_Units ; FETCH TIME_SENS ;STORE WM1_TIME_SENS ; FETCH TIME_DELAY ; STORE WM1_TIME_DELAY ; FETCH TIME_REF ; STORE WM1_TIME_REF ; FETCH SENS_CH4 ; STORE WM1_SENS ; FETCH OFFSET_CH4 ; STORE WM1_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM1; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH4_WM2 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN4,WMEM2;"; OUTPUT STRING ":WMEM2:SAVE CHAN4"; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM2; get X_MIN; fetch X_MIN; store XMIN_WM2; FETCH VMIN_CH4; STORE VMIN_WM2; FETCH VMAX_CH4; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM2 THEN; ! get wf_WM2; !end if; FETCH (SOURCE_WM2)CHAN4; STORE SOURCE_WM2; FETCH UNITS_CH4_DISP ; STORE UNITS_WM2_DISP ; FETCH 0 ; STORE WM2_X_Axis_Units ; FETCH TIME_SENS ;STORE WM2_TIME_SENS ; FETCH TIME_DELAY ; STORE WM2_TIME_DELAY ; FETCH TIME_REF ; STORE WM2_TIME_REF ; FETCH SENS_CH4 ; STORE WM2_SENS ; FETCH OFFSET_CH4 ; STORE WM2_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM2; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH4_WM3 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN4,WMEM3;"; OUTPUT STRING ":WMEM3:SAVE CHAN4"; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM3; get X_MIN; fetch X_MIN; store XMIN_WM3; FETCH VMIN_CH4; STORE VMIN_WM3; FETCH VMAX_CH4; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM3 THEN; ! get wf_WM3; !end if; FETCH (SOURCE_WM3)CHAN4; STORE SOURCE_WM3; FETCH UNITS_CH4_DISP ; STORE UNITS_WM3_DISP ; FETCH 0 ; STORE WM3_X_Axis_Units ; FETCH TIME_SENS ;STORE WM3_TIME_SENS ; FETCH TIME_DELAY ; STORE WM3_TIME_DELAY ; FETCH TIME_REF ; STORE WM3_TIME_REF ; FETCH SENS_CH4 ; STORE WM3_SENS ; FETCH OFFSET_CH4 ; STORE WM3_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM3; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT STORE_CH4_WM4 NOTSAVED; TYPE INTEGER; INITIAL DONTCARE; SET ACTIONS; !OUTPUT STRING ":STORE:WAV CHAN4,WMEM4;"; OUTPUT STRING ":WMEM4:SAVE CHAN4"; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM4; get X_MIN; fetch X_MIN; store XMIN_WM4; FETCH VMIN_CH4; STORE VMIN_WM4; FETCH VMAX_CH4; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM4 THEN; ! get wf_WM4; !end if; FETCH (SOURCE_WM4)CHAN4; STORE SOURCE_WM4; FETCH UNITS_CH4_DISP ; STORE UNITS_WM4_DISP ; FETCH 0 ; STORE WM4_X_Axis_Units ; FETCH TIME_SENS ;STORE WM4_TIME_SENS ; FETCH TIME_DELAY ; STORE WM4_TIME_DELAY ; FETCH TIME_REF ; STORE WM4_TIME_REF ; FETCH SENS_CH4 ; STORE WM4_SENS ; FETCH OFFSET_CH4 ; STORE WM4_OFFSET ; END ACTIONS; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM4; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; !============================== ! MEASURE SUBSYSTEM !============================== COMPONENT Two_sources NOGEN NOERRCHECK; TYPE DISCRETE ; VALUES No,Yes; INITIAL Yes; END COMPONENT; COMPONENT Flag_source ; TYPE INTEGER ; INITIAL 0 ; END COMPONENT ; COMPONENT meas_source2; TYPE DISCRETE ; values c1,c2,c3,c4,fn1,fn2,fft,wm1,wm2,wm3,wm4; INITIAL c1; COUPLED VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2 ; SET ACTIONS; output string ":MEAS:SOUR "; output meas_source table "CHAN1","CHAN2","CHAN3","CHAN4", "FUNC1","FUNC2","FFT","WMEM1","WMEM2" "WMEM3","WMEM4"; output meas_source2 table ",CHAN1",",CHAN2",",CHAN3",",CHAN4", ",FUNC1",",FUNC2",",FFT",",WMEM1",",WMEM2",",WMEM3",",WMEM4"; FETCH (Two_sources)Yes; STORE Two_sources; !invalidate Vtime_voltage; FETCH 1 ; STORE Flag_source ; END ACTIONS; GET ACTIONS; GET meas_source; END ACTIONS; END COMPONENT; component meas_source; type discrete; values c1,c2,c3,c4,fn1,fn2,fft,wm1,wm2,wm3,wm4; initial c1; COUPLED VMIN_MSMT1,VMAX_MSMT1,VMIN_MSMT2,VMAX_MSMT2 ; set actions; output string ":MEAS:SOUR "; output meas_source table "CHAN1","CHAN2","CHAN3","CHAN4", "FUNC1","FUNC2","FFT","WMEM1","WMEM2" "WMEM3","WMEM4"; FETCH (Two_sources)No ; STORE Two_sources; fetch meas_source; store meas_source2; !invalidate Vtime_voltage; invalidate meas_source2; set meas_disp_units ; FETCH 1 ; STORE Flag_source ; end actions; get actions; output string ":MEAS:SOUR?"; enter CHARSTRING format 'K'; FETCH CHARSTRING; dup; dup; FETCH 1; FETCH 5; SUBSTR; STORE Temp_string; select Temp_string; case "CHAN1"; fetch (meas_source)c1; case "CHAN2"; fetch (meas_source)c2; case "CHAN3"; fetch (meas_source)c3; case "CHAN4"; fetch (meas_source)c4; CASE "FUNC1"; FETCH (meas_source) fn1; CASE "FUNC2"; FETCH (meas_source) fn2; CASE "FFT" ; FETCH (meas_source) fft; CASE "WMEM1"; FETCH (meas_source) wm1; CASE "WMEM2"; FETCH (meas_source) wm2; CASE "WMEM3"; FETCH (meas_source) wm3; CASE "WMEM4"; FETCH (meas_source) wm4; case else; fetch meas_source; end select; store meas_source; FETCH ","; POS; IF STACK THEN; ! 2 sources speified FETCH (Two_sources)Yes; STORE Two_sources; FETCH 7; FETCH 5; SUBSTR; STORE Temp_string; select Temp_string; case "CHAN1"; fetch (meas_source2)c1; case "CHAN2"; fetch (meas_source2)c2; case "CHAN3"; fetch (meas_source2)c3; case "CHAN4"; fetch (meas_source2)c4; CASE "FUNC1"; FETCH (meas_source2) fn1; CASE "FUNC2"; FETCH (meas_source2) fn2; CASE "FFT" ; FETCH (meas_source2) fft; CASE "WMEM1"; FETCH (meas_source2) wm1; CASE "WMEM2"; FETCH (meas_source2) wm2; CASE "WMEM3"; FETCH (meas_source2) wm3; CASE "WMEM4"; FETCH (meas_source2) wm4; case else; fetch meas_source2; end select; STORE meas_source2; ELSE; ! only one source drop; FETCH (Two_sources)No ; STORE Two_sources; fetch meas_source; store meas_source2; !invalidate Vtime_voltage; invalidate meas_source2; END IF; end actions; end component; ACTIONS Get_Meas_Marker_Source ; IF Flag_source THEN ; GET MARKER_X1Y1_SRC ; GET MARKER_X2Y2_SRC ; SET MARKER_DISP_UNITS_1 ; SET MARKER_DISP_UNITS_2 ; SET X_AXIS_UNITS ; GET VMIN_MSMT1; GET VMAX_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT2 ; GET MARKER_X1_MIN ; GET MARKER_X1_MAX ; GET MARKER_X2_MIN ; GET MARKER_X2_MAX ; END IF ; IF Meas_cont_stat THEN ; FETCH 0 ; STORE Flag_source ; END IF ; END ACTIONS ; COMPONENT Meas_precision; ! This is not implemented - to be removed after chacking next ver TYPE DISCRETE ; VALUES Coarse, Fine; INITIAL Fine; SET ACTIONS; OUTPUT Meas_precision TABLE ":MEAS:PREC COAR",":MEAS:PREC FINE"; END ACTIONS; GET ACTIONS; OUTPUT STRING ":MEAS:PREC?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "COAR"; FETCH (Meas_precision) Coarse; CASE "FINE"; FETCH (Meas_precision) Fine; CASE ELSE; FETCH Meas_precision; END SELECT; STORE Meas_precision; END ACTIONS; END COMPONENT; component meas_all notsaved; ! check it out - if command is available - ask ed type integer; set actions; output string ":MEAS:ALL?"; gosub meas_wait; enter meas_t_freq format '#,K'; enter meas_t_period format '#,K'; enter meas_t_pwid format '#,K'; enter meas_t_nwid format '#,K'; enter meas_t_rtime format '#,K'; enter meas_t_ftime format '#,K'; ENTER Meas_v_amplitude FORMAT '#,K'; enter meas_v_pp format '#,K'; ENTER Meas_v_preshoot FORMAT '#,K'; ENTER Meas_v_overshoot FORMAT '#,K'; enter meas_t_duty format '#,K'; enter meas_v_rms format '#,K'; enter meas_v_max format '#,K'; enter meas_v_min format '#,K'; enter meas_v_top format '#,K'; enter meas_v_base format '#,K'; end actions; PANEL SET ACTIONS; CODEGEN PEEK,meas_t_freq; CODEGEN PEEK,meas_t_period; CODEGEN PEEK,meas_t_pwid; CODEGEN PEEK,meas_t_nwid; CODEGEN PEEK,meas_t_rtime; CODEGEN PEEK,meas_t_ftime; CODEGEN PEEK,meas_t_duty; CODEGEN PEEK,Meas_v_amplitude; CODEGEN PEEK,Meas_v_overshoot; CODEGEN PEEK,meas_v_rms; CODEGEN PEEK,meas_v_max; CODEGEN PEEK,meas_v_min; CODEGEN PEEK,meas_v_top; CODEGEN PEEK,meas_v_base; END ACTIONS; end component; component meas_scratch notsaved; type integer; set actions; output string ":MEAS:SCR"; !fetch 0; store marker_state; ! clear markers invalidate meas_t_freq ; invalidate meas_t_period ; invalidate meas_t_pwid ; invalidate meas_t_nwid ; invalidate meas_t_rtime ; invalidate meas_t_ftime ; invalidate meas_t_duty ; invalidate meas_t_tmax ; invalidate meas_t_tmin ; invalidate meas_t_tvolt ; invalidate meas_v_amplitude ; invalidate meas_v_pp ; invalidate meas_v_preshoot ; invalidate meas_v_overshoot ; invalidate meas_v_rms ; invalidate meas_v_max ; invalidate meas_v_min ; invalidate meas_v_top ; invalidate meas_v_base ; invalidate meas_v_aver ; invalidate meas_v_lower ; invalidate meas_v_upper ; invalidate meas_v_mid ; invalidate meas_v_time ; invalidate meas_delta ; invalidate meas_fft_freq ; invalidate meas_fft_magn ; invalidate meas_fft_dfreq ; invalidate meas_fft_dmagn ; FETCH 0 ; DUP ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; DUP ; DUP ; DUP ; STORE Meas_param1 ; STORE Meas_param2 ; STORE Meas_param3 ; STORE Meas_param4 ; GOSUB Disable_Limit_Source ; end actions; panel set actions ; if Meas_cont_stat THEN ; GOSUB UPDATE_TRACE_DATA ; end if ; end actions ; end component; COMPONENT Meas_cont_stat ; ! decides whether to send in command mode or cont. mode TYPE DISCRETE ; VALUES OFF,ON ; INITIAL OFF ; SET ACTIONS ; SELECT Meas_cont_stat ; CASE OFF ; FETCH 0 ; DUP ; DUP ; DUP ; STORE Meas_param1 ; STORE Meas_param2 ; STORE Meas_param3 ; STORE Meas_param4 ; CASE ON ; NOTIFY "Please select measurement(s), return to main, click on 'Get CONT results', then view , Thank You ! " ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT Meas_param1 ; ! repeat Meas_param2,Meas_param3,Meas_param4 TYPE DISCRETE ; VALUES dummy, meas_v_amplitude, meas_v_pp , meas_v_preshoot, meas_v_overshoot, meas_v_rms, meas_v_max, meas_v_min, meas_v_top, meas_v_base, meas_v_aver, meas_v_lower, meas_v_upper, meas_v_mid, meas_v_time, meas_t_freq, meas_t_period, meas_t_duty, meas_t_pwid, meas_t_nwid, meas_t_rtime, meas_t_ftime, meas_t_tmax, meas_t_tmin, meas_t_tvolt, meas_delta, meas_fft_freq, meas_fft_magn, meas_fft_dfreq, meas_fft_dmagn ; ! all measurements INITIAL dummy ; END COMPONENT ; COMPONENT Meas_param2 CLONE Meas_param1 ; COMPONENT Meas_param3 CLONE Meas_param1 ; COMPONENT Meas_param4 CLONE Meas_param1 ; ACTIONS Disable_Meas_params ; Disable Meas_param1,dummy, meas_v_amplitude, meas_v_pp , meas_v_preshoot, meas_v_overshoot, meas_v_rms, meas_v_max, meas_v_min, meas_v_top, meas_v_base, meas_v_aver, meas_v_lower, meas_v_upper, meas_v_mid, meas_v_time, meas_t_freq, meas_t_period, meas_t_duty, meas_t_pwid, meas_t_nwid, meas_t_rtime, meas_t_ftime, meas_t_tmax, meas_t_tmin, meas_t_tvolt, meas_delta, meas_fft_freq, meas_fft_magn, meas_fft_dfreq, meas_fft_dmagn ; ! all measurements Disable Meas_param2,dummy, meas_v_amplitude, meas_v_pp , meas_v_preshoot, meas_v_overshoot, meas_v_rms, meas_v_max, meas_v_min, meas_v_top, meas_v_base, meas_v_aver, meas_v_lower, meas_v_upper, meas_v_mid, meas_v_time, meas_t_freq, meas_t_period, meas_t_duty, meas_t_pwid, meas_t_nwid, meas_t_rtime, meas_t_ftime, meas_t_tmax, meas_t_tmin, meas_t_tvolt, meas_delta, meas_fft_freq, meas_fft_magn, meas_fft_dfreq, meas_fft_dmagn ; ! all measurements Disable Meas_param3,dummy, meas_v_amplitude, meas_v_pp , meas_v_preshoot, meas_v_overshoot, meas_v_rms, meas_v_max, meas_v_min, meas_v_top, meas_v_base, meas_v_aver, meas_v_lower, meas_v_upper, meas_v_mid, meas_v_time, meas_t_freq, meas_t_period, meas_t_duty, meas_t_pwid, meas_t_nwid, meas_t_rtime, meas_t_ftime, meas_t_tmax, meas_t_tmin, meas_t_tvolt, meas_delta, meas_fft_freq, meas_fft_magn, meas_fft_dfreq, meas_fft_dmagn ; ! all measurements Disable Meas_param4,dummy, meas_v_amplitude, meas_v_pp , meas_v_preshoot, meas_v_overshoot, meas_v_rms, meas_v_max, meas_v_min, meas_v_top, meas_v_base, meas_v_aver, meas_v_lower, meas_v_upper, meas_v_mid, meas_v_time, meas_t_freq, meas_t_period, meas_t_duty, meas_t_pwid, meas_t_nwid, meas_t_rtime, meas_t_ftime, meas_t_tmax, meas_t_tmin, meas_t_tvolt, meas_delta, meas_fft_freq, meas_fft_magn, meas_fft_dfreq, meas_fft_dmagn ; ! all measurements END ACTIONS ; COMPONENT Meas_meas_type ; TYPE DISCRETE ; VALUES CURR,MIN,MAX,MEAN,SDEV ; INITIAL CURR ; SET ACTIONS ; SELECT Meas_meas_type ; CASE CURR ; FETCH 0 ; CASE ELSE ; FETCH 1 ; END SELECT ; STORE Meas_statistics ; SET Meas_statistics ; END ACTIONS ; END COMPONENT ; COMPONENT Meas_statistics ; TYPE DISCRETE ; VALUES OFF,ON ; INITIAL OFF ; SET ACTIONS ; OUTPUT Meas_statistics TABLE ":MEAS:STAT OFF",":MEAS:STAT ON" ; END ACTIONS ; PANEL SET ACTIONS ; IF Meas_statistics THEN ; ELSE ; FETCH ( Meas_meas_type ) CURR ; STORE Meas_meas_type ; END IF ; END ACTIONS ; GET ACTIONS ; OUTPUT ":MEAS:STAT?" ; ENTER Meas_statistics FORMAT K ; END ACTIONS ; END COMPONENT ; COMPONENT Meas_Stat_Curr1 NOTSAVED; TYPE CONTINUOUS; GET ACTIONS; END ACTIONS; END COMPONENT; COMPONENT Meas_Stat_Min1 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Max1 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Mean1 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Sdev1 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Size1 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Curr2 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Min2 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Max2 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Mean2 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Sdev2 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Size2 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Curr3 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Min3 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Max3 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Mean3 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Sdev3 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Size3 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Curr4 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Min4 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Max4 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Mean4 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Sdev4 CLONE Meas_Stat_Curr1; COMPONENT Meas_Stat_Size4 CLONE Meas_Stat_Curr1; COMPONENT Meas_results ; TYPE INTEGER ; SET ACTIONS ; IF Meas_param1 THEN ; IF Limit_stat THEN ; NOTIFY "Turn Off Limit Testing" ; ELSE ; OUTPUT ":MEAS:RES?"; SELECT Meas_statistics ; CASE OFF ; IF Meas_param1 THEN ; ENTER Meas_Stat_Curr1 FORMAT '#,K' ; FETCH Meas_Stat_Curr1; FETCH Meas_param1 ; GOSUB Store_meas_result ; END IF ; IF Meas_param2 THEN ; ENTER Meas_Stat_Curr2 FORMAT '#,K' ; FETCH Meas_Stat_Curr2; FETCH Meas_param2 ; GOSUB Store_meas_result ; END IF ; IF Meas_param3 THEN ; ENTER Meas_Stat_Curr3 FORMAT '#,K' ; FETCH Meas_Stat_Curr3; FETCH Meas_param3 ; GOSUB Store_meas_result ; END IF ; IF Meas_param4 THEN ; ENTER Meas_Stat_Curr4 FORMAT '#,K' ; FETCH Meas_Stat_Curr4; FETCH Meas_param4 ; GOSUB Store_meas_result ; END IF ; CASE ON ; IF Meas_param1 THEN ; ENTER Meas_Stat_Curr1 FORMAT '#,K'; ENTER Meas_Stat_Min1 FORMAT '#,K'; ENTER Meas_Stat_Max1 FORMAT '#,K'; ENTER Meas_Stat_Mean1 FORMAT '#,K'; ENTER Meas_Stat_Sdev1 FORMAT '#,K'; ENTER Meas_Stat_Size1 FORMAT '#,K'; SELECT Meas_meas_type ; CASE CURR ; FETCH Meas_Stat_Curr1; CASE MIN ; FETCH Meas_Stat_Min1; CASE MAX ; FETCH Meas_Stat_Max1; CASE MEAN ; FETCH Meas_Stat_Mean1; CASE ELSE ; FETCH Meas_Stat_Sdev1; END SELECT ; FETCH Meas_param1 ; GOSUB Store_meas_result ; END IF ; IF Meas_param2 THEN ; ENTER Meas_Stat_Curr2 FORMAT '#,K'; ENTER Meas_Stat_Min2 FORMAT '#,K'; ENTER Meas_Stat_Max2 FORMAT '#,K'; ENTER Meas_Stat_Mean2 FORMAT '#,K'; ENTER Meas_Stat_Sdev2 FORMAT '#,K'; ENTER Meas_Stat_Size2 FORMAT '#,K'; SELECT Meas_meas_type ; CASE CURR ; FETCH Meas_Stat_Curr2; CASE MIN ; FETCH Meas_Stat_Min2; CASE MAX ; FETCH Meas_Stat_Max2; CASE MEAN ; FETCH Meas_Stat_Mean2; CASE ELSE ; FETCH Meas_Stat_Sdev2; END SELECT ; FETCH Meas_param2 ; GOSUB Store_meas_result ; END IF ; IF Meas_param3 THEN ; ENTER Meas_Stat_Curr3 FORMAT '#,K'; ENTER Meas_Stat_Min3 FORMAT '#,K'; ENTER Meas_Stat_Max3 FORMAT '#,K'; ENTER Meas_Stat_Mean3 FORMAT '#,K'; ENTER Meas_Stat_Sdev3 FORMAT '#,K'; ENTER Meas_Stat_Size3 FORMAT '#,K'; SELECT Meas_meas_type ; CASE CURR ; FETCH Meas_Stat_Curr3; CASE MIN ; FETCH Meas_Stat_Min3; CASE MAX ; FETCH Meas_Stat_Max3; CASE MEAN ; FETCH Meas_Stat_Mean3; CASE ELSE ; FETCH Meas_Stat_Sdev3; END SELECT ; FETCH Meas_param3 ; GOSUB Store_meas_result ; END IF ; IF Meas_param4 THEN ; ENTER Meas_Stat_Curr4 FORMAT '#,K'; ENTER Meas_Stat_Min4 FORMAT '#,K'; ENTER Meas_Stat_Max4 FORMAT '#,K'; ENTER Meas_Stat_Mean4 FORMAT '#,K'; ENTER Meas_Stat_Sdev4 FORMAT '#,K'; ENTER Meas_Stat_Size4 FORMAT '#,K'; SELECT Meas_meas_type ; CASE CURR ; FETCH Meas_Stat_Curr4; CASE MIN ; FETCH Meas_Stat_Min4; CASE MAX ; FETCH Meas_Stat_Max4; CASE MEAN ; FETCH Meas_Stat_Mean4; CASE ELSE ; FETCH Meas_Stat_Sdev4; END SELECT ; FETCH Meas_param4 ; GOSUB Store_meas_result ; END IF ; END SELECT ; END IF ; ELSE ; NOTIFY "Please select what is to be measured" ; END IF ; END ACTIONS ; END COMPONENT ; ACTIONS Store_meas_result ; ! Caution - if order is changed this goes haywire !! SELECT Stack ; CASE 0 ; CASE 1 ; STORE meas_v_amplitude ; CASE 2 ; STORE meas_v_pp ; CASE 3 ; STORE meas_v_preshoot ; CASE 4 ; STORE meas_v_overshoot ; CASE 5 ; STORE meas_v_rms ; CASE 6 ; STORE meas_v_max ; CASE 7 ; STORE meas_v_min ; CASE 8 ; STORE meas_v_top ; CASE 9 ; STORE meas_v_base ; CASE 10 ; STORE meas_v_aver ; CASE 11 ; STORE meas_v_lower ; CASE 12 ; STORE meas_v_upper ; CASE 13 ; STORE meas_v_mid ; CASE 14 ; STORE meas_v_time ; CASE 15 ; STORE meas_t_freq ; CASE 16 ; STORE meas_t_period ; CASE 17 ; STORE meas_t_duty ; CASE 18 ; STORE meas_t_pwid ; CASE 19 ; STORE meas_t_nwid ; CASE 20 ; STORE meas_t_rtime ; CASE 21 ; STORE meas_t_ftime ; CASE 22 ; STORE meas_t_tmax ; CASE 23 ; STORE meas_t_tmin ; CASE 24 ; STORE meas_t_tvolt ; CASE 25 ; STORE meas_delta ; CASE 26 ; STORE meas_fft_freq ; CASE 27 ; STORE meas_fft_magn ; CASE 28 ; STORE meas_fft_dfreq ; CASE 29 ; STORE meas_fft_dmagn ; END SELECT ; END ACTIONS ; ACTIONS Store_meas_params ; GOSUB Is_It_Same ; IF Meas_param1 THEN ; IF Meas_param2 THEN ; IF Meas_param3 THEN ; IF Meas_param4 THEN ; IF Flag_duplicate THEN ; DROP ; ELSE ; FETCH Meas_param2 ; STORE Meas_param1 ; GET Limit_Source ; FETCH Limit_Ulimit_2 ; STORE Limit_Ulimit_1 ; FETCH Limit_Llimit_2 ; STORE Limit_Llimit_1 ; FETCH Meas_param3 ; STORE Meas_param2 ; FETCH Limit_Ulimit_3 ; STORE Limit_Ulimit_2 ; FETCH Limit_Llimit_3 ; STORE Limit_Llimit_2 ; FETCH Meas_param4 ; STORE Meas_param3 ; FETCH Limit_Ulimit_4 ; STORE Limit_Ulimit_3 ; FETCH Limit_Llimit_4 ; STORE Limit_Llimit_3 ; STORE Meas_param4 ; INVALIDATE Limit_Ulimit_4 ; INVALIDATE Limit_LLimit_4 ; GOSUB Invalidate_Limit_Results ; END IF ; ELSE ; IF Flag_duplicate THEN ; DROP ; ELSE ; STORE Meas_param4 ; END IF ; END IF ; ELSE ; IF Flag_duplicate THEN ; DROP ; ELSE ; STORE Meas_param3 ; END IF ; END IF ; ELSE ; IF Flag_duplicate THEN ; DROP ; ELSE ; STORE Meas_param2 ; END IF ; END IF ; ELSE ; IF Flag_duplicate THEN ; DROP ; ELSE ; STORE Meas_param1 ; END IF ; GET Limit_Source ; END IF ; GOSUB Enable_Limit_Source ; FETCH 0 ; STORE Flag_duplicate ; END ACTIONS ; COMPONENT Flag_duplicate ; TYPE INTEGER ; VALUES RANGE 0,1 ; INITIAL 0 ; END COMPONENT ; ACTIONS Is_It_Same ; DUP;DUP;DUP;DUP; FETCH Meas_param1 ; EQ ; IF STACK THEN ; IF Flag_source THEN ; ELSE ; FETCH 1 ; STORE Flag_duplicate ; END IF ; END IF ; FETCH Meas_param2 ; EQ ; IF STACK THEN ; IF Flag_source THEN ; ELSE ; FETCH 1 ; STORE Flag_duplicate ; END IF ; END IF ; FETCH Meas_param3 ; EQ ; IF STACK THEN ; IF Flag_source THEN ; ELSE ; FETCH 1 ; STORE Flag_duplicate ; END IF ; END IF ; FETCH Meas_param4 ; EQ ; IF STACK THEN ; IF Flag_source THEN ; ELSE ; FETCH 1 ; STORE Flag_duplicate ; END IF ; END IF ; END ACTIONS ; component meas_show_vmeas notsaved nogen noerrcheck; type integer; panel set actions; HIDE Meas_vmeas_more;hide meas_main; hide meas_tmeas; show meas_vmeas; HIDE Meas_vmeas_more1 ; HIDE meas_tmeas_more ; hide meas_fmeas ; end actions; end component; component meas_show_tmeas notsaved nogen noerrcheck; type integer; panel set actions; HIDE Meas_vmeas_more;hide meas_main; hide meas_vmeas; show meas_tmeas; HIDE Meas_vmeas_more1 ; HIDE meas_tmeas_more ; hide meas_fmeas ; end actions; end component; component meas_show_fmeas notsaved nogen noerrcheck; type integer; panel set actions; HIDE Meas_vmeas_more;hide meas_main; hide meas_vmeas; show meas_fmeas; HIDE Meas_vmeas_more1 ; HIDE meas_tmeas_more ; hide meas_tmeas ; end actions; end component; component meas_show_main notsaved nogen noerrcheck; type integer; panel set actions; HIDE Meas_vmeas_more;hide meas_tmeas; hide meas_vmeas; show meas_main; HIDE Meas_vmeas_more1 ; HIDE meas_tmeas_more ; HIDE meas_fmeas ; end actions; end component; COMPONENT Meas_show_vmeas_more NOTSAVED NOGEN NOERRCHECK; TYPE INTEGER; PANEL SET ACTIONS; hide meas_tmeas; hide meas_vmeas; HIDE meas_main; SHOW Meas_vmeas_more; HIDE Meas_vmeas_more1 ; HIDE meas_tmeas_more ; HIDE meas_fmeas ; END ACTIONS; END COMPONENT; COMPONENT Meas_show_vmeas_more1 NOTSAVED NOGEN NOERRCHECK; TYPE INTEGER; PANEL SET ACTIONS; hide meas_tmeas; hide meas_vmeas; HIDE meas_main; HIDE Meas_vmeas_more; SHOW Meas_vmeas_more1 ; HIDE meas_tmeas_more ; HIDE meas_fmeas ; END ACTIONS; END COMPONENT; component meas_show_tmeas_more notsaved nogen noerrcheck; type integer; panel set actions; hide meas_main; hide meas_vmeas; hide meas_tmeas; Hide meas_vmeas_more ; SHOW meas_tmeas_more ; HIDE meas_fmeas ; end actions ; end component; actions meas_wait; if livemode then; wait spoll bit 4; end if; FETCH (Two_sources) No; STORE Two_sources; invalidate meas_source2; end actions; ! measurement parameters ! voltage measurements COMPONENT MEAS_DISP_UNITS NOGEN ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; SET ACTIONS ; SELECT MEAS_SOURCE ; CASE c1 ; FETCH UNITS_CH1_DISP ; CASE c2 ; FETCH UNITS_CH2_DISP ; CASE c3 ; FETCH UNITS_CH3_DISP ; CASE c4 ; FETCH UNITS_CH4_DISP ; CASE fn1 ; FETCH UNITS_FN1_DISP ; CASE fn2 ; FETCH UNITS_FN2_DISP ; CASE fft ; FETCH (MEAS_DISP_UNITS)DB ; CASE wm1 ; FETCH UNITS_WM1_DISP ; CASE wm2 ; FETCH UNITS_WM2_DISP ; CASE wm3 ; FETCH UNITS_WM3_DISP ; CASE wm4 ; FETCH UNITS_WM4_DISP ; END SELECT ; STORE MEAS_DISP_UNITS ; END ACTIONS ; END COMPONENT ; component meas_v_amplitude notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VAMP?"; gosub meas_wait; enter meas_v_amplitude format 'K'; CASE ON ; output string ":MEAS:VAMP"; FETCH ( Meas_param1 ) meas_v_amplitude ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_pp notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VPP?"; gosub meas_wait; enter meas_v_pp format 'K'; CASE ON ; output string ":MEAS:VPP"; FETCH ( Meas_param1 ) meas_v_pp ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; COMPONENT Meas_v_preshoot NOTSAVED; TYPE CONTINUOUS ; INITIAL 0,INVALID; GET ACTIONS; SELECT Meas_cont_stat ; CASE OFF ; OUTPUT STRING ":MEAS:PRES?"; gosub meas_wait; ENTER Meas_v_preshoot FORMAT 'K'; CASE ON ; output string ":MEAS:PRES"; FETCH ( Meas_param1 ) meas_v_preshoot ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS; END COMPONENT; COMPONENT Meas_v_overshoot NOTSAVED; TYPE CONTINUOUS ; INITIAL 0,INVALID; GET ACTIONS; SELECT Meas_cont_stat ; CASE OFF ; OUTPUT STRING ":MEAS:OVER?"; gosub meas_wait; ENTER Meas_v_overshoot FORMAT 'K'; CASE ON ; output string ":MEAS:OVER"; FETCH ( Meas_param1 ) meas_v_overshoot ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS; END COMPONENT; component meas_v_rms notsaved; ! this requires additional parameters - check it out type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VRMS? "; output meas_v_rms_period TABLE "CYCLE ","DISPLAY " ; output meas_v_rms_acdc TABLE ",AC ",",DC " ; gosub meas_wait; enter meas_v_rms format 'K'; CASE ON ; output string ":MEAS:VRMS "; output meas_v_rms_period TABLE "CYCLE","DISPLAY" ; output meas_v_rms_acdc TABLE ",AC ",",DC " ; FETCH ( Meas_param1 ) meas_v_rms ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; IF MEAS_V_RMS_PERIOD THEN ; ELSE ; FETCH 1 ; STORE MARKER_STATE_VER ; END IF ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; end actions; end component; component meas_v_rms_period ; type discrete ; values CYCLE,DISPLAY ; INITIAL DISPLAY ; end component ; component meas_v_rms_acdc ; type discrete ; values AC,DC ; INITIAL AC ; end component ; component meas_v_max notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VMAX?"; gosub meas_wait; enter meas_v_max format 'K'; CASE ON ; output string ":MEAS:VMAX" ; FETCH ( Meas_param1 ) meas_v_max ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_min notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VMIN?"; gosub meas_wait; enter meas_v_min format 'K'; CASE ON ; output string ":MEAS:VMIN" ; FETCH ( Meas_param1 ) meas_v_min ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_top notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VTOP?"; gosub meas_wait; enter meas_v_top format 'K'; CASE ON ; output string ":MEAS:VTOP" ; FETCH ( Meas_param1 ) meas_v_top ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_base notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VBASE?"; gosub meas_wait; enter meas_v_base format 'K'; CASE ON ; output string ":MEAS:VBASE" ; FETCH ( Meas_param1 ) meas_v_base ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_aver notsaved; ! check it out type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VAV? "; output meas_v_aver_period TABLE "CYCLE","DISPLAY" ; gosub meas_wait; enter meas_v_aver format 'K'; CASE ON ; output string ":MEAS:VAV " ; output meas_v_aver_period TABLE "CYCLE","DISPLAY" ; FETCH ( Meas_param1 ) meas_v_aver ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; IF MEAS_V_AVER_PERIOD THEN ; ELSE ; FETCH 1 ; STORE MARKER_STATE_VER ; END IF ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; end actions; end component; component meas_v_aver_period ; type discrete ; values CYCLE,DISPLAY ; INITIAL DISPLAY ; end component ; component meas_v_lower notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VLOW?"; gosub meas_wait; enter meas_v_lower format 'K'; CASE ON ; output string ":MEAS:VLOW" ; FETCH ( Meas_param1 ) meas_v_lower ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_upper notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VUP?"; gosub meas_wait; enter meas_v_upper format 'K'; CASE ON ; output string ":MEAS:VUP" ; FETCH ( Meas_param1 ) meas_v_upper ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_mid notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VMID?"; gosub meas_wait; enter meas_v_mid format 'K'; CASE ON ; output string ":MEAS:VMID" ; FETCH ( Meas_param1 ) meas_v_mid ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_time notsaved; ! check it out type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:VTIM? "; output meas_v_time_sec FORMAT 'K' ; gosub meas_wait; enter meas_v_time format 'K'; CASE ON ; output string ":MEAS:VTIM " ; FETCH ( Meas_param1 ) meas_v_time ; output meas_v_time_sec FORMAT 'K' ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_VER ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_v_time_sec ; type continuous ; !values range ; initial 0 ; end component ; ! time measurements component meas_t_freq notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:FREQ?"; gosub meas_wait; enter meas_t_freq format 'K'; CASE ON ; output string ":MEAS:FREQ"; FETCH ( Meas_param1 ) meas_t_freq ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_period notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:PER?"; gosub meas_wait; enter meas_t_period format 'K'; CASE ON ; output string ":MEAS:PER"; FETCH ( Meas_param1 ) meas_t_period ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions ; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_duty notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:DUTY?"; gosub meas_wait; enter meas_t_duty format 'K'; CASE ON ; output string ":MEAS:DUTY"; FETCH ( Meas_param1 ) meas_t_duty ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_pwid notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:PWID?"; gosub meas_wait; enter meas_t_pwid format 'K'; CASE ON ; output string ":MEAS:PWID"; FETCH ( Meas_param1 ) meas_t_pwid ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_nwid notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:NWID?"; gosub meas_wait; enter meas_t_nwid format 'K'; CASE ON ; output string ":MEAS:NWID"; FETCH ( Meas_param1 ) meas_t_nwid ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_rtime notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:RIS?"; gosub meas_wait; enter meas_t_rtime format 'K'; CASE ON ; output string ":MEAS:RIS"; FETCH ( Meas_param1 ) meas_t_rtime ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 1 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_ftime notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:FALL?"; gosub meas_wait; enter meas_t_ftime format 'K'; CASE ON ; output string ":MEAS:FALL"; FETCH ( Meas_param1 ) meas_t_ftime ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 1 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_tmax notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:TMAX?"; gosub meas_wait; enter meas_t_tmax format 'K'; CASE ON ; output string ":MEAS:TMAX"; FETCH ( Meas_param1 ) meas_t_tmax ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_tmin notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:TMIN?"; gosub meas_wait; enter meas_t_tmin format 'K'; CASE ON ; output string ":MEAS:TMIN"; FETCH ( Meas_param1 ) meas_t_tmin ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_t_tvolt notsaved; ! check it out - hp54601 driver type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:TVOL? "; output meas_t_volt FORMAT 'K' ; output meas_t_slope TABLE ",+",",-" ; output meas_t_occur FORMAT 'K' ; gosub meas_wait; enter meas_t_tvolt format 'K'; CASE ON ; output string ":MEAS:TVOL "; output meas_t_volt FORMAT 'K' ; output meas_t_slope TABLE ",+",",-" ; output meas_t_occur FORMAT 'K' ; FETCH ( Meas_param1 ) meas_t_tvolt ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; end component; component meas_t_volt ; type continuous ; initial 0 ; !values range ; end component ; component meas_t_slope ; type discrete ; values RISING,FALLING ; initial RISING ; end component ; component meas_t_occur ; type integer ; !values ; initial 1 ; end component ; ! Delta Measurement component meas_delta ; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:DELT? "; output meas_source table "CHAN1","CHAN2","CHAN3","CHAN4", "FUNC1","FUNC2","WMEM1","WMEM2" "WMEM3","WMEM4"; if Two_sources then ; output meas_source table ",CHAN1",",CHAN2",",CHAN3",",CHAN4", ",FUNC1",",FUNC2",",WMEM1",",WMEM2" ",WMEM3",",WMEM4"; end if ; gosub meas_wait; enter meas_delta format 'K'; CASE ON ; output string ":MEAS:DELT "; output meas_source table "CHAN1","CHAN2","CHAN3","CHAN4", "FUNC1","FUNC2","WMEM1","WMEM2" "WMEM3","WMEM4"; if Two_sources then ; output meas_source table ",CHAN1",",CHAN2",",CHAN3",",CHAN4", ",FUNC1",",FUNC2",",WMEM1",",WMEM2" ",WMEM3",",WMEM4"; end if ; FETCH ( Meas_param1 ) meas_delta ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; FETCH 0 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component ; !===================================== ! FFT Measurements !===================================== component meas_fft_freq notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:FFT:FREQ?"; gosub meas_wait; enter meas_fft_freq format 'K'; CASE ON ; output string ":MEAS:FFT:FREQ"; FETCH ( Meas_param1 ) meas_fft_freq ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; ! check it out FETCH 1 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_fft_magn notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:FFT:MAGN?"; gosub meas_wait; enter meas_fft_magn format 'K'; CASE ON ; output string ":MEAS:FFT:MAGN"; FETCH ( Meas_param1 ) meas_fft_magn ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; ! check it out FETCH 1 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_fft_dfreq notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:FFT:DFR?"; gosub meas_wait; enter meas_fft_dfreq format 'K'; CASE ON ; output string ":MEAS:FFT:DFR"; FETCH ( Meas_param1 ) meas_fft_dfreq ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; ! check it out FETCH 1 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; component meas_fft_dmagn notsaved; type continuous; initial 0,invalid; get actions; SELECT Meas_cont_stat ; CASE OFF ; output string ":MEAS:FFT:DMAG?"; gosub meas_wait; enter meas_fft_dmagn format 'K'; CASE ON ; output string ":MEAS:FFT:DMAG"; FETCH ( Meas_param1 ) meas_fft_dmagn ; GOSUB Store_meas_params ; END SELECT ; GOSUB Get_Meas_Marker_Source ; end actions; PANEL GET ACTIONS ; IF Meas_cont_stat THEN ; IF MARKER_STATE_MEAS THEN ; FETCH 1 ; STORE MARKER_STATE_VER ; ! check it out FETCH 1 ; STORE MARKER_STATE_HOR ; GOSUB UPDATE_MARKER_VALUES ; END IF ; END IF ; END ACTIONS ; end component; COMPONENT Meas_fft_peak1 ; type integer ; values range 1,100000 ; initial 1 ; set actions ; OUTPUT Meas_fft_peak1 FORMAT '":MEAS:FFT:PEAK1 ",K' ; end actions ; get actions ; OUTPUT STRING ":MEAS:FFT:PEAK1?" ; ENTER Meas_fft_peak1 FORMAT 'K' ; end actions ; END COMPONENT ; COMPONENT Meas_fft_peak2 ; type integer ; values range 1,100000 ; initial 2 ; set actions ; OUTPUT Meas_fft_peak2 FORMAT '":MEAS:FFT:PEAK2 ",K' ; end actions ; get actions ; OUTPUT STRING ":MEAS:FFT:PEAK2?" ; ENTER Meas_fft_peak2 FORMAT 'K' ; end actions ; END COMPONENT ; COMPONENT Meas_peak_thresh ; type continuous ; values range -200,200 ; initial invalid ; set actions ; OUTPUT Meas_peak_thresh FORMAT '":MEAS:FFT:THR ",K' ; end actions ; get actions ; OUTPUT STRING ":MEAS:FFT:THR?" ; ENTER Meas_peak_thresh FORMAT 'K' ; end actions ; END COMPONENT ; !============================== ! Measurement Definitions !============================== component measdef_show_main notsaved nogen noerrcheck; type integer; panel set actions; show measdef_main ; hide measdef_thr;hide measdef_tbase; hide measdef_delta ; end actions; end component; component measdef_show_delta notsaved nogen noerrcheck; type integer; panel set actions; hide measdef_main ; hide measdef_thr;hide measdef_tbase; show measdef_delta ; end actions; end component; component measdef_show_thr notsaved nogen noerrcheck; type integer; panel set actions; hide measdef_main ; show measdef_thr;hide measdef_tbase; hide measdef_delta ; set meas_thr_units ; end actions; end component; component measdef_show_tbase notsaved nogen noerrcheck; type integer; panel set actions; hide measdef_main ; hide measdef_thr;show measdef_tbase; hide measdef_delta ; end actions; end component; component meas_delta_strtedge_dirn ; type discrete ; values RISING,FALLING,EITHER ; initial RISING ; end component ; component meas_delta_stopedge_dirn ; type discrete ; values RISING,FALLING,EITHER ; initial FALLING ; end component ; component meas_delta_strtedge_num ; type integer ; values range 1, 65534 ; initial 1 ; end component ; component meas_delta_stopedge_num ; type integer ; values range 1, 65534 ; initial 1 ; end component ; component meas_delta_strtedge_pos ; type discrete ; values upper, middle, lower ; initial middle ; end component ; component meas_delta_stopedge_pos ; type discrete ; values upper, middle, lower ; initial middle ; end component ; component meas_set_delta_def ; type integer ; set actions ; output string ":MEAS:DEF DELT " ; output meas_delta_strtedge_dirn TABLE ",RIS",",FALL",",EITH" ; output meas_delta_strtedge_num FORMAT '",",K' ; output meas_delta_strtedge_pos TABLE ",UPP",",MIDD",",LOW" ; output meas_delta_stopedge_dirn TABLE ",RIS",",FALL",",EITH" ; output meas_delta_stopedge_num FORMAT '",",K' ; output meas_delta_stopedge_pos TABLE ",UPP",",MIDD",",LOW" ; IF RECALLING THEN ; ELSE ; GET meas_set_delta_def ; END IF ; end actions ; get actions ; if livemode then ; output string ":MEAS:DEF? DELT" ; enter charstring format "#,AAAAAAAAAA" ; enter charstring format "#,AAAA" ; FETCH CHARSTRING ; FETCH "," ; POS ; DUP ; STORE NUM_BUFFER ; IF STACK THEN ; FETCH charstring ; FETCH 1 ; FETCH NUM_BUFFER ; FETCH 1; SUB ; SUBSTR ; STORE CHARSTRING ; ELSE ; FETCH CHARSTRING ; ENTER charstring FORMAT "#,A" ; STORE CHARSTRING ; END IF; select charstring ; case "RIS" ; FETCH ( meas_delta_strtedge_dirn ) RISING ; CASE "FALL" ; FETCH ( meas_delta_strtedge_dirn ) FALLING ; CASE "EITH" ; FETCH ( meas_delta_strtedge_dirn ) EITHER ; CASE ELSE ; notify "trouble" ; end select ; store meas_delta_strtedge_dirn ; enter meas_delta_strtedge_num format "#,K" ; enter charstring format "#,AAAA" ; FETCH CHARSTRING ; FETCH "," ; POS ; DUP ; STORE NUM_BUFFER ; IF STACK THEN ; FETCH charstring ; FETCH 1 ; FETCH NUM_BUFFER ; FETCH 1; SUB ; SUBSTR ; STORE CHARSTRING ; ELSE ; FETCH CHARSTRING ; ENTER charstring FORMAT "#,A" ; STORE CHARSTRING ; END IF; select charstring ; case "UPP" ; FETCH ( meas_delta_strtedge_pos ) upper ; CASE "MIDD" ; FETCH ( meas_delta_strtedge_pos ) middle ; CASE "LOW" ; FETCH ( meas_delta_strtedge_pos ) lower ; CASE ELSE ; notify "trouble" ; end select ; store meas_delta_strtedge_pos ; enter charstring format "#,AAAA" ; FETCH CHARSTRING ; FETCH "," ; POS ; DUP ; STORE NUM_BUFFER ; IF STACK THEN ; FETCH charstring ; FETCH 1 ; FETCH NUM_BUFFER ; FETCH 1; SUB ; SUBSTR ; STORE CHARSTRING ; ELSE ; FETCH CHARSTRING ; ENTER charstring FORMAT "#,A" ; STORE CHARSTRING ; END IF; select charstring ; case "RIS" ; FETCH ( meas_delta_stopedge_dirn ) RISING ; CASE "FALL" ; FETCH ( meas_delta_stopedge_dirn ) FALLING ; CASE "EITH" ; FETCH ( meas_delta_stopedge_dirn ) EITHER ; CASE ELSE ; notify "trouble" ; end select ; store meas_delta_stopedge_dirn ; enter meas_delta_stopedge_num format "#,K" ; enter charstring format "K" ; select charstring ; case "UPP" ; FETCH ( meas_delta_stopedge_pos ) upper ; CASE "MIDD" ; FETCH ( meas_delta_stopedge_pos ) middle ; CASE "LOW" ; FETCH ( meas_delta_stopedge_pos ) lower ; CASE ELSE ; notify "trouble" ; end select ; store meas_delta_stopedge_pos ; end if ; end actions ; end component ; component meas_thr_std ; type integer ; set actions ; output string ":MEAS:DEF THR,STAN" ; get meas_set_thr_def ; end actions ; end component ; component meas_thr_units ; type discrete ; values PCT,UNITS ; initial PCT ; PANEL SET ACTIONS ; SELECT meas_thr_units ; CASE PCT ; HIDE measdef_thr_volts ; SHOW measdef_thr_pct ; CASE UNITS ; HIDE measdef_thr_pct ; SHOW measdef_thr_volts ; END SELECT ; END ACTIONS ; end component ; component meas_thr_upp_pct ; type integer ; values range -25,125 ; initial 90 ; end component ; component meas_thr_upp_volts ; type continuous ; values range -998E+6,1E+9; initial 5.00; end component ; component meas_thr_mid_pct ; type integer ; values range -25,125 ; initial 50 ; end component ; component meas_thr_mid_volts ; type continuous ; values range -999E+6,+999E+6 ; initial 1.60 ; end component ; component meas_thr_low_pct ; type integer ; values range -25,125 ; initial 10 ; end component ; component meas_thr_low_volts ; type continuous ; values range -1E+9,998E+6 ; initial 0.0; end component ; component meas_set_thr_def ; type integer ; set actions ; output string ":MEAS:DEF THR," ; SELECT meas_thr_units ; CASE PCT ; output "PERC," ; output meas_thr_upp_pct FORMAT 'K,","' ; output meas_thr_mid_pct FORMAT 'K,","' ; output meas_thr_low_pct FORMAT 'K' ; CASE UNITS ; output "VOLT," ; output meas_thr_upp_volts FORMAT 'K,","' ; output meas_thr_mid_volts FORMAT 'K,","' ; output meas_thr_low_volts FORMAT 'K' ; END SELECT ; IF RECALLING THEN ; ELSE ; GET meas_set_thr_def ; END IF ; end actions ; get actions ; if livemode then ; output string ":MEAS:DEF? THR" ; enter charstring format "#,AAAAAAAAAAA" ; ! read , also enter charstring format "#,AAAAAAAA" ; ! thank goodness STANDARD is 8, the others 7 SELECT charstring ; CASE "STANDARD" ; enter charstring format K ; CASE ELSE ; FETCH CHARSTRING ; FETCH "PERCENT" ; POS ; IF STACK THEN ; enter meas_thr_upp_pct format "#,K" ; enter meas_thr_mid_pct format "#,K" ; enter meas_thr_low_pct format "K" ; ELSE ; enter meas_thr_upp_volts format "#,K" ; enter meas_thr_mid_volts format "#,K" ; enter meas_thr_low_volts format "K" ; END IF ; END SELECT ; end if ; end actions ; end component ; component meas_tbase_std ; type integer ; set actions ; output string ":MEAS:DEF TOPB,STAN" ; GET meas_set_tbase_def ; end actions ; end component ; component meas_tbase_tvolts ; type continuous ; values range -999E+6,1E+9 ; initial 5 ; end component ; component meas_tbase_bvolts ; type continuous ; values range -1E+9,999E+6 ; initial 0 ; end component ; component meas_set_tbase_def ; type integer ; set actions ; output string ":MEAS:DEF TOPB," ; output meas_tbase_tvolts FORMAT 'K,","' ; output meas_tbase_bvolts FORMAT 'K' ; IF RECALLING THEN ; ELSE ; GET meas_set_tbase_def ; END IF ; end actions ; get actions ; if livemode then ; output string ":MEAS:DEF? TOPB" ; enter charstring format "#,AAAAAAAA" ; enter charstring format "#,K" ; SELECT CHARSTRING ; CASE "CALCULATED" ; ! Rev 1.18 CASE "STANDARD" ; ! Rev 2.02 CASE ELSE ; FETCH CHARSTRING ; DUP ; DUP; FETCH "," ; POS; DUP; STORE NUM_BUFFER ; FETCH 1;SUB ;FETCH 1;SWAP;SUBSTR ;val ;store meas_tbase_tvolts ; DUP;DUP;LENGTH ;FETCH NUM_BUFFER ;SUB;STORE NUM_BUFFER ; FETCH "," ;POS ;FETCH 1 ;ADD ;FETCH NUM_BUFFER ; SUBSTR ; VAL ; store meas_tbase_bvolts ; END SELECT ; end if ; end actions ; end component ; ACTIONS Fix_Meas_Sources ; Get Meas_source ; END ACTIONS ; !=============================== ! Limit Test Subsystem !=============================== COMPONENT Limit_Stat ; TYPE DISCRETE ; VALUES OFF,ON ; INITIAL OFF ; SET ACTIONS ; OUTPUT Limit_Stat TABLE ":LTES:TEST OFF", ":LTES:TEST ON" ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":LTES:TEST?" ; ENTER Limit_Stat FORMAT 'K' ; END ACTIONS ; END COMPONENT ; COMPONENT Limit_Source ; TYPE DISCRETE ; VALUES NONE,ONE,TWO,THREE,FOUR; INITIAL NONE ; SET ACTIONS ; OUTPUT Limit_Source TABLE "",":LTES:SOUR 1",":LTES:SOUR 2",":LTES:SOUR 3",":LTES:SOUR 4" ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":LTES:SOUR?" ; ENTER STACK FORMAT 'K' ; SELECT STACK ; CASE 1 ; IF Meas_param1 THEN ; FETCH (Limit_Source) ONE ; ELSE ; IF PANELMODE THEN ; NOTIFY "No Measurement Selected" ; END IF ; END IF ; CASE 2 ; FETCH (Limit_Source) TWO ; CASE 3 ; FETCH (Limit_Source) THREE ; CASE 4 ; FETCH (Limit_Source) FOUR ; CASE ELSE ; FETCH Limit_Source ; NOTIFY "BAD CASE IN Limit_Source" ; END SELECT ; STORE Limit_Source ; END IF ; END ACTIONS ; END COMPONENT ; ACTIONS Enable_Limit_Source ; IF Meas_param1 THEN ; ENABLE Limit_Source,ONE ; END IF ; IF Meas_param2 THEN ; ENABLE Limit_Source,TWO ; END IF ; IF Meas_param3 THEN ; ENABLE Limit_Source,THREE ; END IF ; IF Meas_param4 THEN ; ENABLE Limit_Source,FOUR ; END IF ; END ACTIONS ; ACTIONS Disable_Limit_Source ; FETCH ( Limit_Source ) NONE ; STORE Limit_Source ; DISABLE Limit_Source,ONE,TWO,THREE,FOUR ; GOSUB Disable_Meas_params ; END ACTIONS ; COMPONENT Limit_Failc_1 ; TYPE DISCRETE ; VALUES INS,OUT,ALW,NEV ; INITIAL OUT ; SET ACTIONS ; OUTPUT DEFAULT TABLE ":LTES:FAIL INS",":LTES:FAIL OUTS",":LTES:FAIL ALW",":LTES:FAIL NEV"; SELECT Limit_Source ; CASE NONE ; CASE ONE ; GET Limit_Mnf_1 ; CASE TWO ; GET Limit_Mnf_2 ; CASE THREE; GET Limit_Mnf_3 ; CASE FOUR ; GET Limit_Mnf_4 ; END SELECT ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":LTES:FAIL?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "INS" ; FETCH (Limit_Failc_1) INS ; CASE "OUTS" ; FETCH (Limit_Failc_1) OUT ; CASE "ALW" ; FETCH (Limit_Failc_1) ALW ; CASE "NEV" ; FETCH (Limit_Failc_1) NEV ; CASE ELSE ; FETCH DEFAULT ; NOTIFY "BAD CASE IN Limit_Failc" ; END SELECT ; STORE DEFAULT ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Limit_Failc_2 CLONE Limit_Failc_1 ; COMPONENT Limit_Failc_3 CLONE Limit_Failc_1 ; COMPONENT Limit_Failc_4 CLONE Limit_Failc_1 ; COMPONENT Limit_Mnf_1 ; TYPE DISCRETE ; VALUES Fail,Pass,Ignore ; INITIAL Fail ; SET ACTIONS ; OUTPUT DEFAULT TABLE ":LTES:MNF FAIL",":LTES:MNF PASS",":LTES:MNF IGN"; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":LTES:MNF?" ; ENTER CHARSTRING FORMAT 'K' ; SELECT CHARSTRING ; CASE "FAIL" ; FETCH (Limit_Mnf_1) FAIL ; CASE "PASS" ; FETCH (Limit_Mnf_1) PASS ; CASE "IGN" ; FETCH (Limit_Mnf_1) IGNORE ; CASE ELSE ; FETCH DEFAULT ; NOTIFY "BAD CASE IN Limit_Mnf" ; END SELECT ; STORE DEFAULT ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Limit_Mnf_2 CLONE Limit_Mnf_1 ; COMPONENT Limit_Mnf_3 CLONE Limit_Mnf_1 ; COMPONENT Limit_Mnf_4 CLONE Limit_Mnf_1 ; COMPONENT Limit_Ulimit_1 ; TYPE CONTINUOUS ; !VALUES RANGE ; INITIAL 10 ; SET ACTIONS ; OUTPUT DEFAULT FORMAT '":LTES:ULIM ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":LTES:ULIM?" ; ENTER DEFAULT FORMAT 'K' ; END ACTIONS ; END COMPONENT ; COMPONENT Limit_Llimit_1 ; TYPE CONTINUOUS ; !VALUES RANGE ; INITIAL -10 ; SET ACTIONS ; OUTPUT DEFAULT FORMAT '":LTES:LLIM ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":LTES:LLIM?" ; ENTER DEFAULT FORMAT 'K' ; END ACTIONS ; END COMPONENT ; COMPONENT Limit_Ulimit_2 CLONE Limit_Ulimit_1 ; COMPONENT Limit_Ulimit_3 CLONE Limit_Ulimit_1 ; COMPONENT Limit_Ulimit_4 CLONE Limit_Ulimit_1 ; COMPONENT Limit_Llimit_2 CLONE Limit_Llimit_1 ; COMPONENT Limit_Llimit_3 CLONE Limit_Llimit_1 ; COMPONENT Limit_Llimit_4 CLONE Limit_Llimit_1 ; COMPONENT Limit_Run ; TYPE DISCRETE ; VALUES FOR,FAIL,WAV ; INITIAL FOR ; SET ACTIONS ; OUTPUT Limit_Run TABLE ":LTES:RUN FOR",":LTES:RUN FAIL, ",":LTES:RUN WAV, "; SELECT Limit_Run ; CASE FOR ; CASE FAIL ; OUTPUT Total_Fail FORMAT 'K' ; CASE WAV ; OUTPUT Max_Waveform FORMAT 'K' ; END SELECT ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":LTES:RUN?" ; ENTER CHARSTRING FORMAT '#,AAA' ; SELECT CHARSTRING ; CASE "FOR" ; FETCH (Limit_Run) FOR ; ENTER CHARSTRING FORMAT '#,A' ; CASE "FAI" ; FETCH (Limit_Run) FAIL ; ENTER CHARSTRING FORMAT '#,A' ; ENTER Total_Fail FORMAT '#,K' ; CASE "WAV" ; FETCH (Limit_Run) WAV ; ENTER Max_Waveform FORMAT '#,K' ; CASE ELSE ; FETCH Limit_Run ; NOTIFY "BAD CASE IN Limit_Run" ; END SELECT ; STORE Limit_Run ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Total_Fail; TYPE CONTINUOUS ; !VALUES RANGE INITIAL 1; SET ACTIONS; SET Limit_Run ; END ACTIONS; GET ACTIONS; GET limit_Run ; END ACTIONS; END COMPONENT; COMPONENT Max_Waveform ; TYPE CONTINUOUS ; !VALUES RANGE INITIAL 1000000; SET ACTIONS; SET Limit_Run ; END ACTIONS; GET ACTIONS; GET limit_Run ; END ACTIONS; END COMPONENT; COMPONENT Limit_fail_1 ; TYPE CONTINUOUS ; INITIAL INVALID ; get actions; end actions; END COMPONENT ; COMPONENT Limit_status_1 ; TYPE DISCRETE ; VALUES PASS,HIGH,LOW,INS,OTH ; INITIAL INVALID ; get actions; end actions; END COMPONENT ; COMPONENT Limit_total_1 CLONE Limit_fail_1 ; COMPONENT Limit_fail_2 CLONE Limit_fail_1 ; COMPONENT Limit_total_2 CLONE Limit_fail_1 ; COMPONENT Limit_status_2 CLONE Limit_status_1 ; COMPONENT Limit_fail_3 CLONE Limit_fail_1 ; COMPONENT Limit_total_3 CLONE Limit_fail_1 ; COMPONENT Limit_status_3 CLONE Limit_status_1 ; COMPONENT Limit_fail_4 CLONE Limit_fail_1 ; COMPONENT Limit_status_4 CLONE Limit_status_1 ; COMPONENT Limit_total_4 CLONE Limit_fail_1 ; ACTIONS Invalidate_Limit_Results ; INVALIDATE Limit_status_1 ; INVALIDATE Limit_total_1 ; INVALIDATE Limit_fail_1 ; INVALIDATE Limit_status_2 ; INVALIDATE Limit_total_2 ; INVALIDATE Limit_fail_2 ; INVALIDATE Limit_status_3 ; INVALIDATE Limit_total_3 ; INVALIDATE Limit_fail_3 ; INVALIDATE Limit_status_4 ; INVALIDATE Limit_total_4 ; INVALIDATE Limit_fail_4 ; END ACTIONS ; COMPONENT Get_Limit_Results ; TYPE INTEGER ; SET ACTIONS ; IF Limit_Source THEN ; output string "*SRE?"; enter STACK format 'K'; ! Save SRE output string ":OPEE?"; enter STACK format 'K'; ! Save OPEE output string "*CLS;*SRE 128;:OPEE 256"; flush; OUTPUT STRING ":LTEST:SSUM:FORM BRI;" ; FETCH 1 ; STORE Limit_Stat ; SET Limit_Stat ; FETCH 0 ; STORE Result_OK ; if livemode then ; if Limit_Run THEN ; LOOP ; wait spoll bit 7; OUTPUT STRING ":LTER?" ; ENTER STACK FORMAT 'K' ; FETCH 0 ; BIT ; EXIT IF STACK ; END LOOP ; else ; NOTIFY "Limit Results may not be valid in RUN FOREVER" ; end if ; end if ; OUTPUT STRING ":OPER?" ; ENTER STACK FORMAT 'K'; DROP ; OUTPUT STACK FORMAT '";*CLS;:OPEE ",K,";"' ; ! restore OPEE OUTPUT STACK FORMAT '";*SRE ",K,";"' ; ! restore SRE OUTPUT STRING ":MEAS:RES?" ; IF Meas_param1 THEN ; ENTER STACK FORMAT '#,K' ; FETCH Meas_param1 ; GOSUB Store_meas_result ; ENTER Limit_fail_1 FORMAT '#,K' ; ENTER Limit_total_1 FORMAT '#,K' ; ENTER STACK FORMAT '#,K' ; GOSUB Work_Around ; IF Result_OK THEN ; STORE Limit_status_1 ; ELSE ; DROP ; END IF ; !ENTER Limit_status_1 FORMAT '#,K' ; END IF ; IF Meas_param2 THEN ; ENTER STACK FORMAT '#,K' ; FETCH Meas_param2 ; GOSUB Store_meas_result ; ENTER Limit_fail_2 FORMAT '#,K' ; ENTER Limit_total_2 FORMAT '#,K' ; ENTER STACK FORMAT '#,K' ; GOSUB Work_Around ; IF Result_OK THEN ; STORE Limit_status_2 ; ELSE ; DROP ; END IF ; !ENTER Limit_status_2 FORMAT '#,K' ; END IF ; IF Meas_param3 THEN ; ENTER STACK FORMAT '#,K' ; FETCH Meas_param3 ; GOSUB Store_meas_result ; ENTER Limit_fail_3 FORMAT '#,K' ; ENTER Limit_total_3 FORMAT '#,K' ; ENTER STACK FORMAT '#,K' ; GOSUB Work_Around ; IF Result_OK THEN ; STORE Limit_status_3 ; ELSE ; DROP ; END IF ; !ENTER Limit_status_3 FORMAT '#,K' ; END IF ; IF Meas_param4 THEN ; ENTER STACK FORMAT '#,K' ; FETCH Meas_param4 ; GOSUB Store_meas_result ; ENTER Limit_fail_4 FORMAT '#,K' ; ENTER Limit_total_4 FORMAT '#,K' ; ENTER STACK FORMAT '#,K' ; GOSUB Work_Around ; IF Result_OK THEN ; STORE Limit_status_4 ; ELSE ; DROP ; END IF ; !ENTER Limit_status_4 FORMAT '#,K' ; END IF ; FETCH 0 ; STORE Limit_Stat ; SET Limit_Stat ; NOTIFY "It is advisable to cycle power on the instrument" ; ELSE ; NOTIFY "Select Measurement On Which to Perform Limit Testing" ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Result_OK ; TYPE INTEGER ; INITIAL 0 ; END COMPONENT ; ACTIONS Work_Around ; DUP ; SELECT STACK ; CASE 0 ; FETCH 1 ; STORE Result_OK ; CASE 1 ; FETCH 1 ; STORE Result_OK ; CASE 2 ; FETCH 1 ; STORE Result_OK ; CASE 3 ; FETCH 1 ; STORE Result_OK ; CASE 4 ; FETCH 1 ; STORE Result_OK ; CASE ELSE ; FETCH 0 ; STORE Result_OK ; IF PANELMODE THEN ; NOTIFY "Error Being Returned !!!!" ; END IF ; END SELECT ; END ACTIONS ; !============================== ! Function subsystem ! !============================== ! COMPONENT Function NOERRCHECK; TYPE DISCRETE ; VALUES Function1, Function2; INITIAL Function1; PANEL SET ACTIONS; HIDE Math_subsystem,Function1; HIDE Math_subsystem,Function2; SELECT Function; CASE Function1; SHOW Math_subsystem,Function1; CASE Function2; SHOW Math_subsystem,Function2; END SELECT; END ACTIONS; END COMPONENT; COMPONENT Fn1_display; ! turn fn1 off/on TYPE DISCRETE ; VALUES Off,On; INITIAL Off; SET ACTIONS; !OUTPUT Fn1_display TABLE ":BLAN ",":VIEW "; !OUTPUT STRING "FUNC1;"; FLUSH ; OUTPUT Fn1_display TABLE ":FUNC1:DISP OFF",":FUNC1:DISP ON" ; !GET Fn1_display ; flush ; output string ";*WAI" ; output string ";*CLS;*SRE 32;*ESE 1"; flush; output string "*OPC"; flush ; ! *OPC - does the setting of bit if livemode then; wait spoll bit 5; end if; SELECT Fn1_display ; CASE On ; GET Fn1_hoz_pos ; GET Fn1_hoz_range ; GET Fn1_offset; !can't be coupled actions because needed by waveform GET Fn1_range; GET VMIN_FN1; GET VMAX_FN1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2; CASE Off ; END SELECT ; END ACTIONS; ! check it out - a whole lot of get and panel set actions to be incl PANEL SET ACTIONS; IF FN1_DISPLAY THEN; GET WF_FUNC1; END IF; END ACTIONS; GET ACTIONS ; OUTPUT STRING ":FUNC1:DISP?" ; ENTER Fn1_display FORMAT K ; END ACTIONS ; END COMPONENT; COMPONENT Fn1_operand1 NOERRCHECK; ! CAUTION - do not change order of discrete comps TYPE DISCRETE ; VALUES Channel1, Channel2, Channel3, Channel4,WM1,WM2,WM3,WM4,CONST; INITIAL Channel1; PANEL SET ACTIONS ; SET UNITS_FN1_DISP ; FETCH Function1 ; FETCH 12 ; EQ ; ! Fetch ( Function1 ) FFtm ; IF STACK THEN ; GOSUB Get_FFT1_Ranges ; END IF ; FETCH Fn1_operand1 ; FETCH (Fn1_operand1) CONST ; EQ ; IF STACK THEN ; SHOW Fn1_constant_1 ; SHOW Fn1_constant_text ; ELSE ; HIDE Fn1_constant_1 ; FETCH Fn1_operand2 ; FETCH 8 ; EQ ; IF STACK THEN ; SHOW Fn1_constant_text ; ELSE ; HIDE Fn1_constant_text ; END IF ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT Fn1_operand2 NOERRCHECK; ! CAUTION - do not change order of discrete comps TYPE DISCRETE ; VALUES Channel1, Channel2, Channel3, Channel4,WM1,WM2,WM3,WM4,CONST; INITIAL Channel1; PANEL SET ACTIONS ; SET UNITS_FN1_DISP ; FETCH Fn1_operand2 ; FETCH (Fn1_operand2) CONST ; EQ ; IF STACK THEN ; SHOW Fn1_constant_2 ; SHOW Fn1_constant_text ; ELSE ; HIDE Fn1_constant_2 ; FETCH Fn1_operand1 ; FETCH (Fn1_operand1) CONST ; EQ ; IF STACK THEN ; SHOW Fn1_constant_text ; ELSE ; HIDE Fn1_constant_text ; END IF ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT Fn1_Constant1 ; TYPE CONTINUOUS ; INITIAL 0 ; END COMPONENT ; COMPONENT Fn1_Constant2 CLONE Fn1_Constant1 ; COMPONENT Function1 NOERRCHECK; ! FFT - check it out TYPE DISCRETE ; VALUES '+','-','*','/',Invert,Integrate,Differentiate,Max,Min,Magnify,Versus,FFTm; ! check it out - more discrete comps in Jay's driver INITIAL Magnify ; PANEL SET ACTIONS; SELECT Function1; ! only '+', '-' and Versus values have two operands. CASE '+'; SHOW Function1,Fn1_operand_panel; HIDE Function1,Fn1_FFTFn_Panel; CASE '-'; SHOW Function1,Fn1_operand_panel; HIDE Function1,Fn1_FFTFn_Panel; CASE '*'; SHOW Function1,Fn1_operand_panel; HIDE Function1,Fn1_FFTFn_Panel; CASE '/'; SHOW Function1,Fn1_operand_panel; CASE Versus; SHOW Function1,Fn1_operand_panel; HIDE Function1,Fn1_FFTFn_Panel; CASE FFTm; HIDE Function1,Fn1_operand_panel; !hide the second operand SHOW Function1,Fn1_FFTFn_Panel; GOSUB Get_FFT1_Ranges ; CASE ELSE; HIDE Function1,Fn1_operand_panel; !hide the second operand HIDE Function1,Fn1_FFTFn_Panel; END SELECT; END ACTIONS; END COMPONENT; COMPONENT Fn1_range; TYPE CONTINUOUS ; VALUES RANGE 100E-18,10E+15; !,0.001E-3; ! takes care of all possible values INITIAL 8E+00; COUPLED VMIN_FN1,VMAX_FN1,Fn1_range,Fn1_ver_tracking, VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2 ; ! Fn1_offset; SET ACTIONS; FETCH Fn1_range; FETCH 8; MUL; OUTPUT STACK FORMAT '":FUNC1:RANG ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC1:RANG?"; ENTER STACK FORMAT K; FETCH 8; DIV; STORE Fn1_range; END ACTIONS; END COMPONENT; COMPONENT Fn1_offset; TYPE CONTINUOUS ; VALUES RANGE -10E15,10E15; ! 0.125E-3; ! all possible values INITIAL 0.0; COUPLED VMIN_FN1,VMAX_FN1,Fn1_ver_tracking, VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2; ! ,Fn1_offset; SET ACTIONS; OUTPUT Fn1_offset FORMAT '":FUNC1:OFFS ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC1:OFFS?"; ENTER Fn1_offset FORMAT K; END ACTIONS; END COMPONENT; COMPONENT Fn1_hoz_tracking ; TYPE DISCRETE ; VALUES TSOURCE,MANUAL ; INITIAL TSOURCE ; COUPLED Fn1_hoz_range, Fn1_hoz_pos,MARKER_X1_MIN,MARKER_X1_MAX,MARKER_X2_MIN,MARKER_X2_MAX ; SET ACTIONS ; OUTPUT Fn1_hoz_tracking TABLE ":FUNC1:HOR TSO",":FUNC1:HOR MAN" ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":FUNC1:HOR?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "TSO" ; FETCH (Fn1_hoz_tracking) TSOURCE ; CASE "MAN" ; FETCH (Fn1_hoz_tracking) MANUAL ; CASE ELSE ; FETCH Fn1_hoz_tracking ; NOTIFY "BAD CASE IN Fn1_hoz_tracking" ; END SELECT ; STORE Fn1_hoz_tracking ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Fn1_hoz_pos ; TYPE CONTINUOUS ; VALUES RANGE -1E+12,1E+12; INITIAL 0; COUPLED Fn1_hoz_tracking ,MARKER_X1_MIN,MARKER_X1_MAX,MARKER_X2_MIN,MARKER_X2_MAX; SET ACTIONS; OUTPUT Fn1_hoz_pos FORMAT '":FUNC1:HOR:POS ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC1:HOR:POS?" ; ENTER Fn1_hoz_pos FORMAT K; END ACTIONS; END COMPONENT; COMPONENT Fn1_hoz_range ; TYPE CONTINUOUS ; VALUES RANGE 1E-12,1E+12; INITIAL 100; COUPLED Fn1_hoz_tracking,MARKER_X1_MIN,MARKER_X1_MAX,MARKER_X2_MIN,MARKER_X2_MAX ; SET ACTIONS; FETCH Fn1_hoz_range; FETCH 10; MUL; OUTPUT STACK FORMAT '":FUNC1:HOR:RANG ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC1:HOR:RANG?"; ENTER STACK FORMAT K; FETCH 10; DIV; STORE Fn1_hoz_range; END ACTIONS; END COMPONENT; COMPONENT Fn1_ver_tracking ; TYPE DISCRETE ; VALUES TSOURCE,MANUAL ; INITIAL TSOURCE ; COUPLED Fn1_range, Fn1_offset; SET ACTIONS ; OUTPUT Fn1_ver_tracking TABLE ":FUNC1:VERT TSO",":FUNC1:VERT MAN" ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":FUNC1:VERT?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "TSO" ; FETCH (Fn1_ver_tracking) TSOURCE ; CASE "MAN" ; FETCH (Fn1_ver_tracking) MANUAL ; CASE ELSE ; FETCH Fn1_ver_tracking ; NOTIFY "BAD CASE IN Fn1_ver_tracking" ; END SELECT ; STORE Fn1_ver_tracking ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT VMIN_FN1 NOERRCHECK; TYPE CONTINUOUS; INITIAL -640E-3; GET ACTIONS; ! offset-range/2 ... FETCH Fn1_offset; FETCH Fn1_range; FETCH 4; MUL; SUB; STORE VMIN_FN1; END ACTIONS; END COMPONENT; COMPONENT VMAX_FN1 NOERRCHECK; TYPE CONTINUOUS; INITIAL 640E-3; GET ACTIONS; ! offset+range/2 ... FETCH Fn1_offset; FETCH Fn1_range; FETCH 4 ; MUL; ADD ; STORE VMAX_FN1; END ACTIONS; END COMPONENT; COMPONENT Define_function1 NOTSAVED; TYPE INTEGER; !coupled Fn1_range,Fn1_offset,VMIN_FN1,VMAX_FN1; SET ACTIONS; OUTPUT STRING ":FUNC1:"; OUTPUT Function1 TABLE "ADD ","SUBT ","MULT ","DIV ","INV ","INT ","DIFF ","MAX ","MIN ","MAGN ", "VERS ","FFTM "; SELECT Fn1_Operand1 ; CASE CONST ; OUTPUT Fn1_Constant1 FORMAT K ; CASE ELSE ; OUTPUT Fn1_Operand1 TABLE "CHAN1","CHAN2","CHAN3","CHAN4", "WMEM1","WMEM2","WMEM3","WMEM4",""; END SELECT ; SELECT Function1; CASE Magnify; CASE Integrate ; CASE Differentiate ; CASE Invert ; CASE Max; CASE Min; CASE FFTm ; CASE ELSE; ! for +,- and Vs, send the 2nd operand also SELECT Fn1_Operand2 ; CASE CONST ; OUTPUT Fn1_Constant2 FORMAT '",",K' ; CASE ELSE ; OUTPUT Fn1_operand2 TABLE ",CHAN1",",CHAN2",",CHAN3",",CHAN4", ",WMEM1",",WMEM2",",WMEM3",",WMEM4",""; END SELECT ; END SELECT; flush ; OUTPUT STRING ";*WAI" ; output string ";*CLS;*SRE 32;*ESE 1"; flush; output string "*OPC"; flush ; ! *OPC - does the setting of bit if livemode then; wait spoll bit 5; end if; !can't be coupled actions because needed by waveform GET Fn1_hoz_pos ; GET Fn1_hoz_range ; GET Fn1_offset; GET Fn1_range; GET VMIN_FN1; GET VMAX_FN1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2; END ACTIONS; PANEL SET ACTIONS; SET UNITS_FN1_DISP ; SET X_AXIS_UNITS ; IF FN1_DISPLAY THEN; GET WF_FUNC1; END IF; END ACTIONS; END COMPONENT; !************************************************************************ ! FFT Function !************************************************************************ COMPONENT FN1_FFT_Show NOTSAVED NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF ON; INITIAL OFF; PANEL SET ACTIONS; SELECT FN1_FFT_Show; CASE OFF; HIDE Function1,FFT1_Controls; SHOW Function1,FN1_Norm_ctrls; CASE ON; HIDE Function1,FN1_Norm_ctrls; SHOW Function1,FFT1_Controls; END SELECT; END ACTIONS; END COMPONENT; COMPONENT FFT1_Magnify; TYPE DISCRETE; VALUES OFF ON; INITIAL OFF; SET ACTIONS; OUTPUT FFT1_Magnify TABLE "FUNC1:FFT:MAGN OFF" "FUNC1:FFT:MAGN ON"; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC1:FFT:MAGN?"; ENTER FFT1_Magnify format K; END ACTIONS; END COMPONENT; COMPONENT FFT1_MSpan; TYPE CONTINUOUS; !VALUES RANGE ???????; INITIAL INVALID; COUPLED FFT1_MSpan,FFT1_Center_freq,FFT1_Span,FFT1_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT1_Span FORMAT '"FUNC1:FFT:MSPAN ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC1:FFT:MSPAN?"; ENTER FFT1_MSpan FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT1_Center_freq; TYPE CONTINUOUS; !VALUES RANGE 0 FFT1_Max_cf; INITIAL INVALID; COUPLED FFT1_MSpan,FFT1_Center_freq,FFT1_Span,FFT1_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT1_Center_freq FORMAT '"FUNC1:FFT:FREQ ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC1:FFT:FREQ?"; ENTER FFT1_Center_freq FORMAT K; END ACTIONS; END COMPONENT; ACTIONS Get_FFT1_Ranges ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; ! VALUES Channel1, Channel2, Channel3, Channel4,WM1,WM2,WM3,WM4,CONST; SELECT Fn1_operand1 ; CASE Channel1 ; FETCH Plug_in1 ; GOSUB FFT1_Plug_In ; CASE Channel2 ; FETCH Plug_in2 ; GOSUB FFT1_Plug_In ; CASE Channel3 ; FETCH Plug_in3 ; GOSUB FFT1_Plug_In ; CASE Channel4 ; FETCH Plug_in4 ; GOSUB FFT1_Plug_In ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS FFT1_Plug_In ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; SELECT STACK ; CASE 0 ; CASE 1 ; GOSUB Get_FFT1_Range_11A ; CASE 2 ; GOSUB Get_FFT1_Range_12A ; CASE 3 ; GOSUB Get_FFT1_Range_13A ; CASE 4 ; GOSUB Get_FFT1_Range_21A ; CASE 5 ; GOSUB Get_FFT1_Range_22A ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS Get_FFT1_Range_11A ; FETCH 1E+9 ; STORE Max_FFT1_Span ; END ACTIONS ; ACTIONS Get_FFT1_Range_12A ; FETCH 1E+9 ; STORE Max_FFT1_Span ; END ACTIONS ; ACTIONS Get_FFT1_Range_13A ; FETCH 1E+9 ; STORE Max_FFT1_Span ; END ACTIONS ; ACTIONS Get_FFT1_Range_21A ; FETCH 2E+9 ; STORE Max_FFT1_Span ; END ACTIONS ; ACTIONS Get_FFT1_Range_22A ; FETCH 4E+9 ; STORE Max_FFT1_Span ; END ACTIONS ; COMPONENT Max_FFT1_Span ; TYPE CONTINUOUS ; END COMPONENT ; COMPONENT FFT1_Span; TYPE CONTINUOUS; VALUES RANGE 50,Max_FFT1_Span; INITIAL INVALID; COUPLED FFT1_MSpan,FFT1_Center_freq,FFT1_Span,FFT1_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT1_Span FORMAT '"FUNC1:FFT:SPAN ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC1:FFT:SPAN?"; ENTER FFT1_Span FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT1_Resolution; TYPE CONTINUOUS; !VALUES RANGE 5,500E6; INITIAL INVALID; COUPLED FFT1_MSpan,FFT1_Center_freq,FFT1_Span,FFT1_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT1_Resolution FORMAT '"FUNC1:FFT:RES ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC1:FFT:RES?"; ENTER FFT1_Resolution FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT1_Window; TYPE DISCRETE; VALUES Rect, Hanning, Flattop; INITIAL Hanning; SET Actions; OUTPUT STRING "FUNC1:FFT:WIND "; OUTPUT FFT1_Window TABLE "RECT" "HANN" "FLAT"; END ACTIONS; GET Actions; OUTPUT STRING "FUNC1:FFT:WIND?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "RECT"; FETCH (FFT1_Window)Rect; CASE "HANN"; FETCH (FFT1_Window)Hanning; CASE "FLAT"; FETCH (FFT1_Window)Flattop; CASE ELSE; FETCH FFT1_Window; END SELECT; STORE FFT1_Window; END ACTIONS; END COMPONENT; !**************************** Function 1 FFT components *************** ! This has to be done after instrument arrives - take Jay's help !************************************************************************ COMPONENT Fn2_display; ! turn fn2 off/on TYPE DISCRETE ; VALUES Off,On; INITIAL Off; SET ACTIONS; !OUTPUT Fn2_display TABLE ":BLAN ",":VIEW "; !OUTPUT STRING "FUNC2;"; FLUSH ; OUTPUT Fn2_display TABLE ":FUNC2:DISP OFF",":FUNC2:DISP ON" ; !GET Fn2_display ; flush ; output string ";*WAI" ; output string ";*CLS;*SRE 32;*ESE 1"; flush; output string "*OPC"; flush ; ! *OPC - does the setting of bit if livemode then; wait spoll bit 5; end if; SELECT Fn2_display ; CASE On ; GET Fn2_offset; !can't be coupled actions because needed by waveform GET Fn2_range; GET Fn2_hoz_range ; GET Fn2_hoz_pos ; GET VMIN_FN2; GET VMAX_FN2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2; CASE Off ; END SELECT ; END ACTIONS; PANEL SET ACTIONS; IF FN2_DISPLAY THEN; GET WF_FUNC2; END IF; END ACTIONS; GET ACTIONS ; OUTPUT STRING ":FUNC2:DISP?" ; ENTER Fn2_display FORMAT K ; END ACTIONS ; END COMPONENT; COMPONENT Function2 NOERRCHECK; TYPE DISCRETE ; VALUES '+','-','*','/',Invert,Integrate,Differentiate,Max,Min,Magnify,Versus,FFTm; INITIAL Magnify; PANEL SET ACTIONS; SELECT Function2; CASE '+'; HIDE Function2,Fn2_FFTFn_Panel; SHOW Function2,Fn2_operand_panel; CASE '-'; HIDE Function2,Fn2_FFTFn_Panel; SHOW Function2,Fn2_operand_panel; CASE '*'; HIDE Function2,Fn2_FFTFn_Panel; SHOW Function2,Fn2_operand_panel; CASE '/'; HIDE Function2,Fn2_FFTFn_Panel; SHOW Function2,Fn2_operand_panel; CASE Versus; HIDE Function2,Fn2_FFTFn_Panel; SHOW Function2,Fn2_operand_panel; CASE FFTm; HIDE Function2,Fn2_operand_panel; !hide the second operand SHOW Function2,Fn2_FFTFn_Panel; GOSUB Get_FFT2_Ranges ; CASE ELSE; HIDE Function2,Fn2_FFTFn_Panel; HIDE Function2,Fn2_operand_panel; END SELECT; END ACTIONS; END COMPONENT; COMPONENT Fn2_operand1 NOERRCHECK; ! CAUTION - do not change order of discrete comps TYPE DISCRETE ; VALUES Channel1, Channel2, Channel3, Channel4,Func1,WM1,WM2,WM3,WM4,CONST; INITIAL Channel1; PANEL SET ACTIONS ; SET UNITS_FN2_DISP ; FETCH Function2 ; FETCH 12 ; EQ ; ! Fetch ( Function1 ) FFtm ; IF STACK THEN ; GOSUB Get_FFT2_Ranges ; END IF ; FETCH Fn2_operand1 ; FETCH (Fn2_operand1) CONST ; EQ ; IF STACK THEN ; SHOW Fn2_constant_1 ; SHOW Fn2_constant_text ; ELSE ; HIDE Fn2_constant_1 ; FETCH Fn2_operand2 ; FETCH 8 ; EQ ; IF STACK THEN ; SHOW Fn2_constant_text ; ELSE ; HIDE Fn2_constant_text ; END IF ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT Fn2_operand2 NOERRCHECK; ! CAUTION - do not change order of discrete comps TYPE DISCRETE ; VALUES Channel1, Channel2, Channel3, Channel4,Func1,WM1,WM2,WM3,WM4,CONST; INITIAL Channel1; PANEL SET ACTIONS ; SET UNITS_FN2_DISP ; FETCH Fn2_operand2 ; FETCH (Fn2_operand2) CONST ; EQ ; IF STACK THEN ; SHOW Fn2_constant_2 ; SHOW Fn2_constant_text ; ELSE ; HIDE Fn2_constant_2 ; FETCH Fn2_operand1 ; FETCH (Fn2_operand1) CONST ; EQ ; IF STACK THEN ; SHOW Fn2_constant_text ; ELSE ; HIDE Fn2_constant_text ; END IF ; END IF ; END ACTIONS ; END COMPONENT; COMPONENT Fn2_Constant1 CLONE Fn1_Constant1 ; COMPONENT Fn2_Constant2 CLONE Fn1_Constant1 ; COMPONENT Fn2_range; TYPE CONTINUOUS ; VALUES RANGE 100E-18,10E+15; !,0.001E-3; ! takes care of all possible values INITIAL 8E+00; COUPLED VMIN_FN2,VMAX_FN2,Fn2_range,Fn2_ver_tracking, VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2; !,Fn2_offset; SET ACTIONS; FETCH Fn2_range; FETCH 8; MUL; OUTPUT STACK FORMAT '":FUNC2:RANG ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC2:RANG?"; ENTER STACK FORMAT K; FETCH 8; DIV; STORE Fn2_range; END ACTIONS; END COMPONENT; COMPONENT Fn2_offset; TYPE CONTINUOUS ; VALUES RANGE -10E15,10E15; ! 0.125E-3; ! all possible values INITIAL 0.0; COUPLED VMIN_FN2,VMAX_FN2,Fn2_offset,Fn2_ver_tracking, VMIN_MSMT1,VMIN_MSMT2,VMAX_MSMT1,VMAX_MSMT2; SET ACTIONS; OUTPUT Fn2_offset FORMAT '":FUNC2:OFFS ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC2:OFFS?"; ENTER Fn2_offset FORMAT K; END ACTIONS; END COMPONENT; COMPONENT Fn2_hoz_tracking ; TYPE DISCRETE ; VALUES TSOURCE,MANUAL ; INITIAL TSOURCE ; COUPLED Fn2_hoz_pos, Fn2_hoz_range ,MARKER_X1_MIN,MARKER_X1_MAX,MARKER_X2_MIN,MARKER_X2_MAX; SET ACTIONS ; OUTPUT Fn2_hoz_tracking TABLE ":FUNC2:HOR TSO",":FUNC2:HOR MAN" ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":FUNC2:HOR?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "TSO" ; FETCH (Fn2_hoz_tracking) TSOURCE ; CASE "MAN" ; FETCH (Fn2_hoz_tracking) MANUAL ; CASE ELSE ; FETCH Fn2_hoz_tracking ; NOTIFY "BAD CASE IN Fn2_hoz_tracking" ; END SELECT ; STORE Fn2_hoz_tracking ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT Fn2_hoz_pos ; TYPE CONTINUOUS ; VALUES RANGE -1E+12,1E+12; INITIAL 0; COUPLED Fn2_hoz_tracking,MARKER_X1_MIN,MARKER_X1_MAX,MARKER_X2_MIN,MARKER_X2_MAX ; SET ACTIONS; OUTPUT Fn2_hoz_pos FORMAT '":FUNC2:HOR:POS ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC2:HOR:POS?" ; ENTER Fn2_hoz_pos FORMAT K; END ACTIONS; END COMPONENT; COMPONENT Fn2_hoz_range ; TYPE CONTINUOUS ; VALUES RANGE 1E-12,1E+12; INITIAL 100; COUPLED Fn2_hoz_tracking,MARKER_X1_MIN,MARKER_X1_MAX,MARKER_X2_MIN,MARKER_X2_MAX ; SET ACTIONS; FETCH Fn2_hoz_range; FETCH 10; MUL; OUTPUT STACK FORMAT '":FUNC2:HOR:RANG ",K'; END ACTIONS; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS; OUTPUT STRING ":FUNC2:HOR:RANG?"; ENTER STACK FORMAT K; FETCH 10; DIV; STORE Fn2_hoz_range; END ACTIONS; END COMPONENT; COMPONENT Fn2_ver_tracking ; TYPE DISCRETE ; VALUES TSOURCE,MANUAL ; INITIAL TSOURCE ; COUPLED Fn2_range, Fn2_offset ; SET ACTIONS ; OUTPUT Fn2_ver_tracking TABLE ":FUNC2:VERT TSO",":FUNC2:VERT MAN" ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":FUNC2:VERT?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "TSO" ; FETCH (Fn2_ver_tracking) TSOURCE ; CASE "MAN" ; FETCH (Fn2_ver_tracking) MANUAL ; CASE ELSE ; FETCH Fn2_ver_tracking ; NOTIFY "BAD CASE IN Fn2_ver_tracking" ; END SELECT ; STORE Fn2_ver_tracking ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT VMIN_FN2 NOERRCHECK; TYPE CONTINUOUS; INITIAL -640E-3; GET ACTIONS; ! offset-range/2 ... FETCH Fn2_offset; FETCH Fn2_range; FETCH 4; MUL; SUB; STORE VMIN_FN2; END ACTIONS; END COMPONENT; COMPONENT VMAX_FN2 NOERRCHECK; TYPE CONTINUOUS; INITIAL 640E-3; GET ACTIONS; ! offset+range/2 ... FETCH Fn2_offset; FETCH Fn2_range; FETCH 4 ; MUL; ADD; STORE VMAX_FN2; END ACTIONS; END COMPONENT; COMPONENT Define_function2 NOTSAVED; TYPE INTEGER; !coupled Fn2_range,Fn2_offset,VMIN_FN2,VMAX_FN2; SET ACTIONS; OUTPUT STRING ":FUNC2:"; OUTPUT Function2 TABLE "ADD ","SUBT ","MULT ","DIV ","INV ","INT ","DIFF ","MAX ","MIN ","MAGN ","VERS ","FFTM "; SELECT Fn2_Operand1 ; CASE CONST ; OUTPUT Fn2_Constant1 FORMAT K ; CASE ELSE ; OUTPUT Fn2_Operand1 TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1", "WMEM1","WMEM2","WMEM3","WMEM4",""; END SELECT ; SELECT Function2; CASE Magnify; CASE Integrate ; CASE Differentiate ; CASE Invert ; CASE Max; CASE Min; CASE FFTm; CASE ELSE; ! for +,- and Vs, send the 2nd operand also SELECT Fn2_Operand2 ; CASE CONST ; OUTPUT Fn2_Constant2 FORMAT '",",K' ; CASE ELSE ; OUTPUT Fn2_operand2 TABLE ",CHAN1",",CHAN2",",CHAN3",",CHAN4",",FUNC1", ",WMEM1",",WMEM2",",WMEM3",",WMEM4",""; END SELECT ; END SELECT; flush ; output string ";*WAI" ; output string ";*CLS;*SRE 32;*ESE 1"; flush; output string "*OPC"; flush ; ! *OPC - does the setting of bit if livemode then; wait spoll bit 5; end if; !can't be coupled actions because needed by waveform GET Fn2_offset; GET Fn2_range ; GET Fn2_hoz_pos ; GET Fn2_hoz_range ; GET VMIN_FN2; GET VMAX_FN2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2; END ACTIONS; PANEL SET ACTIONS; SET UNITS_FN2_DISP ; SET X_AXIS_UNITS ; IF FN2_DISPLAY THEN; GET WF_FUNC2; END IF; END ACTIONS; END COMPONENT; !************************************************************************ ! FFT Function !************************************************************************ COMPONENT FN2_FFT_Show NOTSAVED NOGEN NOERRCHECK; TYPE DISCRETE; VALUES OFF ON; INITIAL OFF; PANEL SET ACTIONS; SELECT FN2_FFT_Show; CASE OFF; HIDE Function2,FFT2_Controls; SHOW Function2,FN2_Norm_ctrls; CASE ON; HIDE Function2,FN2_Norm_ctrls; SHOW Function2,FFT2_Controls; END SELECT; END ACTIONS; END COMPONENT; COMPONENT FFT2_Magnify; TYPE DISCRETE; VALUES OFF ON; INITIAL OFF; SET ACTIONS; OUTPUT FFT2_Magnify TABLE "FUNC2:FFT:MAGN OFF" "FUNC2:FFT:MAGN ON"; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC2:FFT:MAGN?"; ENTER FFT2_Magnify format K; END ACTIONS; END COMPONENT; COMPONENT FFT2_MSpan; TYPE CONTINUOUS; !VALUES RANGE ???????; INITIAL INVALID; COUPLED FFT2_MSpan,FFT2_Center_freq,FFT2_Span,FFT2_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT2_Span FORMAT '"FUNC2:FFT:MSPAN ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC2:FFT:MSPAN?"; ENTER FFT2_MSpan FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT2_Center_freq; TYPE CONTINUOUS; !VALUES RANGE 0 FFT1_Max_cf; INITIAL INVALID; COUPLED FFT2_MSpan,FFT2_Center_freq,FFT2_Span,FFT2_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT2_Center_freq FORMAT '"FUNC2:FFT:FREQ ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC2:FFT:FREQ?"; ENTER FFT2_Center_freq FORMAT K; END ACTIONS; END COMPONENT; ACTIONS Get_FFT2_Ranges ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; ! VALUES Channel1, Channel2, Channel3, Channel4,WM1,WM2,WM3,WM4,CONST; SELECT Fn2_operand2 ; CASE Channel1 ; FETCH Plug_in1 ; GOSUB FFT2_Plug_In ; CASE Channel2 ; FETCH Plug_in2 ; GOSUB FFT2_Plug_In ; CASE Channel3 ; FETCH Plug_in3 ; GOSUB FFT2_Plug_In ; CASE Channel4 ; FETCH Plug_in4 ; GOSUB FFT2_Plug_In ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS FFT2_Plug_In ; ! Plug_in values EMPTY,HP54711A,HP54712A,HP54713A,HP54721A; SELECT STACK ; CASE 0 ; CASE 1 ; GOSUB Get_FFT2_Range_11A ; CASE 2 ; GOSUB Get_FFT2_Range_12A ; CASE 3 ; GOSUB Get_FFT2_Range_13A ; CASE 4 ; GOSUB Get_FFT2_Range_21A ; CASE ELSE ; END SELECT ; END ACTIONS ; ACTIONS Get_FFT2_Range_11A ; FETCH 1E+9 ; STORE Max_FFT2_Span ; END ACTIONS ; ACTIONS Get_FFT2_Range_12A ; FETCH 1E+9 ; STORE Max_FFT2_Span ; END ACTIONS ; ACTIONS Get_FFT2_Range_13A ; FETCH 1E+9 ; STORE Max_FFT2_Span ; END ACTIONS ; ACTIONS Get_FFT2_Range_21A ; FETCH 2E+9 ; STORE Max_FFT2_Span ; END ACTIONS ; COMPONENT Max_FFT2_Span ; TYPE CONTINUOUS ; END COMPONENT ; COMPONENT FFT2_Span; TYPE CONTINUOUS; VALUES RANGE 50,Max_FFT2_Span; INITIAL INVALID; COUPLED FFT2_MSpan,FFT2_Center_freq,FFT2_Span,FFT2_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT2_Span FORMAT '"FUNC2:FFT:SPAN ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC2:FFT:SPAN?"; ENTER FFT2_Span FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT2_Resolution; TYPE CONTINUOUS; !VALUES RANGE 5,500E6; INITIAL INVALID; COUPLED FFT2_MSpan,FFT2_Center_freq,FFT2_Span,FFT2_Resolution; SET ACTIONS; GOSUB Set_Display_Ready_Bit ; OUTPUT FFT2_Resolution FORMAT '"FUNC2:FFT:RES ",K'; GOSUB Get_Display_Ready_Bit ; END ACTIONS; GET ACTIONS; OUTPUT STRING "FUNC2:FFT:RES?"; ENTER FFT2_Resolution FORMAT K; END ACTIONS; END COMPONENT; COMPONENT FFT2_Window; TYPE DISCRETE; VALUES Rect, Hanning, Flattop; INITIAL Hanning; SET Actions; OUTPUT STRING "FUNC2:FFT:WIND "; OUTPUT FFT2_Window TABLE "RECT" "HANN" "FLAT"; END ACTIONS; GET Actions; OUTPUT STRING "FUNC2:FFT:WIND?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "RECT"; FETCH (FFT2_Window)Rect; CASE "HANN"; FETCH (FFT2_Window)Hanning; CASE "FLAT"; FETCH (FFT2_Window)Flattop; CASE ELSE; FETCH FFT2_Window; END SELECT; STORE FFT2_Window; END ACTIONS; END COMPONENT; COMPONENT UNITS_FN1_DISP ; ! check it out - get a better algorithm TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; SET ACTIONS ; FETCH (Function1) FFTm ; FETCH Function1 ; EQ ; IF STACK THEN ; FETCH (UNITS_FN1_DISP ) DB ; STORE UNITS_FN1_DISP ; ELSE ; SELECT Fn1_operand1 ; CASE Channel1 ; FETCH UNITS_CH1_DISP ; CASE Channel2 ; FETCH UNITS_CH2_DISP ; CASE Channel3 ; FETCH UNITS_CH3_DISP ; CASE Channel4 ; FETCH UNITS_CH4_DISP ; CASE WM1 ; FETCH UNITS_WM1_DISP ; CASE WM2 ; FETCH UNITS_WM2_DISP ; CASE WM3 ; FETCH UNITS_WM3_DISP ; CASE WM4 ; FETCH UNITS_WM4_DISP ; CASE CONST; SELECT Function1 ; CASE '+' ; GOSUB Get_Units_Fn1_Operand2 ; CASE '-' ; GOSUB Get_Units_Fn1_Operand2 ; CASE '/' ; GOSUB Get_Units_Fn1_Operand2 ; CASE '*' ; GOSUB Get_Units_Fn1_Operand2 ; CASE Versus ; GOSUB Get_Units_Fn1_Operand2 ; CASE ELSE ; FETCH UNITS_FN1_DISP ; END SELECT ; END SELECT ; STORE UNITS_FN1_DISP ; END IF ; END ACTIONS ; END COMPONENT ; ACTIONS Get_Units_Fn1_Operand2 ; SELECT Fn1_operand2 ; CASE Channel1 ; FETCH UNITS_CH1_DISP ; CASE Channel2 ; FETCH UNITS_CH2_DISP ; CASE Channel3 ; FETCH UNITS_CH3_DISP ; CASE Channel4 ; FETCH UNITS_CH4_DISP ; CASE WM1 ; FETCH UNITS_WM1_DISP ; CASE WM2 ; FETCH UNITS_WM2_DISP ; CASE WM3 ; FETCH UNITS_WM3_DISP ; CASE WM4 ; FETCH UNITS_WM4_DISP ; CASE CONST; FETCH UNITS_FN1_DISP ; END SELECT ; END ACTIONS ; COMPONENT Fn1_store_wm1 notsaved; TYPE integer; set actions; if Fn1_display then; ! otherwise instrument does not save - what peculiarities !! !output string ":STORE:WAV FUNC1,WMEM1"; ! GOK what purpose this serves !! OUTPUT STRING ":WMEM1:SAVE FUNC1" ; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_FN1; STORE VMIN_WM1; FETCH VMAX_FN1; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM1 THEN; ! get wf_WM1; !end if; FETCH (SOURCE_WM1)FUNC1; STORE SOURCE_WM1; FETCH UNITS_FN1_DISP ; STORE UNITS_WM1_DISP ; SELECT Function1 ; CASE FFTm ; FETCH 1 ; STORE WM1_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM1_X_Axis_Units ; END SELECT ; FETCH Fn1_hoz_range ;STORE WM1_TIME_SENS ; FETCH Fn1_hoz_pos ; STORE WM1_TIME_DELAY ; FETCH TIME_REF ; STORE WM1_TIME_REF ; FETCH Fn1_range ; STORE WM1_SENS ; FETCH Fn1_offset ; STORE WM1_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM1; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT Fn1_store_wm2 notsaved; TYPE integer; set actions; if Fn1_display then; !output string ":STORE:WAV FUNC1,WMEM2"; OUTPUT STRING ":WMEM2:SAVE FUNC1" ; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM2; get X_MIN; fetch X_MIN; store XMIN_WM2; FETCH VMIN_FN1; STORE VMIN_WM2; FETCH VMAX_FN1; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM2 THEN; ! get wf_WM2; !end if; FETCH (SOURCE_WM2)FUNC1; STORE SOURCE_WM2; FETCH UNITS_FN1_DISP ; STORE UNITS_WM2_DISP ; SELECT Function1 ; CASE FFTm ; FETCH 1 ; STORE WM2_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM2_X_Axis_Units ; END SELECT ; FETCH Fn1_hoz_range ;STORE WM2_TIME_SENS ; FETCH Fn1_hoz_pos ; STORE WM2_TIME_DELAY ; FETCH TIME_REF ; STORE WM2_TIME_REF ; FETCH Fn1_range ; STORE WM2_SENS ; FETCH Fn1_offset ; STORE WM2_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM2; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT Fn1_store_wm3 notsaved; TYPE integer; set actions; if Fn1_display then; !output string ":STORE:WAV FUNC1,WMEM3"; OUTPUT STRING ":WMEM3:SAVE FUNC1" ; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM3; get X_MIN; fetch X_MIN; store XMIN_WM3; FETCH VMIN_FN1; STORE VMIN_WM3; FETCH VMAX_FN1; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM3 THEN; ! get wf_WM3; !end if; FETCH (SOURCE_WM3)FUNC1; STORE SOURCE_WM3; FETCH UNITS_FN1_DISP ; STORE UNITS_WM3_DISP ; SELECT Function1 ; CASE FFTm ; FETCH 1 ; STORE WM3_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM3_X_Axis_Units ; END SELECT ; FETCH Fn1_hoz_range ;STORE WM3_TIME_SENS ; FETCH Fn1_hoz_pos ; STORE WM3_TIME_DELAY ; FETCH TIME_REF ; STORE WM3_TIME_REF ; FETCH Fn1_range ; STORE WM3_SENS ; FETCH Fn1_offset ; STORE WM3_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM3; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT Fn1_store_wm4 notsaved; TYPE integer; set actions; if Fn1_display then; !output string ":STORE:WAV FUNC1,WMEM4"; OUTPUT STRING ":WMEM4:SAVE FUNC1" ; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM4; get X_MIN; fetch X_MIN; store XMIN_WM4; FETCH VMIN_FN1; STORE VMIN_WM4; FETCH VMAX_FN1; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM1 THEN; ! get wf_WM4; !end if; FETCH (SOURCE_WM4)FUNC1; STORE SOURCE_WM4; FETCH UNITS_FN1_DISP ; STORE UNITS_WM4_DISP ; SELECT Function1 ; CASE FFTm ; FETCH 1 ; STORE WM4_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM4_X_Axis_Units ; END SELECT ; FETCH Fn1_hoz_range ;STORE WM4_TIME_SENS ; FETCH Fn1_hoz_pos ; STORE WM4_TIME_DELAY ; FETCH TIME_REF ; STORE WM4_TIME_REF ; FETCH Fn1_range ; STORE WM4_SENS ; FETCH Fn1_offset ; STORE WM4_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM4; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; COMPONENT UNITS_FN2_DISP ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; SET ACTIONS ; FETCH (Function2) FFTm ; FETCH Function2 ; EQ ; IF STACK THEN ; FETCH (UNITS_FN2_DISP ) DB ; STORE UNITS_FN2_DISP ; ELSE ; SELECT Fn2_operand1 ; CASE Channel1 ; FETCH UNITS_CH1_DISP ; CASE Channel2 ; FETCH UNITS_CH2_DISP ; CASE Channel3 ; FETCH UNITS_CH3_DISP ; CASE Channel4 ; FETCH UNITS_CH4_DISP ; CASE Func1 ; FETCH UNITS_FN1_DISP ; CASE WM1 ; FETCH UNITS_WM1_DISP ; CASE WM2 ; FETCH UNITS_WM2_DISP ; CASE WM3 ; FETCH UNITS_WM3_DISP ; CASE WM4 ; FETCH UNITS_WM4_DISP ; CASE CONST; SELECT Function1 ; CASE '+' ; GOSUB Get_Units_Fn2_Operand2 ; CASE '-' ; GOSUB Get_Units_Fn2_Operand2 ; CASE '/' ; GOSUB Get_Units_Fn2_Operand2 ; CASE '*' ; GOSUB Get_Units_Fn2_Operand2 ; CASE Versus ; GOSUB Get_Units_Fn2_Operand2 ; CASE ELSE ; FETCH UNITS_FN2_DISP ; END SELECT ; END SELECT ; STORE UNITS_FN2_DISP ; END IF ; END ACTIONS ; END COMPONENT ; ACTIONS Get_Units_Fn2_Operand2 ; SELECT Fn2_operand2 ; CASE Channel1 ; FETCH UNITS_CH1_DISP ; CASE Channel2 ; FETCH UNITS_CH2_DISP ; CASE Channel3 ; FETCH UNITS_CH3_DISP ; CASE Channel4 ; FETCH UNITS_CH4_DISP ; CASE Func1 ; FETCH UNITS_FN1_DISP ; CASE WM1 ; FETCH UNITS_WM1_DISP ; CASE WM2 ; FETCH UNITS_WM2_DISP ; CASE WM3 ; FETCH UNITS_WM3_DISP ; CASE WM4 ; FETCH UNITS_WM4_DISP ; CASE CONST; FETCH UNITS_FN2_DISP ; END SELECT ; END ACTIONS ; COMPONENT Fn2_store_wm1 notsaved; TYPE integer; set actions; if Fn2_display then; !output string ":STORE:WAV FUNC2,WMEM1"; OUTPUT STRING ":WMEM1:SAVE FUNC2" ; FETCH 1 ; STORE WM1_OK ; get X_INC; fetch X_INC; store XINC_WM1; get X_MIN; fetch X_MIN; store XMIN_WM1; FETCH VMIN_FN2; STORE VMIN_WM1; FETCH VMAX_FN2; STORE VMAX_WM1; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM1 THEN; ! get wf_WM1; !end if; FETCH (SOURCE_WM1)FUNC2; STORE SOURCE_WM1; FETCH UNITS_FN2_DISP ; STORE UNITS_WM1_DISP ; SELECT Function2 ; CASE FFTm ; FETCH 1 ; STORE WM1_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM1_X_Axis_Units ; END SELECT ; FETCH Fn2_hoz_range ;STORE WM1_TIME_SENS ; FETCH Fn2_hoz_pos ; STORE WM1_TIME_DELAY ; FETCH TIME_REF ; STORE WM1_TIME_REF ; FETCH Fn2_range ; STORE WM1_SENS ; FETCH Fn2_offset ; STORE WM1_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM1; IF VIEW_WF_WM1 THEN ; GET WF_WM1; END IF ; END ACTIONS; END COMPONENT; COMPONENT Fn2_store_wm2 notsaved; TYPE integer; set actions; if Fn2_display then; !output string ":STORE:WAV FUNC2,WMEM2"; OUTPUT STRING ":WMEM2:SAVE FUNC2" ; FETCH 1 ; STORE WM2_OK ; get X_INC; fetch X_INC; store XINC_WM2; get X_MIN; fetch X_MIN; store XMIN_WM2; FETCH VMIN_FN2; STORE VMIN_WM2; FETCH VMAX_FN2; STORE VMAX_WM2; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM2 THEN; ! get wf_WM2; !end if; FETCH (SOURCE_WM2)FUNC2; STORE SOURCE_WM2; FETCH UNITS_FN2_DISP ; STORE UNITS_WM2_DISP ; SELECT Function2 ; CASE FFTm ; FETCH 1 ; STORE WM2_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM2_X_Axis_Units ; END SELECT ; FETCH Fn2_hoz_range ;STORE WM2_TIME_SENS ; FETCH Fn2_hoz_pos ; STORE WM2_TIME_DELAY ; FETCH TIME_REF ; STORE WM2_TIME_REF ; FETCH Fn2_range ; STORE WM2_SENS ; FETCH Fn2_offset ; STORE WM2_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM2; IF VIEW_WF_WM2 THEN ; GET WF_WM2; END IF ; END ACTIONS; END COMPONENT; COMPONENT Fn2_store_wm3 notsaved; TYPE integer; set actions; if Fn2_display then; !output string ":STORE:WAV FUNC2,WMEM3"; OUTPUT STRING ":WMEM3:SAVE FUNC2" ; FETCH 1 ; STORE WM3_OK ; get X_INC; fetch X_INC; store XINC_WM3; get X_MIN; fetch X_MIN; store XMIN_WM3; FETCH VMIN_FN2; STORE VMIN_WM3; FETCH VMAX_FN2; STORE VMAX_WM3; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM3 THEN; ! get wf_WM3; !end if; FETCH (SOURCE_WM3)FUNC2; STORE SOURCE_WM3; FETCH UNITS_FN2_DISP ; STORE UNITS_WM3_DISP ; SELECT Function2 ; CASE FFTm ; FETCH 1 ; STORE WM3_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM3_X_Axis_Units ; END SELECT ; FETCH Fn2_hoz_range ;STORE WM3_TIME_SENS ; FETCH Fn2_hoz_pos ; STORE WM3_TIME_DELAY ; FETCH TIME_REF ; STORE WM3_TIME_REF ; FETCH Fn2_range ; STORE WM3_SENS ; FETCH Fn2_offset ; STORE WM3_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM3; IF VIEW_WF_WM3 THEN ; GET WF_WM3; END IF ; END ACTIONS; END COMPONENT; COMPONENT Fn2_store_wm4 notsaved; TYPE integer; set actions; if Fn2_display then; !output string ":STORE:WAV FUNC2,WMEM4"; OUTPUT STRING ":WMEM4:SAVE FUNC2" ; FETCH 1 ; STORE WM4_OK ; get X_INC; fetch X_INC; store XINC_WM4; get X_MIN; fetch X_MIN; store XMIN_WM4; FETCH VMIN_FN2; STORE VMIN_WM4; FETCH VMAX_FN2; STORE VMAX_WM4; GET VMIN_MSMT1; GET VMIN_MSMT2; GET VMAX_MSMT1; GET VMAX_MSMT2 ; !If VIEW_WF_WM4 THEN; ! get wf_WM4; !end if; FETCH (SOURCE_WM4)FUNC2; STORE SOURCE_WM4; FETCH UNITS_FN2_DISP ; STORE UNITS_WM4_DISP ; SELECT Function2 ; CASE FFTm ; FETCH 1 ; STORE WM4_X_Axis_Units ; CASE ELSE ; FETCH 0 ; STORE WM4_X_Axis_Units ; END SELECT ; FETCH Fn2_hoz_range ;STORE WM4_TIME_SENS ; FETCH Fn2_hoz_pos ; STORE WM4_TIME_DELAY ; FETCH TIME_REF ; STORE WM4_TIME_REF ; FETCH Fn2_range ; STORE WM4_SENS ; FETCH Fn2_offset ; STORE WM4_OFFSET ; else; if panelmode then; notify "Must turn ON the Function Display"; end if; end if; end actions; PANEL SET ACTIONS; !FETCH 1; STORE VIEW_WF_WM4; IF VIEW_WF_WM4 THEN ; GET WF_WM4; END IF ; END ACTIONS; END COMPONENT; ACTIONS Fix_Function_Operands ; IF Plug_in1 THEN ; ELSE ; IF Plug_in2 THEN ; FETCH ( Fn1_operand1 ) Channel2 ; DUP ; DUP ; DUP ; STORE Fn1_operand1 ; STORE Fn1_operand2 ; STORE Fn2_operand1 ; STORE Fn2_operand2 ; ELSE ; IF Plug_in3 THEN ; FETCH ( Fn1_operand1 ) Channel3 ; DUP ; DUP ; DUP ; STORE Fn1_operand1 ; STORE Fn1_operand2 ; STORE Fn2_operand1 ; STORE Fn2_operand2 ; ELSE ; IF Plug_in4 THEN ; FETCH ( Fn1_operand1 ) Channel4 ; DUP ; DUP ; DUP ; STORE Fn1_operand1 ; STORE Fn1_operand2 ; STORE Fn2_operand1 ; STORE Fn2_operand2 ; ELSE ; FETCH ( Fn1_operand1 ) WM1 ; DUP ; STORE Fn1_operand1 ; STORE Fn1_operand2 ; FETCH ( Fn2_operand1 ) Func1 ; DUP ; STORE Fn2_operand1 ; STORE Fn2_operand2 ; END IF ; END IF ; END IF ; END IF ; END ACTIONS ; !============================== ! MARKER SUBSYSTEM !============================== COMPONENT MARKER_MODE ; TYPE DISCRETE ; VALUES OFF, MANUAL, WAVEFORM, MEAS ; INITIAL MEAS ; COUPLED VMIN_MSMT1, VMAX_MSMT1, VMIN_MSMT2, VMAX_MSMT2 ; SET ACTIONS ; OUTPUT MARKER_MODE TABLE ":MARK:MODE OFF",":MARK:MODE MAN", ":MARK:MODE WAV",":MARK:MODE MEAS" ; END ACTIONS ; PANEL SET ACTIONS ; SELECT MARKER_MODE ; CASE OFF ; FETCH 0 ; DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; CASE MANUAL ; FETCH 1 ; DUP ; DUP ;STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; GOSUB UPDATE_MARKER_VALUES ; CASE WAVEFORM ; FETCH 0 ; DUP ; DUP ;STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 1 ; STORE MARKER_STATE_WAV ; GOSUB UPDATE_MARKER_VALUES ; CASE MEAS ; FETCH 0 ; STORE MARKER_STATE_MAN ; FETCH 1 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; GOSUB UPDATE_MARKER_VALUES ; END SELECT ; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":MARK:MODE?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "OFF" ; FETCH ( MARKER_MODE ) OFF ; CASE "MAN" ; FETCH ( MARKER_MODE ) MANUAL ; CASE "WAV" ; FETCH ( MARKER_MODE ) WAVEFORM ; CASE "MEAS"; FETCH ( MARKER_MODE ) MEAS ; CASE ELSE ; NOTIFY "BAD CASE IN MARKER_MODE" ; FETCH MARKER_MODE ; END SELECT ; STORE MARKER_MODE ; END IF ; END ACTIONS ; PANEL GET ACTIONS ; SELECT MARKER_MODE ; CASE OFF ; FETCH 0 ; DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; CASE MANUAL ; FETCH 1 ; DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; GOSUB UPDATE_MARKER_VALUES ; CASE WAVEFORM ; FETCH 0 ;DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 1 ; STORE MARKER_STATE_WAV ; GOSUB UPDATE_MARKER_VALUES ; CASE MEAS ; FETCH 0 ; STORE MARKER_STATE_MAN ; FETCH 1 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; GOSUB UPDATE_MARKER_VALUES ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_READOUT ; TYPE DISCRETE ; VALUES OFF, ON; INITIAL OFF ; SET ACTIONS ; OUTPUT MARKER_READOUT TABLE ":MARK:MEAS:READ OFF",":MARK:MEAS:READ ON"; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":MARK:MEAS:READ?" ; ENTER MARKER_READOUT FORMAT K ; ! Rev 2.02 !ENTER CHARSTRING FORMAT K ; ! Rev 1.18 !SELECT CHARSTRING ; ! CASE 'OFF' ; FETCH ( MARKER_READOUT ) OFF ; ! CASE 'ON' ; FETCH ( MARKER_READOUT ) ON ; ! CASE ELSE ; FETCH MARKER_READOUT ; ! NOTIFY "Bad CASE in SELECT Comp MARKER_READOUT " ; !END SELECT ; !STORE MARKER_READOUT ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_X1Y1_SRC ; TYPE DISCRETE ; VALUES CH1,CH2,CH3,CH4,FN1,FN2,FFT,WM1,WM2,WM3,WM4 ; INITIAL CH1 ; COUPLED VMIN_MSMT1, VMAX_MSMT1, MARKER_X1_MIN, MARKER_X1_MAX ; SET ACTIONS ; OUTPUT STRING ":MARK:X1Y1 " ; OUTPUT MARKER_X1Y1_SRC TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; SET MARKER_DISP_UNITS_1 ; SET X_AXIS_UNITS ; END ACTIONS ; PANEL SET ACTIONS UPDATE_MARKER_VALUES ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":MARK:X1Y1?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "CHAN1" ; FETCH ( MARKER_X1Y1_SRC ) CH1 ; CASE "CHAN2" ; FETCH ( MARKER_X1Y1_SRC ) CH2 ; CASE "CHAN3" ; FETCH ( MARKER_X1Y1_SRC ) CH3 ; CASE "CHAN4" ; FETCH ( MARKER_X1Y1_SRC ) CH4 ; CASE "FUNC1" ; FETCH ( MARKER_X1Y1_SRC ) FN1 ; CASE "FUNC2" ; FETCH ( MARKER_X1Y1_SRC ) FN2 ; CASE "FFT" ; FETCH ( MARKER_X1Y1_SRC ) FFT ; CASE "WMEM1" ; FETCH ( MARKER_X1Y1_SRC ) WM1 ; CASE "WMEM2" ; FETCH ( MARKER_X1Y1_SRC ) WM2 ; CASE "WMEM3" ; FETCH ( MARKER_X1Y1_SRC ) WM3 ; CASE "WMEM4" ; FETCH ( MARKER_X1Y1_SRC ) WM4 ; CASe ELSE ; FETCH MARKER_X1Y1_SRC ; NOTIFY "Bad CASE in SELECT Comp MARKER_X1Y1_SRC " ; END SELECT ; STORE MARKER_X1Y1_SRC ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_X2Y2_SRC ; TYPE DISCRETE ; VALUES CH1,CH2,CH3,CH4,FN1,FN2,FFT,WM1,WM2,WM3,WM4 ; INITIAL CH1 ; COUPLED VMIN_MSMT2, VMAX_MSMT2,MARKER_X2_MIN, MARKER_X2_MAX ; SET ACTIONS ; OUTPUT STRING ":MARK:X2Y2 " ; OUTPUT MARKER_X2Y2_SRC TABLE "CHAN1","CHAN2","CHAN3","CHAN4","FUNC1","FUNC2","FFT", "WMEM1","WMEM2","WMEM3","WMEM4"; SET MARKER_DISP_UNITS_2 ; SET X_AXIS_UNITS ; END ACTIONS ; PANEL SET ACTIONS UPDATE_MARKER_VALUES ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":MARK:X2Y2?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "CHAN1" ; FETCH ( MARKER_X2Y2_SRC ) CH1 ; CASE "CHAN2" ; FETCH ( MARKER_X2Y2_SRC ) CH2 ; CASE "CHAN3" ; FETCH ( MARKER_X2Y2_SRC ) CH3 ; CASE "CHAN4" ; FETCH ( MARKER_X2Y2_SRC ) CH4 ; CASE "FUNC1" ; FETCH ( MARKER_X2Y2_SRC ) FN1 ; CASE "FUNC2" ; FETCH ( MARKER_X2Y2_SRC ) FN2 ; CASE "FFT" ; FETCH ( MARKER_X2Y2_SRC ) FFT ; CASE "WMEM1" ; FETCH ( MARKER_X2Y2_SRC ) WM1 ; CASE "WMEM2" ; FETCH ( MARKER_X2Y2_SRC ) WM2 ; CASE "WMEM3" ; FETCH ( MARKER_X2Y2_SRC ) WM3 ; CASE "WMEM4" ; FETCH ( MARKER_X2Y2_SRC ) WM4 ; CASe ELSE ; FETCH MARKER_X2Y2_SRC ; NOTIFY "Bad CASE in SELECT Comp MARKER_X2Y2_SRC " ; END SELECT ; STORE MARKER_X2Y2_SRC ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_DISP_UNITS_1 NOGEN ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; SET ACTIONS ; SELECT MARKER_X1Y1_SRC ; CASE CH1 ; FETCH UNITS_CH1_DISP ; CASE CH2 ; FETCH UNITS_CH2_DISP ; CASE CH3 ; FETCH UNITS_CH3_DISP ; CASE CH4 ; FETCH UNITS_CH4_DISP ; CASE FN1 ; FETCH UNITS_FN1_DISP ; CASE FN2 ; FETCH UNITS_FN2_DISP ; CASE FFT ; FETCH (MARKER_DISP_UNITS_1) DB ; CASE WM1 ; FETCH UNITS_WM1_DISP ; CASE WM2 ; FETCH UNITS_WM2_DISP ; CASE WM3 ; FETCH UNITS_WM3_DISP ; CASE WM4 ; FETCH UNITS_WM4_DISP ; END SELECT ; STORE MARKER_DISP_UNITS_1 ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_DISP_UNITS_2 NOGEN ; TYPE DISCRETE ; VALUES VOLT,AMP,WATT,UNKN,DB ; INITIAL VOLT ; SET ACTIONS ; SELECT MARKER_X2Y2_SRC ; CASE CH1 ; FETCH UNITS_CH1_DISP ; CASE CH2 ; FETCH UNITS_CH2_DISP ; CASE CH3 ; FETCH UNITS_CH3_DISP ; CASE CH4 ; FETCH UNITS_CH4_DISP ; CASE FN1 ; FETCH UNITS_FN1_DISP ; CASE FN2 ; FETCH UNITS_FN2_DISP ; CASE FFT ; FETCH (MARKER_DISP_UNITS_2) DB ; CASE WM1 ; FETCH UNITS_WM1_DISP ; CASE WM2 ; FETCH UNITS_WM2_DISP ; CASE WM3 ; FETCH UNITS_WM3_DISP ; CASE WM4 ; FETCH UNITS_WM4_DISP ; END SELECT ; STORE MARKER_DISP_UNITS_2 ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_STATE_MAN ; TYPE INTEGER ; INITIAL 0 ; END COMPONENT ; COMPONENT MARKER_STATE_MEAS ; TYPE INTEGER ; INITIAL 1 ; END COMPONENT ; COMPONENT MARKER_STATE_WAV ; TYPE INTEGER ; INITIAL 0 ; END COMPONENT ; COMPONENT MARKER_STATE_HOR ; TYPE INTEGER ; INITIAL 0 ; END COMPONENT ; COMPONENT MARKER_STATE_VER ; TYPE INTEGER ; INITIAL 0 ; END COMPONENT ; COMPONENT VMIN_MSMT1 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL -4; ! same as 'vmin_ch1' ... GET ACTIONS; FETCH MARKER_MODE ; FETCH ( MARKER_MODE ) WAVEFORM ; EQ ; IF STACK THEN ; FETCH MARKER_Y1_POS ; STORE VMIN_MSMT1 ; ELSE ; SELECT MARKER_X1Y1_SRC; CASE CH1; FETCH VMIN_CH1; CASE CH2; FETCH VMIN_CH2; CASE CH3; FETCH VMIN_CH3; CASE CH4; FETCH VMIN_CH4; CASE WM1; FETCH VMIN_WM1; CASE WM2; FETCH VMIN_WM2; CASE WM3; FETCH VMIN_WM3; CASE WM4; FETCH VMIN_WM4; CASE FN1; FETCH VMIN_FN1; CASE FN2; FETCH VMIN_FN2; CASE FFT; FETCH VMIN_FFT; CASE ELSE; FETCH -4; ! a well-disguised 'punt' for now ... END SELECT; STORE VMIN_MSMT1; END IF ; END ACTIONS; END COMPONENT; COMPONENT VMAX_MSMT1 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 4; ! same as 'vmax_ch1' ... GET ACTIONS; FETCH MARKER_MODE ; FETCH ( MARKER_MODE ) WAVEFORM ; EQ ; IF STACK THEN ; FETCH MARKER_Y1_POS ; STORE VMAX_MSMT1 ; ELSE ; SELECT MARKER_X1Y1_SRC ; CASE CH1; FETCH VMAX_CH1; CASE CH2; FETCH VMAX_CH2; CASE CH3; FETCH VMAX_CH3; CASE CH4; FETCH VMAX_CH4; CASE WM1; FETCH VMAX_WM1; CASE WM2; FETCH VMAX_WM2; CASE WM3; FETCH VMAX_WM3; CASE WM4; FETCH VMAX_WM4; CASE FN1; FETCH VMAX_FN1; CASE FN2; FETCH VMAX_FN2; CASE FFT; FETCH VMAX_FFT; CASE ELSE; FETCH 4; ! a well-disguised 'punt' for now ... END SELECT; STORE VMAX_MSMT1; END IF ; END ACTIONS; END COMPONENT; COMPONENT VMIN_MSMT2 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL -4; ! same as 'vmin_ch1' ... GET ACTIONS; FETCH MARKER_MODE ; FETCH ( MARKER_MODE ) WAVEFORM ; EQ ; IF STACK THEN ; FETCH MARKER_Y2_POS ; STORE VMIN_MSMT2 ; ELSE ; SELECT MARKER_X2Y2_SRC ; CASE CH1; FETCH VMIN_CH1; CASE CH2; FETCH VMIN_CH2; CASE CH3; FETCH VMIN_CH3; CASE CH4; FETCH VMIN_CH4; CASE WM1; FETCH VMIN_WM1; CASE WM2; FETCH VMIN_WM2; CASE WM3; FETCH VMIN_WM3; CASE WM4; FETCH VMIN_WM4; CASE FN1; FETCH VMIN_FN1; CASE FN2; FETCH VMIN_FN2; CASE FFT; FETCH VMIN_FFT; CASE ELSE; FETCH -4; ! a well-disguised 'punt' for now ... END SELECT; STORE VMIN_MSMT2; END IF ; END ACTIONS; END COMPONENT; COMPONENT VMAX_MSMT2 NOGEN NOERRCHECK; TYPE CONTINUOUS; INITIAL 4; ! same as 'vmax_ch1' ... GET ACTIONS; FETCH MARKER_MODE ; FETCH ( MARKER_MODE ) WAVEFORM ; EQ ; IF STACK THEN ; FETCH MARKER_Y2_POS ; STORE VMAX_MSMT2 ; ELSE ; SELECT MARKER_X2Y2_SRC ; CASE CH1; FETCH VMAX_CH1; CASE CH2; FETCH VMAX_CH2; CASE CH3; FETCH VMAX_CH3; CASE CH4; FETCH VMAX_CH4; CASE WM1; FETCH VMAX_WM1; CASE WM2; FETCH VMAX_WM2; CASE WM3; FETCH VMAX_WM3; CASE WM4; FETCH VMAX_WM4; CASE FN1; FETCH VMAX_FN1; CASE FN2; FETCH VMAX_FN2; CASE FFT; FETCH VMAX_FFT; CASE ELSE; FETCH 4; ! a well-disguised 'punt' for now ... END SELECT; STORE VMAX_MSMT2; END IF ; END ACTIONS; END COMPONENT; COMPONENT MARKER_X1_MIN ; TYPE CONTINUOUS ; INITIAL -100E-6; GET ACTIONS ; SELECT MARKER_X1Y1_SRC ; CASE FFT ; GET XMIN_FFT ; FETCH XMIN_FFT ; CASE FN1 ; FETCH Fn1_hoz_pos ; FETCH Fn1_hoz_range ; FETCH 5 ; MUL ; SUB ; CASE FN2 ; FETCH Fn2_hoz_pos ; FETCH Fn2_hoz_range ; FETCH 5 ; MUL ; SUB ; CASE WM1 ; GET XMIN_WM1 ; FETCH XMIN_WM1 ; CASE WM2 ; GET XMIN_WM2 ; FETCH XMIN_WM2 ; CASE WM3 ; GET XMIN_WM3 ; FETCH XMIN_WM3 ; CASE WM4 ; GET XMIN_WM4 ; FETCH XMIN_WM4 ; CASE ELSE ; FETCH WF_TMIN ; END SELECT ; STORE MARKER_X1_MIN ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_X1_MAX ; TYPE CONTINUOUS ; INITIAL +100E-6; GET ACTIONS ; SELECT MARKER_X1Y1_SRC ; CASE FFT ; FETCH XMIN_FFT ; SELECT FFT_Magnify ; CASE 0 ; FETCH FFT_Span ; ADD ; CASE 1 ; FETCH FFT_MSpan ; ADD ; END SELECT ; CASE FN1 ; FETCH Fn1_hoz_pos ; FETCH Fn1_hoz_range ; FETCH 5 ; MUL ; ADD ; CASE FN2 ; FETCH Fn2_hoz_pos ; FETCH Fn2_hoz_range ; FETCH 5 ; MUL ; ADD ; CASE WM1 ; FETCH XMIN_WM1 ; FETCH WM1_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE WM2 ; FETCH XMIN_WM2 ; FETCH WM2_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE WM3 ; FETCH XMIN_WM3 ; FETCH WM3_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE WM4 ; FETCH XMIN_WM4 ; FETCH WM4_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE ELSE ; FETCH WF_TMAX ; END SELECT ; STORE MARKER_X1_MAX ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_X1_POS ; ! This is also for the X Marker TYPE CONTINUOUS ; !VALUES RANGE WF_TMIN,WF_TMAX ; VALUES RANGE MARKER_X1_MIN , MARKER_X1_MAX ; INITIAL 0.0 ; SET ACTIONS ; OUTPUT MARKER_X1_POS FORMAT '":MARK:TSTA ",K' ; GOSUB UPDATE_MARKER_VALUES ; END ACTIONS ; GET ACTIONS ; SELECT MARKER_MODE ; CASE WAVEFORM ; OUTPUT STRING ":MARK:CURS? STAR" ; ENTER MARKER_X1_POS FORMAT "#,K" ; ENTER MARKER_Y1_POS FORMAT K ; CASE ELSE ; OUTPUT STRING ":MARK:TSTA?" ; ENTER MARKER_X1_POS FORMAT K ; END SELECT ; END ACTIONS ; END COMPONENT ; component t1_next notsaved nogen; type integer; panel set actions; !fetch WF_TMAX; fetch WF_TMIN; sub; abs; fetch 50; div; !fetch MARKER_X1_POS; add; dup; fetch WF_TMAX; ge; fetch MARKER_X1_MAX; fetch MARKER_X1_MIN ; sub; abs; fetch 50; div; fetch MARKER_X1_POS; add; dup; fetch MARKER_X1_MAX ; ge; if stack then; drop; else; store MARKER_X1_POS ; set MARKER_X1_POS ; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; component t1_prev notsaved nogen; type integer; panel set actions; fetch MARKER_X1_POS ; !fetch WF_TMAX; fetch WF_TMIN; sub; abs; fetch 50; div; !sub; dup; fetch WF_TMIN; le; fetch MARKER_X1_MAX; fetch MARKER_X1_MIN ; sub; abs; fetch 50; div; sub; dup; fetch MARKER_X1_MIN ; le; if stack then; drop; else; store MARKER_X1_POS ; set MARKER_X1_POS ; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; COMPONENT MARKER_X2_MIN ; TYPE CONTINUOUS ; INITIAL -100E-6; GET ACTIONS ; SELECT MARKER_X2Y2_SRC ; CASE FFT ; FETCH -1E+18 ; CASE FN1 ; FETCH Fn1_hoz_pos ; FETCH Fn1_hoz_range ; FETCH 5 ; MUL ; SUB ; CASE FN2 ; FETCH Fn2_hoz_pos ; FETCH Fn2_hoz_range ; FETCH 5 ; MUL ; SUB ; CASE WM1 ; GET XMIN_WM1 ; FETCH XMIN_WM1 ; CASE WM2 ; GET XMIN_WM2 ; FETCH XMIN_WM2 ; CASE WM3 ; GET XMIN_WM3 ; FETCH XMIN_WM3 ; CASE WM4 ; GET XMIN_WM4 ; FETCH XMIN_WM4 ; CASE ELSE ; FETCH WF_TMIN ; END SELECT ; STORE MARKER_X2_MIN ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_X2_MAX ; TYPE CONTINUOUS ; INITIAL +100E-6; GET ACTIONS ; SELECT MARKER_X2Y2_SRC ; CASE FFT ; FETCH +1E+18 ; CASE FN1 ; FETCH Fn1_hoz_pos ; FETCH Fn1_hoz_range ; FETCH 5 ; MUL ; ADD ; CASE FN2 ; FETCH Fn2_hoz_pos ; FETCH Fn2_hoz_range ; FETCH 5 ; MUL ; ADD ; CASE WM1 ; FETCH XMIN_WM1 ; FETCH WM1_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE WM2 ; FETCH XMIN_WM2 ; FETCH WM2_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE WM3 ; FETCH XMIN_WM3 ; FETCH WM3_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE WM4 ; FETCH XMIN_WM4 ; FETCH WM4_TIME_SENS ; FETCH 10 ; MUL ; ADD ; CASE ELSE ; FETCH WF_TMAX ; END SELECT ; STORE MARKER_X2_MAX ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_X2_POS ; ! This is also for the + Marker TYPE CONTINUOUS ; !VALUES RANGE WF_TMIN, WF_TMAX ; VALUES RANGE MARKER_X2_MIN , MARKER_X2_MAX ; INITIAL 0.0 ; SET ACTIONS ; OUTPUT MARKER_X2_POS FORMAT '":MARK:TSTO ",K' ; GOSUB UPDATE_MARKER_VALUES ; END ACTIONS ; GET ACTIONS ; SELECT MARKER_MODE ; CASE WAVEFORM ; OUTPUT STRING ":MARK:CURS? STOP" ; ENTER MARKER_X2_POS FORMAT "#,K" ; ENTER MARKER_Y2_POS FORMAT K ; CASE ELSE ; OUTPUT STRING ":MARK:TSTO?" ; ENTER MARKER_X2_POS FORMAT K ; END SELECT ; END ACTIONS ; END COMPONENT ; component t2_next notsaved nogen; type integer; panel set actions; !fetch WF_TMAX; fetch WF_TMIN; sub; abs; fetch 50; div; !fetch MARKER_X2_POS ; add; dup; fetch WF_TMAX; ge; fetch MARKER_X2_MAX; fetch MARKER_X2_MIN ; sub; abs; fetch 50; div; fetch MARKER_X2_POS; add; dup; fetch MARKER_X2_MAX ; ge; if stack then; drop; else; store MARKER_X2_POS; set MARKER_X2_POS ; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; component t2_prev notsaved nogen; type integer; panel set actions; fetch MARKER_X2_POS ; !fetch WF_TMAX; fetch WF_TMIN; sub; abs; fetch 50; div; !sub; dup; fetch WF_TMIN; le; fetch MARKER_X2_MAX; fetch MARKER_X2_MIN ; sub; abs; fetch 50; div; sub; dup; fetch MARKER_X2_MIN ; le; if stack then; drop; else; store MARKER_X2_POS ; set MARKER_X2_POS ; end if; end actions; end component; COMPONENT MARKER_Y1_POS ; TYPE CONTINUOUS ; VALUES RANGE VMIN_MSMT1, VMAX_MSMT1 ; INITIAL 0.0 ; SET ACTIONS ; OUTPUT MARKER_Y1_POS FORMAT '":MARK:VSTA ",K' ; GOSUB UPDATE_MARKER_VALUES ; END ACTIONS ; GET ACTIONS ; SELECT MARKER_MODE ; CASE WAVEFORM ; OUTPUT STRING ":MARK:CURS? STAR" ; ENTER MARKER_X1_POS FORMAT "#,K" ; ENTER MARKER_Y1_POS FORMAT K ; CASE ELSE ; OUTPUT STRING ":MARK:VSTA?" ; ENTER MARKER_Y1_POS FORMAT K ; END SELECT ; END ACTIONS ; END COMPONENT ; component v1_next notsaved nogen; type integer; panel set actions; fetch VMAX_MSMT1; fetch VMIN_MSMT1; sub; abs; fetch 32; div; fetch MARKER_Y1_POS ; add; dup; fetch VMAX_MSMT1; ge; if stack then; drop; else; store MARKER_Y1_POS; set MARKER_Y1_POS; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; component v1_prev notsaved nogen; type integer; panel set actions; fetch MARKER_Y1_POS; fetch VMAX_MSMT1; fetch VMIN_MSMT1; sub; abs; fetch 32; div; sub; dup; fetch VMIN_MSMT1; le; if stack then; drop; else; store MARKER_Y1_POS; set MARKER_Y1_POS; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; COMPONENT MARKER_Y2_POS ; TYPE CONTINUOUS ; VALUES RANGE VMIN_MSMT2, VMAX_MSMT2 ; INITIAL 0.0 ; SET ACTIONS ; OUTPUT MARKER_Y2_POS FORMAT '":MARK:VSTO ",K' ; GOSUB UPDATE_MARKER_VALUES ; END ACTIONS ; GET ACTIONS ; SELECT MARKER_MODE ; CASE WAVEFORM ; OUTPUT STRING ":MARK:CURS? STOP" ; ENTER MARKER_X2_POS FORMAT "#,K" ; ENTER MARKER_Y2_POS FORMAT K ; CASE ELSE ; OUTPUT STRING ":MARK:VSTO?" ; ENTER MARKER_Y2_POS FORMAT K ; END SELECT ; END ACTIONS ; END COMPONENT ; component v2_next notsaved nogen; type integer; panel set actions; fetch VMAX_MSMT2; fetch VMIN_MSMT2; sub; abs; fetch 32; div; fetch MARKER_Y2_POS ; add; dup; fetch VMAX_MSMT2; ge; if stack then; drop; else; store MARKER_Y2_POS; set MARKER_Y2_POS; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; component v2_prev notsaved nogen; type integer; panel set actions; fetch MARKER_Y2_POS; fetch VMAX_MSMT2; fetch VMIN_MSMT2; sub; abs; fetch 32; div; sub; dup; fetch VMIN_MSMT2; le; if stack then; drop; else; store MARKER_Y2_POS; set MARKER_Y2_POS; end if; GOSUB UPDATE_MARKER_VALUES ; end actions; end component; COMPONENT MARKER_TDELTA ; TYPE CONTINUOUS ; INITIAL 0.0 ; GET ACTIONS ; SELECT MARKER_MODE ; CASE WAVEFORM ; OUTPUT STRING ":MARK:CURS? DELT" ; ENTER MARKER_TDELTA FORMAT "#,K" ; ENTER MARKER_VDELTA FORMAT K ; CASE ELSE ; OUTPUT STRING ":MARK:TDEL?" ; ENTER MARKER_TDELTA FORMAT K ; END SELECT ; END ACTIONS ; END COMPONENT ; COMPONENT MARKER_VDELTA ; TYPE CONTINUOUS ; INITIAL 0.0 ; GET ACTIONS ; SELECT MARKER_MODE ; CASE WAVEFORM ; OUTPUT STRING ":MARK:CURS? DELT" ; ENTER MARKER_TDELTA FORMAT "#,K" ; ENTER MARKER_VDELTA FORMAT K ; CASE ELSE ; OUTPUT STRING ":MARK:VDEL?" ; ENTER MARKER_VDELTA FORMAT K ; END SELECT ; END ACTIONS ; END COMPONENT ; ACTIONS UPDATE_MARKER_VALUES ; IF LIVEMODE THEN ; OUTPUT STRING ";:MARK:MODE?" ; ! cant do GET MARKER_MODE , it calls UPDATE_MARKER_VALUES too!! ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "OFF" ; FETCH ( MARKER_MODE ) OFF ; CASE "MAN" ; FETCH ( MARKER_MODE ) MANUAL ; CASE "WAV" ; FETCH ( MARKER_MODE ) WAVEFORM ; CASE "MEAS"; FETCH ( MARKER_MODE ) MEAS ; CASE ELSE ; NOTIFY "BAD CASE IN MARKER_MODE" ; FETCH MARKER_MODE ; END SELECT ; STORE MARKER_MODE ; SELECT MARKER_MODE ; ! Panel Get Actions CASE OFF ; FETCH 0 ; DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; CASE MANUAL ; FETCH 1 ; DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; CASE WAVEFORM ; FETCH 0 ;DUP ; DUP ; STORE MARKER_STATE_MAN ; STORE MARKER_STATE_VER ; STORE MARKER_STATE_HOR ; FETCH 0 ; STORE MARKER_STATE_MEAS ; FETCH 1 ; STORE MARKER_STATE_WAV ; CASE MEAS ; FETCH 0 ; STORE MARKER_STATE_MAN ; FETCH 1 ; STORE MARKER_STATE_MEAS ; FETCH 0 ; STORE MARKER_STATE_WAV ; END SELECT ; GET MARKER_X1_POS ; GET MARKER_X2_POS ; SELECT MARKER_MODE ; CASE WAVEFORM ; GET VMIN_MSMT1 ; GET VMAX_MSMT1 ; GET VMIN_MSMT2 ; GET VMAX_MSMT2 ; CASE ELSE ; GET MARKER_Y1_POS ; GET MARKER_Y2_POS ; END SELECT ; GET MARKER_TDELTA ; GET MARKER_VDELTA ; END IF ; END ACTIONS ; ACTIONS Fix_Marker_Sources ; Get MARKER_X1Y1_SRC ; Get MARKER_X2Y2_SRC ; END ACTIONS ; ! check it out - major work here !============================== ! WAVEFORM ACQ SUBSYSTEM !============================== !>> Acquisition/scaling parameters COMPONENT Acq_mode ; TYPE DISCRETE ; VALUES RTIME,ETIME ; INITIAL ETIME ; COUPLED Acq_type,VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4, Acq_Comp_State, FFT_display,FFT_Span,FFT_Resolution,FFT_MSpan,FFT_Center_freq, Fn1_display,Fn2_display ; SET ACTIONS ; OUTPUT Acq_mode TABLE ":ACQ:MODE RTIME",":ACQ:MODE ETIME" ; IF Acq_mode THEN ; ELSE ; DONTCARE Acq_srate ; END IF ; END ACTIONS ; PANEL SET ACTIONS ; SELECT Acq_mode ; CASE RTIME ; HIDE ACQUISITION_EQVTMODE ; SHOW ACQUISITION_REALMODE ; CASE ETIME ; SHOW ACQUISITION_EQVTMODE ; HIDE ACQUISITION_REALMODE ; END SELECT ; set DIGITIZE; END ACTIONS ; GET ACTIONS ; IF LIVEMODE THEN ; OUTPUT STRING ":ACQ:MODE?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "RTIME" ; FETCH ( Acq_mode ) RTIME ; CASE "ETIME" ; FETCH ( Acq_mode ) ETIME ; CASE ELSE ; NOTIFY "BAD CASE IN Acq_mode" ; FETCH Acq_mode ; END SELECT ; STORE Acq_mode ; END IF ; END ACTIONS ; END COMPONENT ; COMPONENT ACQ_TYPE; TYPE DISCRETE; VALUES NORMAL,RAW,INT,AVER; ! NORMAL,AVERAGE - eqvt time INITIAL NORMAL; ! RAW,INT - real time COUPLED ACQ_TYPE,ACQ_INT_STAT , Acq_Comp_State, VIEW_CH1,VIEW_CH2,VIEW_CH3,VIEW_CH4,NUM_POINTS , VIEW_WF_CH1,VIEW_WF_CH2,VIEW_WF_CH3,VIEW_WF_CH4 ; ! Must couple WF_TYPE - display SET ACTIONS; OUTPUT STRING ":ACQ:TYPE "; OUTPUT ACQ_TYPE TABLE 'NORM','RAW','INT','AVER'; END ACTIONS; PANEL SET ACTIONS ; !HIDE Display_subsystem,Normal; HIDE Display_subsystem,Raw; All are the same !HIDE Display_subsystem,Interpolate; HIDE Display_subsystem,Average; set DIGITIZE; END ACTIONS; GET ACTIONS; OUTPUT STRING ":ACQ:TYPE?"; ENTER CHARSTRING FORMAT K; SELECT CHARSTRING; CASE "NORM"; FETCH (ACQ_TYPE)NORMAL; CASE "RAW"; FETCH (ACQ_TYPE)RAW; CASE "INT"; FETCH (ACQ_TYPE)INT; CASE "AVER"; FETCH (ACQ_TYPE)AVER; CASE ELSE; FETCH ACQ_TYPE; END SELECT; STORE ACQ_TYPE; END ACTIONS; END COMPONENT; ACTIONS FIX_ACQ_TYPE; ENABLE ACQ_TYPE AVER; ! check it out GET ACQ_TYPE; END ACTIONS; COMPONENT COMPLETION; TYPE INTEGER; VALUES RANGE 0,100; INITIAL 90; COUPLED VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4, Acq_Comp_State ; SET ACTIONS; OUTPUT COMPLETION FORMAT '":ACQ:COMP ",K'; END ACTIONS; GET ACTIONS; OUTPUT STRING ":ACQ:COMP?"; ENTER COMPLETION FORMAT K; END ACTIONS; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT; COMPONENT MAX_NUM_POINTS ; TYPE CONTINUOUS ; INITIAL 16384 ; END COMPONENT ; COMPONENT NUM_POINTS; TYPE CONTINUOUS ; VALUES RANGE 16,MAX_NUM_POINTS,1; INITIAL 512,DONTCARE; ! Default setup - value canot be queried !coupled NUM_POINTS; ! Check with the division , if any value has to be COUPLED NUM_POINTS,VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4; SET ACTIONS; ! set for initial conditions (set_init) OUTPUT NUM_POINTS FORMAT '":ACQ:POINTS ",K'; VALIDATE NUM_POINTS ; END ACTIONS; GET ACTIONS; OUTPUT STRING ":ACQ:POINTS?"; ENTER CHARSTRING FORMAT K ; if LIVEMODE THEN; SELECT CHARSTRING ; CASE "AUTO" ; DONTCARE NUM_POINTS ; ! autoscale CASE ELSE ; FETCH ""; FETCH CHARSTRING ; TRIMSTR; CATSTR ; VAL ; STORE NUM_POINTS ; VALIDATE NUM_POINTS ; END SELECT ; END IF; END ACTIONS; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT; COMPONENT NUM_POINTS_AUTO ; TYPE INTEGER ; COUPLED VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4; SET ACTIONS ; OUTPUT STRING "ACQ:POIN AUTO " ; DONTCARE NUM_POINTS ; END ACTIONS ; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT ; ACTIONS Fix_Max_Record_Length ; IF SLOT_21A THEN ; FETCH 32768 ; STORE MAX_NUM_POINTS ; FETCH 4.0E+9 ; STORE Max_Acq_srate ; END IF ; IF SLOT_22A THEN ; FETCH 65536 ; STORE MAX_NUM_POINTS ; FETCH 8.0E+9 ; STORE Max_Acq_srate ; END IF ; END ACTIONS ; COMPONENT MAX_Acq_srate ; TYPE CONTINUOUS ; INITIAL 2.0E+9 ; END COMPONENT ; COMPONENT Acq_srate ; TYPE CONTINUOUS ; VALUES RANGE 0.5,Max_Acq_srate ; INITIAL DONTCARE ; COUPLED Acq_srate,VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4; SET ACTIONS ; IF Acq_mode THEN ; ELSE ; OUTPUT Acq_srate FORMAT '":ACQ:SRAT ",K' ; VALIDATE Acq_srate ; END IF ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":ACQ:SRAT?" ; ENTER CHARSTRING FORMAT K ; SELECT CHARSTRING ; CASE "AUTO" ; DONTCARE Acq_srate ; CASE ELSE ; FETCH ""; FETCH CHARSTRING ; TRIMSTR; CATSTR ; VAL ; VALIDATE Acq_srate ; STORE Acq_srate ; END SELECT ; END ACTIONS ; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT ; COMPONENT Acq_srate_auto ; TYPE INTEGER ; COUPLED VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4; SET ACTIONS ; OUTPUT STRING ":ACQ:SRAT AUTO" ; DONTCARE Acq_srate ; END ACTIONS ; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT ; component acq_points notsaved; type integer; initial 0,invalid; get actions; output string ":ACQ:POINTS?"; enter acq_points format 'K'; end actions; end component; COMPONENT Acq_count ; TYPE INTEGER ; VALUES RANGE 1,4096 ; INITIAL 16 ; COUPLED VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4; SET ACTIONS ; OUTPUT Acq_count FORMAT '":ACQ:COUN ",K' ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":ACQ:COUN?"; ENTER Acq_count FORMAT 'K' ; END ACTIONS ; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT ; COMPONENT Acq_int_stat ; TYPE DISCRETE ; VALUES OFF,ON ; INITIAL ON; COUPLED ACQ_TYPE ; SET ACTIONS ; OUTPUT Acq_int_stat TABLE ":ACQ:INT OFF",":ACQ:INT ON" ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":ACQ:INT?" ; ENTER Acq_int_stat FORMAT K ; END ACTIONS ; PANEL SET ACTIONS UPDATE_TRACE_DATA ; END COMPONENT ; COMPONENT Acq_bwlimit ; TYPE DISCRETE ; VALUES OFF,ON ; INITIAL OFF; COUPLED VIEW_CH1,VIEW_WF_CH1,VIEW_CH2,VIEW_WF_CH2, VIEW_CH3,VIEW_WF_CH3,VIEW_CH4,VIEW_WF_CH4; SET ACTIONS ; OUTPUT Acq_bwlimit TABLE ":ACQ:BWL OFF",":ACQ:BWL ON" ; END ACTIONS ; GET ACTIONS ; OUTPUT STRING ":ACQ:BWL?" ; ENTER Acq_bwlimit FORMAT K ; END ACTIONS ; PANEL SET ACTIONS ; SET DIGITIZE ; END ACTIONS ; END COMPONENT ; COMPONENT YINCREMENT NOTSAVED NOGEN; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT YORIGIN NOTSAVED NOGEN; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT YREF NOTSAVED NOGEN; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT valid_data NOTSAVED NOGEN; TYPE integer; initial 1; END COMPONENT; COMPONENT X_ORIGIN_MAIN ; TYPE CONTINUOUS ; GET ACTIONS ; END ACTIONS ; END COMPONENT ; COMPONENT X_DISP_ORIGIN ; TYPE CONTINUOUS ; GET ACTIONS ; END ACTIONS ; END COMPONENT ; COMPONENT X_DISP_RANGE ; TYPE CONTINUOUS ; GET ACTIONS ; END ACTIONS ; END COMPONENT ; COMPONENT X_WAV_INC ; TYPE CONTINUOUS ; GET ACTIONS ; END ACTIONS ; END COMPONENT ; COMPONENT WF_SIZE NOTSAVED; TYPE INTEGER; !VALUES RANGE ???? ; !INITIAL ????; GET ACTIONS; !OUTPUT STRING ":WAV:VAL?"; enter stack format K; !if stack then; !fetch 1; store valid_data; IF Time_Wind_Stat THEN ; OUTPUT STRING ":WAV:VIEW WIND;" ; ELSE ; OUTPUT STRING ":WAV:VIEW MAIN;" ; END IF ; OUTPUT STRING ":WAV:FORMAT WORD;" ; OUTPUT STRING ":WAV:PRE?"; if livemode then; wait spoll bit 4; ! message available end if; ENTER NUM_BUFFER FORMAT "#,K"; ! format ENTER NUM_BUFFER FORMAT "#,K"; ! wftype ENTER WF_SIZE FORMAT "#,K"; ! wf size ENTER NUM_BUFFER FORMAT "#,K"; ! bin count !ENTER NUM_BUFFER FORMAT "#,K"; ! x-incr ENTER X_WAV_INC FORMAT "#,K"; !ENTER NUM_BUFFER FORMAT "#,K"; ! x-origin ENTER X_ORIGIN_MAIN FORMAT "#,K" ; ENTER NUM_BUFFER FORMAT "#,K"; ! x-ref ENTER YINCREMENT FORMAT "#,K"; ! y-incr ENTER YORIGIN FORMAT "#,K"; ! y-origin ! check it out - the formula below ? YREF is always 0 ENTER STACK FORMAT "#,K"; FETCH -1; MUL; STORE YREF; ! need '-YREF' in conversion expression ... ENTER NUM_BUFFER FORMAT "#,K"; ! coupling !ENTER NUM_BUFFER FORMAT "#,K"; ! x-disp-range ENTER X_DISP_RANGE FORMAT "#,K"; ! x-disp-range !ENTER NUM_BUFFER FORMAT "#,K"; ! x-disp-org ENTER X_DISP_ORIGIN FORMAT "#,K"; ! x-disp-org ENTER NUM_BUFFER FORMAT "#,K"; ! y-disp-range ENTER NUM_BUFFER FORMAT "#,K"; ! y-disp-org ENTER charstring FORMAT K; ! date ! check it out - a lot more ENTER as in page 23-23,23-24 ! OUTPUT "*OPC?" ; ENTER STACK FORMAT K ; NOTIFY STACK ; !else; !fetch 0; store valid_data; !end if; END ACTIONS; END COMPONENT; COMPONENT X_INC; TYPE CONTINUOUS; INITIAL 1E-6; GET ACTIONS; if livemode then ; SELECT Time_Wind_Stat ; CASE MAIN ; FETCH TIME_SENS; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE X_INC; CASE WIND ; FETCH TIME_WIND_SENS; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE X_INC; END SELECT ; end if ; END ACTIONS; END COMPONENT; COMPONENT X_MIN; TYPE CONTINUOUS; INITIAL -500E-6; GET ACTIONS; SELECT Time_Wind_Stat ; CASE MAIN ; SELECT TIME_REF; CASE LEFT; FETCH 0; CASE CENTER; FETCH TIME_SENS; FETCH -5; MUL; CASE RIGHT; FETCH TIME_SENS; FETCH -10; MUL; END SELECT; FETCH TIME_DELAY; ADD; STORE X_MIN; CASE WIND ; SELECT TIME_REF; CASE LEFT; FETCH 0; CASE CENTER; FETCH TIME_WIND_SENS; FETCH -5; MUL; CASE RIGHT; FETCH TIME_WIND_SENS; FETCH -10; MUL; END SELECT; FETCH TIME_WIND_DELAY; ADD; STORE X_MIN; END SELECT ; END ACTIONS; END COMPONENT; COMPONENT XMIN_FFT; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS; SELECT FFT_Magnify ; CASE 0 ; FETCH 0 ; STORE XMIN_FFT ; CASE 1 ; FETCH FFT_Center_Freq ; FETCH FFT_MSpan ; FETCH 10 ; DIV ; FETCH 5 ; MUL ; SUB ; STORE XMIN_FFT ; END SELECT ; !FETCH FFT_Center_Freq ; STORE XMIN_FFT ; END ACTIONS; END COMPONENT; COMPONENT XINC_FFT; TYPE CONTINUOUS; INITIAL INVALID ; GET ACTIONS; SELECT FFT_Magnify ; CASE 0 ; FETCH FFT_Span ; CASE 1 ; FETCH FFT_MSpan ; END SELECT ; FETCH WF_SIZE; DIV; STORE XINC_FFT ; END ACTIONS; END COMPONENT; COMPONENT X_SCALE_LEFT ; TYPE INTEGER; INITIAL INVALID ; GET ACTIONS; fetch 1; if livemode then; FETCH X_ORIGIN_MAIN; FETCH X_DISP_ORIGIN; SUB; FETCH X_WAV_INC; IDIV ; SUB ; end if; STORE X_SCALE_LEFT ; END ACTIONS; END COMPONENT; COMPONENT X_SCALE_RIGHT ; TYPE INTEGER ; INITIAL INVALID ; GET ACTIONS ; if livemode then; FETCH X_SCALE_LEFT ; FETCH X_DISP_RANGE ; FETCH X_WAV_INC ; IDIV ; ADD ; else; fetch 512; end if; STORE X_SCALE_RIGHT ; END ACTIONS ; END COMPONENT ; COMPONENT X_SCALE_LEFT_CH1 ; TYPE INTEGER; INITIAL INVALID ; END COMPONENT ; COMPONENT X_SCALE_RIGHT_CH1 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_CH2 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_CH2 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_CH3 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_CH3 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_CH4 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_CH4 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_WM1 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_WM1 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_WM2 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_WM2 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_WM3 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_WM3 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_WM4 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_WM4 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_FUNC1 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_FUNC1 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_FUNC2 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_FUNC2 CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_LEFT_FFT CLONE X_SCALE_LEFT_CH1 ; COMPONENT X_SCALE_RIGHT_FFT CLONE X_SCALE_LEFT_CH1 ; COMPONENT XMIN_CH1; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XINC_CH1; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XMIN_CH2; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XINC_CH2; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XMIN_CH3; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XINC_CH3; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XMIN_CH4; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XINC_CH4; TYPE CONTINUOUS; INITIAL INVALID; END COMPONENT; COMPONENT XMIN_WM1; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; SELECT WM1_TIME_REF; CASE LEFT; FETCH 0; CASE CENTER; FETCH WM1_TIME_SENS; FETCH -5; MUL; CASE RIGHT; FETCH WM1_TIME_SENS; FETCH -10; MUL; END SELECT; FETCH WM1_TIME_DELAY; ADD; STORE XMIN_WM1 ; END ACTIONS ; END COMPONENT; COMPONENT XINC_WM1; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH WM1_TIME_SENS; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE XINC_WM1; END ACTIONS ; END COMPONENT; COMPONENT XMIN_WM2; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; SELECT WM2_TIME_REF; CASE LEFT; FETCH 0; CASE CENTER; FETCH WM2_TIME_SENS; FETCH -5; MUL; CASE RIGHT; FETCH WM2_TIME_SENS; FETCH -10; MUL; END SELECT; FETCH WM2_TIME_DELAY; ADD; STORE XMIN_WM2 ; END ACTIONS ; END COMPONENT; COMPONENT XINC_WM2; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH WM2_TIME_SENS; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE XINC_WM2; END ACTIONS ; END COMPONENT; COMPONENT XMIN_WM3; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; SELECT WM3_TIME_REF; CASE LEFT; FETCH 0; CASE CENTER; FETCH WM3_TIME_SENS; FETCH -5; MUL; CASE RIGHT; FETCH WM3_TIME_SENS; FETCH -10; MUL; END SELECT; FETCH WM3_TIME_DELAY; ADD; STORE XMIN_WM3 ; END ACTIONS ; END COMPONENT; COMPONENT XINC_WM3; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH WM3_TIME_SENS; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE XINC_WM3; END ACTIONS ; END COMPONENT; COMPONENT XMIN_WM4; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; SELECT WM4_TIME_REF; CASE LEFT; FETCH 0; CASE CENTER; FETCH WM4_TIME_SENS; FETCH -5; MUL; CASE RIGHT; FETCH WM4_TIME_SENS; FETCH -10; MUL; END SELECT; FETCH WM4_TIME_DELAY; ADD; STORE XMIN_WM4 ; END ACTIONS ; END COMPONENT; COMPONENT XINC_WM4; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH WM4_TIME_SENS; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE XINC_WM4; END ACTIONS ; END COMPONENT; COMPONENT XMIN_FUNC1; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH Fn1_hoz_pos ; FETCH Fn1_hoz_range ; FETCH 5 ; MUL ; SUB ; STORE XMIN_FUNC1 ; END ACTIONS ; END COMPONENT; COMPONENT XINC_FUNC1; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH Fn1_hoz_range ; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE XINC_FUNC1; END ACTIONS ; END COMPONENT; COMPONENT XMIN_FUNC2; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH Fn2_hoz_pos ; FETCH Fn2_hoz_range ; FETCH 5 ; MUL ; SUB ; STORE XMIN_FUNC2 ; END ACTIONS ; END COMPONENT; COMPONENT XINC_FUNC2; TYPE CONTINUOUS; INITIAL INVALID; GET ACTIONS ; FETCH Fn2_hoz_range ; FETCH 10; MUL; FETCH WF_SIZE; DIV; STORE XINC_FUNC2; END ACTIONS ; END COMPONENT; COMPONENT WF_SIZE_CH1; TYPE INTEGER; END COMPONENT ; COMPONENT WF_SIZE_CH2 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_CH3 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_CH4 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_WM1 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_WM2 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_WM3 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_WM4 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_FUNC1 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_FUNC2 CLONE WF_SIZE_CH1 ; COMPONENT WF_SIZE_FFT CLONE WF_SIZE_CH1 ; COMPONENT WF_DATA NOTSAVED; ! check it out - Jay's driver it is completely different TYPE INTEGER; INITIAL DONTCARE; get actions; FETCH VIEW_CH1; FETCH VIEW_CH2; ADD; FETCH VIEW_CH3; ADD; FETCH VIEW_CH4; ADD; IF STACK THEN; ! at least one channel enabled for acquisition ! GOSUB UPDATE_TRACE_DATA; IF VIEW_CH1 THEN; CODEGEN GET WF_CH1; END IF; IF VIEW_CH2 THEN; CODEGEN GET WF_CH2; END IF; IF VIEW_CH3 THEN; CODEGEN GET WF_CH3; END IF; IF VIEW_CH4 THEN; CODEGEN GET WF_CH4; END IF; CODEGEN PEEK WF_SIZE; ELSE; IF LIVEMODE THEN ; NOTIFY "No channels enabled for digitize operation"; END IF ; END IF; ! at least one channel enabled for acquisition end actions; END COMPONENT; !>> NORMAL and AVERAGE waveforms COMPONENT WF_CH1 NOTSAVED ; ! 'GET' does NOT include a 'DIGITIZE' operation ... TYPE RTRACE 6144; INITIAL INVALID; TRACETYPE WAVEFORM; POINTS WF_SIZE ; XMIN XMIN_CH1; XINCR XINC_CH1; XLOG OFF; XUNIT "s"; GET ACTIONS; if livemode then ; OUTPUT STRING ":WAV:SOUR CHAN1"; GET WF_SIZE; ! gets scaling parameters for CH1 along with wf size ... FETCH WF_SIZE ; STORE WF_SIZE_CH1 ; if valid_data then; OUTPUT STRING ":WAV:DATA?"; if livemode then; wait spoll bit 4; ! message available end if; ! Mismatch in preambe & data in version 3 of firmware enter CHARSTRING format "#,A"; ! consume header # enter NUM_BUFFER format "#,D"; ! consume Byte fetch NUM_BUFFER; gosub Get_num_bytes; store NUM_BUFFER ; fetch NUM_BUFFER ; FETCH 2 ; DIV ; STORE WF_SIZE_CH1 ; ENTER WF_CH1 FORMAT INT16 0 WF_SIZE_CH1; ENTER CHARSTRING FORMAT K; ! consumes NL at end of binary block ... MATSCALE 1,YREF WF_CH1; ! subtracts yref from array ... MATSCALE YINCREMENT,YORIGIN WF_CH1; ! scales y-data in array ... GET X_MIN; FETCH X_MIN; STORE XMIN_CH1; GET X_INC; FETCH X_INC; STORE XINC_CH1; GET X_SCALE_LEFT ; FETCH X_SCALE_LEFT ; STORE X_SCALE_LEFT_CH1 ; GET X_SCALE_RIGHT ; FETCH X_SCALE_RIGHT ; STORE X_SCALE_RIGHT_CH1 ; else; if panelmode then; notify "No valid data on Channel 1"; end if; end if; else; if num_points then; else; fetch 512; store num_points; end if; fetch num_points; dup; dup; store WF_SIZE; store WF_SIZE_CH1; store X_SCALE_RIGHT_CH1; fetch 1; store X_SCALE_LEFT_CH1; fetch 1; loop; dup; dup; fetch num_points; div; dup; fetch 1000; mul; sin; swap; fetch Demo_Freq; mul; FETCH Demo_Phase; add; sin; add; swap; store WF_CH1; dup; fetch num_points; ge; exit if stack; fetch 1; add; end loop; drop; fetch Demo_Freq; fetch 25; add; store Demo_Freq; fetch Demo_Freq; fetch 1245; gt; if stack then; fetch Demo_Freq; fetch 327; sub; store Demo_Freq; end if; fetch Demo_Phase; fetch 35; add; store Demo_Phase; fetch Demo_Phase; fetch 367; gt; if stack then; fetch Demo_Phase; fetch 327; sub; store Demo_Phase; end if; validate WF_CH1; end if ; END ACTIONS; END COMPONENT; COMPONENT WF_CH2 NOTSAVED; ! 'GET' does NOT include a 'DIGITIZE' operation ... TYPE RTRACE 6144; INITIAL INVALID; TRACETYPE WAVEFORM; POINTS WF_SIZE; XMIN XMIN_CH2; XINCR XINC_CH2; XLOG OFF; XUNIT "s"; GET ACTIONS; if livemode then ; OUTPUT STRING ":WAV:SOUR CHAN2"; GET WF_SIZE; ! gets scaling parameters for CH2 along with wf size ... FETCH WF_SIZE ; STORE WF_SIZE_CH2 ; if valid_data then; OUTPUT STRING ":WAV:DATA?"; if livemode then; wait spoll bit 4; ! message available end if; enter CHARSTRING format "#,A"; ! consume header # enter NUM_BUFFER format "#,D"; ! consume Byte fetch NUM_BUFFER; gosub Get_num_bytes; store NUM_BUFFER ; fetch NUM_BUFFER ; FETCH 2 ; DIV ; STORE WF_SIZE_CH2 ; ENTER WF_CH2 FORMAT INT16 0 WF_SIZE_CH2; ENTER CHARSTRING FORMAT K; ! consumes NL at end of binary block ... MATSCALE 1,YREF WF_CH2; ! subtracts yref from array ... MATSCALE YINCREMENT,YORIGIN WF_CH2; ! scales y-data in array ... GET X_MIN; FETCH X_MIN; STORE XMIN_CH2; GET X_INC; FETCH X_INC; STORE XINC_CH2; GET X_SCALE_LEFT ; FETCH X_SCALE_LEFT ; STORE X_SCALE_LEFT_CH2 ; GET X_SCALE_RIGHT ; FETCH X_SCALE_RIGHT ; STORE X_SCALE_RIGHT_CH2 ; else; if panelmode then; notify "No valid data on Channel 2"; end if; end if; else; if num_points then; else; fetch 512; store num_points; end if; fetch num_points; dup; dup; store WF_SIZE; store WF_SIZE_CH2; store X_SCALE_RIGHT_CH2; fetch 1; store X_SCALE_LEFT_CH2; fetch 1; loop; dup; dup; fetch num_points; div; dup; fetch 1050; mul; sin; swap; fetch Demo_Freq; mul; FETCH Demo_Phase; add; sin; add; swap; store WF_CH2; dup; fetch num_points; ge; exit if stack; fetch 1; add; end loop; drop; fetch Demo_Freq; fetch 25; add; store Demo_Freq; fetch Demo_Freq; fetch 1245; gt; if stack then; fetch Demo_Freq; fetch 327; sub; store Demo_Freq; end if; fetch Demo_Phase; fetch 35; add; store Demo_Phase; fetch Demo_Phase; fetch 367; gt; if stack then; fetch Demo_Phase; fetch 327; sub; store Demo_Phase; end if; validate WF_CH2; end if ; END ACTIONS; END COMPONENT; COMPONENT WF_CH3 NOTSAVED; ! 'GET' does NOT include a 'DIGITIZE' operation ... TYPE RTRACE 6144; INITIAL INVALID; TRACETYPE WAVEFORM; POINTS WF_SIZE; XMIN XMIN_CH3; XINCR XINC_CH3; XLOG OFF; XUNIT "s"; GET ACTIONS; if livemode then ; OUTPUT STRING ":WAV:SOUR CHAN3"; GET WF_SIZE; ! gets scaling parameters for CH3 along with wf size ... FETCH WF_SIZE ; STORE WF_SIZE_CH3 ; if valid_data then; OUTPUT STRING ":WAV:DATA?"; if livemode then; wait spoll bit 4; ! message available end if; enter CHARSTRING format "#,A"; ! consume header # enter NUM_BUFFER format "#,D"; ! consume Byte fetch NUM_BUFFER; gosub Get_num_bytes; store NUM_BUFFER ; fetch NUM_BUFFER ; FETCH 2 ; DIV ; STORE WF_SIZE_CH3 ; ENTER WF_CH3 FORMAT INT16 0 WF_SIZE_CH3; ENTER CHARSTRING FORMAT K; ! consumes NL at end of binary block ... MATSCALE 1,YREF WF_CH3; ! subtracts yref from array ... MATSCALE YINCREMENT,YORIGIN WF_CH3; ! scales y-data in array ... GET X_MIN; FETCH X_MIN; STORE XMIN_CH3; GET X_INC; FETCH X_INC; STORE XINC_CH3; GET X_SCALE_LEFT ; FETCH X_SCALE_LEFT ; STORE X_SCALE_LEFT_CH3 ; GET X_SCALE_RIGHT ; FETCH X_SCALE_RIGHT ; STORE X_SCALE_RIGHT_CH3 ; else; if panelmode then; notify "No valid data on Channel 3"; end if; end if; else; if num_points then; else; fetch 512; store num_points; end if; fetch num_points; dup; dup; store WF_SIZE; store WF_SIZE_CH3; store X_SCALE_RIGHT_CH3; fetch 1; store X_SCALE_LEFT_CH3; fetch 1; loop; dup; dup; fetch num_points; div; dup; fetch 10000; mul; sin; swap; FETCH Demo_Freq; mul; sin; fetch 1.5; add; mul; swap; store WF_CH3; dup; fetch num_points; ge; exit if stack; fetch 1; add; end loop; drop; fetch Demo_Freq; fetch 25; add; store Demo_Freq; fetch Demo_Freq; fetch 1245; gt; if stack then; fetch Demo_Freq; fetch 327; sub; store Demo_Freq; end if; fetch Demo_Phase; fetch 35; add; store Demo_Phase; fetch Demo_Phase; fetch 367; gt; if stack then; fetch Demo_Phase; fetch 327; sub; store Demo_Phase; end if; validate WF_CH3; end if ; END ACTIONS; END COMPONENT; COMPONENT WF_CH4 NOTSAVED; ! 'GET' does NOT include a 'DIGITIZE' operation ... TYPE RTRACE 6144; INITIAL INVALID; TRACETYPE WAVEFORM; POINTS WF_SIZE; XMIN XMIN_CH4; XINCR XINC_CH4; XLOG OFF; XUNIT "s"; GET ACTIONS; if livemode then ; OUTPUT STRING ":WAV:SOUR CHAN4"; GET WF_SIZE; ! gets scaling parameters for CH4 along with wf size ... FETCH WF_SIZE ; STORE WF_SIZE_CH4 ; if valid_data then; OUTPUT STRING ":WAV:DATA?"; if livemode then; wait spoll bit 4; ! message available end if; enter CHARSTRING format "#,A"; ! consume header # enter NUM_BUFFER format "#,D"; ! consume Byte fetch NUM_BUFFER; gosub Get_num_bytes; store NUM_BUFFER ; fetch NUM_BUFFER ; FETCH 2 ; DIV ; STORE WF_SIZE_CH4 ; ENTER WF_CH4 FORMAT INT16 0 WF_SIZE_CH4; ENTER CHARSTRING FORMAT K; ! consumes NL at end of binary block ... MATSCALE 1,YREF WF_CH4; ! subtracts yref from array ... MATSCALE YINCREMENT,YORIGIN WF_CH4; ! scales y-data in array ... GET X_MIN; FETCH X_MIN; STORE XMIN_CH4; GET X_INC; FETCH X_INC; STORE XINC_CH4; GET X_SCALE_LEFT ; FETCH X_SCALE_LEFT ; STORE X_SCALE_LEFT_CH4 ; GET X_SCALE_RIGHT ; FETCH X_SCALE_RIGHT ; STORE X_SCALE_RIGHT_CH4 ; else; if panelmode then; notify "No valid data on Channel 4"; end if; end if; else; if num_points then; else; fetch 512; store num_points; end if; fetch num_points; dup; dup; store WF_SIZE; store WF_SIZE_CH4; store X_SCALE_RIGHT_CH4; fetch 1; store X_SCALE_LEFT_CH4; fetch 1; loop; dup; dup; fetch num_points; div; dup; fetch 1150; mul; sin; swap; fetch Demo_Freq; mul; FETCH Demo_Phase; add; sin; add; swap; store WF_CH4; dup; fetch num_points; ge; exit if stack; fetch 1; add; end loop; drop; fetch Demo_Freq; fetch 25; add; store Demo_Freq; fetch Demo_Freq; fetch 1245; gt; if stack then; fetch Demo_Freq; fetch 327; sub; store Demo_Freq; end if; fetch Demo_Phase; fetch 35; add; store Demo_Phase; fetch Demo_Phase; fetch 367; gt; if stack then; fetch Demo_Phase; fetch 327; sub; store Demo_Phase; end if; validate WF_CH4; end if ; END ACTIONS ; END COMPONENT; ! *************** FUNCTION Waveforms ************************ COMPONENT WF_FUNC1 NOTSAVED; TYPE RTRACE 6144; INITIAL INVALID; TRACETYPE WAVEFORM; POINTS WF_SIZE; XMIN XMIN_FUNC1; XINCR XINC_FUNC1; XLOG OFF; XUNIT "s"; GET ACTIONS; if livemode then ; OUTPUT STRING ":WAV:SOURCE FUNC1;"; GET WF_SIZE; ! gets scaling parameters for WM1 along with wf size ... FETCH WF_SIZE ; STORE WF_SIZE_FUNC1 ; OUTPUT STRING ":WAV:DATA?;"; if livemode then; wait spoll bit 4; ! message available end if; ENTER WF_FUNC1 FORMAT INT16 8,WF_SIZE_FUNC1; ! "#6