Hi HKJ,
Thank you for releasing your Testcontroller program. Finally an easy way to "play" with SCPI commands of my equipment. I never installed the VISA drivers due to the expected complex "clutter" of all the required software.
I had a go at controlling my Rigol DS2302A and Siglent SDG2122 just to see what is possible with SCPI commands. Like you said in the beginning of this topic not to display the scope image in real time but to control the scope and signal generator.
Interesting to see is the big difference between Rigol and Siglent in their responses to a read command. While Rigol only returns the requested value of specific reads, Siglent only has global reads for many values at the same time.
During testing I got some unexpected results during tests with V1.70. To me it is not clear if I am doing something wrong or this a bug / not implemented function.
Item 1:
:enable: seems not to disable #cmdSetup button. The other controls are OK.
.
#cmdSetup button Save_source_as_current_ref_(memory) Reference
:write: REF:SAV
:enable: Reference.Display_refs=="1"
:tip: Save source trace as current reference (memory only).
#cmdSetup button Reset_current_ref Reference
:Write: REF:RES
:enable: Reference.Display_refs=="1"
:update: Vscale_ratio_ref; Voffset_ref
Item 2:
#cmdSetup buttonsOn works well when On is represented by 1 in the #cndSetup definition. In my case the read returns FFT.
I tried to use the if statement, but the indicator did not turn on.
It would be nice to have a thing like :onvalue: FFT to signal the read result for the indicator to turn on.
#cmdSetup buttonsOn FFT_status FFT
:read: CALC:MODE?
; readmath > set to 1 if FFT to turn the indicator on
:readmath: value=="FFT" ? 1 : 0
:write: CALC:MODE #
:color: (0,255,0)
:tip: Turn FFT on or off
Off OFF
On FFT
With if I get:
;; DS2302A: Tx <CALC:MODE FFT>
;; DS2302A: Tx <CALC:MODE?>
;; DS2302A: Rx <FFT
>
;; DS2302A: Rx after :readmath: value=="FFT" ? 1 : 0 <1>
;; DS2302A: Rx as number <1.0>
Item 3:
Some controls create a variable. They work with :enable: and :update:, but I could not get them to work with :read:, :readmath: and :write:
I got a Java exception for an unknown variable. I would really like to use them with those statements. Is that possible?
Example of their use for Siglent SDG modulation SCPI commands:
Current setup: Separate #cmdSetup for AM and FM modulation due to SCPI write requirements
Requires #cmdSetup statements to be repeated and additional :update: controls
#cmdSetup comboboxhot Mod_type Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(value,1,",")
:write: C1:MDWV WVTP,#
:update: AM_source AM_freq AM_mod_wave FM_source FM_freq FM_mod_wave
:updatedelayed: 0.1
Amplitude AM
Dual_sideband_amplitude DSBAM
Frequency FM
Phase PM
Pulse_width PWM
Amplitude_Shift_Keying ASK
Frequency_Shift_Keying FSK
Phase_Shift_Keying PSK
#cmdSetup radio AM_source Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"SRC,[^,]*,"),1,",")
:readformat: u
:write: C1:MDWV AM,SRC,#
:update: AM_freq AM_mod_wave
:enable Mod_Out_1.Mod_type=="AM"
Internal INT
External EXT
#cmdSetup radio AM_freq Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"FRQ,[^,]*,"),1,",")
:readformat: u
:write: C1:MDWV AM,FRQ,#
:enable: Mod_Out_1.Mod_type=="AM" && Mod_Out_1.AM_source=="INT"
:tip: Only with internal source; ext +/- 6V correspond to 100%
Hz 1m 1M
#cmdSetup combobox AM_mod_wave Mod_Out_1
:write: C1:MDWV AM,MDSP,#
:read: C1:MDWV
:readmath: getElement(getMatch(value,"MDSP,[^,]*,"),1,",")
:readformat: u
:enable Mod_Out_1.Mod_type=="AM" && Mod_Out_1.AM_source
Sine SINE
Square SQUARE
Triangle TRIANGLE
Up_ramp UPRAMP
Down_ramp DNRAMP
Noise NOISE
Arbitary ARB
#cmdSetup radio FM_source Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"SRC,[^,]*,"),1,",")
:readformat: u
:write: C1:MDWV FM,SRC,#
:update: FM_freq FM_mod_wave
:enable Mod_Out_1.Mod_type=="FM"
Internal INT
External EXT
#cmdSetup number FM_freq Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"FRQ,[^,]*,"),1,",")
:readformat: u
:write: C1:MDWV FM,FRQ,#
:enable: Mod_Out_1.Mod_type=="FM" && Mod_Out_1.FM_source=="INT"
:tip: Only with internal source; ext +/- 6V correspond to 100%
Hz 1m 1M
#cmdSetup combobox Mod_wave Mod_Out_1
:write: C1:MDWV FM,MDSP,#
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"MDSP,[^,]*,"),1,",")
:readformat: u
:enable Mod_Out_1.Mod_type=="FM" && Mod_Out_1.FM_source=="INT"
Sine SINE
Square SQUARE
Triangle TRIANGLE
Up_ramp UPRAMP
Down_ramp DNRAMP
Noise NOISE
Arbitrary ARB
Requested setup: Combined using (Mod_Out_1.Mod_type) as replacement for AM and FM on :write:
Giving less #cmdSetup statements and :update: controls
#cmdSetup comboboxhot Mod_type Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(value,1,",")
:write: C1:MDWV WVTP,#
:updatedelayed: 0.1
Amplitude AM
Dual_sideband_amplitude DSBAM
Frequency FM
Phase PM
Pulse_width PWM
Amplitude_Shift_Keying ASK
Frequency_Shift_Keying FSK
Phase_Shift_Keying PSK
#cmdSetup radio Source Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"SRC,[^,]*,"),1,",")
:readformat: u
:write: C1:MDWV (Mod_Out_1.Mod_type),SRC,#
:update: Freq Mod_wave
Internal INT
External EXT
#cmdSetup number Freq Mod_Out_1
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"FRQ,[^,]*,"),1,",")
:readformat: u
:write: C1:MDWV (Mod_Out_1.Mod_type),FRQ,#
:enable: Mod_Out_1.Source=="INT"
:tip: Only with internal source; ext +/- 6V correspond to 100%
Hz 1m 1M
#cmdSetup combobox Mod_wave Mod_Out_1
:write: C1:MDWV (Mod_Out_1.Mod_type),MDSP,#
:read: C1:MDWV?
:readmath: getElement(getMatch(value,"MDSP,[^,]*,"),1,",")
:readformat: u
:enable: Mod_Out_1.Source=="INT"
Sine SINE
Square SQUARE
Triangle TRIANGLE
Up_ramp UPRAMP
Down_ramp DNRAMP
Noise NOISE
Arbitrary ARB