The "#askValuesReadFormat s" seem to not work as it should:
#askValues txrx? G
#askValuesReadFormat s
#askValuesMathFormat replace(replace(replace(value,"+.","0."),"-.","-0.")," ","");
;; SOL7150PLUS: Tx <txrx? G>
;; COM9: Tx: <WRT 1.> 57 52 54 20 31 0A
;; COM9: Tx: <G.> 47 0A
;; COM9: Tx: <RD #20,1.> 52 44 20 23 32 30 2C 31 0A
;; COM9: Rx: <+0.000340 KOHM> 2B 30 2E 30 30 30 33 34 30 20 20 4B 4F 48 4D
;; SOL7150PLUS: Rx <+0.000340 KOHM>
;; SOL7150PLUS: Rx after :readmath: replace(replace(replace(value,"+.","0."),"-.","-0.")," ",""); <+0.000340KOHM>
;; SOL7150PLUS: Rx as numbers <NaN>
;; SOL7150PLUS: Tx <txrx? G>
;; COM9: Tx: <WRT 1.> 57 52 54 20 31 0A
;; COM9: Tx: <G.> 47 0A
;; COM9: Tx: <RD #20,1.> 52 44 20 23 32 30 2C 31 0A
;; COM9: Rx: <+.0000290 V DC> 2B 2E 30 30 30 30 32 39 30 20 20 56 20 44 43
;; SOL7150PLUS: Rx <+.0000290 V DC>
;; SOL7150PLUS: Rx after :readmath: replace(replace(replace(value,"+.","0."),"-.","-0.")," ",""); <0.0000290VDC>
;; SOL7150PLUS: Rx as numbers <NaN>
The strings "+0.000340KOHM" and "0.0000290VDC" seem correct. Tried also to remove the DC and OHM part without success
For the problem in 6.5 digit mode, it goes in rx timeout:
;; SOL7150PLUS: Tx <txrx? G>
;; COM9: Tx: <WRT 1.> 57 52 54 20 31 0A
;; COM9: Tx: <G.> 47 0A
;; COM9: Tx: <RD #20,1.> 52 44 20 23 32 30 2C 31 0A
;; COM9: Rx: <0> 30
;; SOL7150PLUS: Rx <0>
;; SOL7150PLUS: Rx after :readmath: replace(replace(replace(value,"+.","0."),"-.","-0.")," ",""); <0>
;; SOL7150PLUS: Rx as numbers <0.0>
Tried to increase the #gpibWriteReadDelay up to 1000 without success.
If i exit the program, and do the request manually via realterm, it works:
w77 r72 t74 20 131 0D
g67 0D
r72 d64 20 #23 232 030 ,2C 131 0D
+2B .2E 030 030 030 030 333 030 838 20 20 V56 20 D44 C43 0D 0A
00 00 00 131 737 0D 0A
One more question, how i can enable (or made visible) a control only based on the selected mode?
With:
;Mode-------------------------------------------------------------------------------------------
#cmdSetup info ActiveMode
:read: Mode?
:readmath: getElement("VDC;VAC;OHM",listIndex(unQuote(value),"M0 M1 M2"," "),";")
:updatemodechange:
;VDC-------------------------------------------------------------------------------------
#cmdSetup comboboxHot Range VDC
:write: tx #
:read: Range?
:enable: ActiveMode=="VDC"
AUTO R0
200mV R01
2V R02
20V R03
200V R04
2000V R05
:updatemodechange:
It give me
Exception in thread "AWT-EventQueue-0" dk.hkj.script.ProgramExceptions$UnknownException: Variable not found ActiveMode
ActiveMode==____<----____"VDC"
This is the current definition
#idString SOLARTRON,7150PLUS,
#name Solartron 7150Plus
#handle SOL7150PLUS
#driver Ascii
#port GPIB
#gpibReadCount 20
#gpibReadEol 10
;#gpibReadEol eoi
#gpibWriteReadDelay 500
;#verifyDevice 7150+_VAC.AC Reset;Model?
;#scpiCmd Reset tx A
;#scpiCmd Model? txrx?
; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value VoltageDC V si VDC
#value VoltageAC V si VAC
#value Resistance ohm si OHM
#initCmd SingleValue
;#scpiCmd RemoteEnable tx REN
#scpiCmd SingleValue tx T0
#finalCmd tx T1
#interfaceType DMM BMM
#interface readValue 0
#cmdModeLayout 3 5
#cmdMode VDC M0
tx M0
#cmdMode VAC M1
tx M1
#cmdMode OHM M2
tx M2
;Mode-------------------------------------------------------------------------------------------
#cmdSetup info ActiveMode
:read: Mode?
:readmath: getElement("VDC;VAC;OHM",listIndex(unQuote(value),"M0 M1 M2"," "),";")
:updatemodechange:
;VDC-------------------------------------------------------------------------------------
#cmdSetup comboboxHot Range VDC
:write: tx #
:read: Range?
;:enable: inList(ActiveMode,"VDC");
AUTO R0
200mV R01
2V R02
20V R03
200V R04
2000V R05
:updatemodechange:
#cmdSetup comboboxHot Integration_Time VDC
:write: tx #
:read: txrx? I?
6.66ms(3x9's) I0
40.0ms(4x9's,50Hz) I1
50.0ms(4x9's,60Hz) I2
100ms(4x9's) I6
400ms(5x9's) I3
10x400ms(6x9's) I4
:updatemodechange:
;VAC-------------------------------------------------------------------------------------
#cmdSetup comboboxHot Range VAC
:write: tx #
:read: Range?
AUTO R0
200mV R01
2V R02
20V R03
200V R04
2000V R05
:updatemodechange:
#cmdSetup comboboxHot Integration_Time VAC
:write: tx #
:read: txrx? I?
6.66ms(3x9's) I0
40.0ms(4x9's,50Hz) I1
50.0ms(4x9's,60Hz) I2
100ms(4x9's) I6
400ms(5x9's) I3
:updatemodechange:
;OHM-------------------------------------------------------------------------------------
#cmdSetup comboboxHot Range OHM
:write: tx #
:read: Range?
AUTO R0
20KOhm R03
200KOhm R04
2Mohm R05
20Mohm R06
:updatemodechange:
#cmdSetup comboboxHot Integration_Time OHM
:write: tx #
:read: txrx? I?
6.66ms(3x9's) I0
40.0ms(4x9's,50Hz) I1
50.0ms(4x9's,60Hz) I2
100ms(4x9's) I6
400ms(5x9's) I3
10x400ms(6x9's) I4
:updatemodechange:
#askMode Mode?
#scpiCmd Mode? txrx? M?
#scpiCmd Range? txrx? R?
#askValues txrx? G
#askValuesReadFormat s
#askValuesMathFormat replace(replace(replace(value,"+.","0."),"-.","-0.")," ","");