I think there are some points, where I need some help/hints, please...
With hindsight, I changed the handle to "PMXTRA", because "GMX" always reminds me of my E-Mail-Provider "gmx.de".
Well, generally speaking I think the Gossen Metrawatt PM XTRA will work now together with TestController - at least it does it for me with room for some improvements I guess! As I have a clamp meter, but no clamp sensor, I haven't considered the "Clip" thingie yet.
The big difference in contrast to the "ENERGY" is the fact, that the PMXTRA requires always the use of the rotary switch by hand any time you want to have another main measurement (= position of the rotary switch from 0 till 9 = 10 positions).
Therefore it is in a way useless to build a "mode popout", but as you can control quiet a lot with the Gossen Metrawatt in general, it would be a nice gimmick, especially to make a SetUp for changing some settings easier, than manually via the command line in TestController.
I think, that there is a restriction in TestController as far as the amount of "places" for the "mode popout" is concerned:#cmdModeLayout 4 10
...is obviously too much...and although I know, that it is a waste of space, I wanted to have it this way:
..., in order to have a better overview of the correct rotary switch position (red colour = does not work).
However, it is not that important as you have to be close to the DMM anyway and as I couldn't manage to get three readings to work (the one that I put a circle around), it is still not fully usable; at the moment this is the maximum of space I can use, which is of course totally fine:
As mentioned above, the rotary switch has 10 positions (from 0 till 9); you ask for the current position of the rotary switch with "POS?". If it's wrong, you don't get a reading of course.
In order not to miss something, I went through any position and function/sub-function, in order to give you the possibility to look for errors or improvements within the script.
Unfortunately there is no difference in naming when using "set?" concerning my first two not working measurements via "mode popout", as you have position 0 for VAC with VAC_Filter (1kHz) and also position 1 for VAC with VAC_Filter (1kHz), but together with a 1MOhm input, which you can see here:
I couldn't solve:Position 0 = 3rd function
VAC_F,0.6E+1 (with 1kHz-filter)Position 1 = 2nd function, all with 1MOhm input
VAC_F,0.6E+1 (with 1kHz-filter)Position 9 = 2nd function
FREQ_IAC,0.6E+3
All rotary switch positions with main- and sub-functions:
Position 0 = 4 functions
set?
;; VAC,0.6E+1
set?
;; FREQ_VAC,0.6E+3
set?
;; VAC_F,0.6E+1
set?
;; dB,0.6E+0
Position 1 = 3 functions
set?
;; VAC,0.6E+1
set?
;; VAC_F,0.6E+1
set?
;; FREQ_VAC,0.6E+3
Position 2 = 2 functions
set?
;; VDC,0.6E+0
set?
;; VACDC,0.6E+1
Position 3 = 2 functions
set?
;; FREQ_TTL,0.6E+3
set?
;; DUTY,0.1E+3
Position 4 = 1 Funktion
set?
;; RES,0.6E+8
Position 5 = 2 functions
set?
;; BUZ,0.6E+3
set?
;; DIO,0.6E+1
Position 6 = 3 functions
set?
;; TEMP_U,K
set?
;; TEMP_R,PT100
set?
;; TEMP_R,PT1000
Position 7 = 1 Funktion
set?
;; CAP,0.6E-7
Position 8 = 2 functions
set?
;; IDC,0.6E-3
set?
;; IACDC,0.6E-3
Position 9 = 2 functions
set?
;; IAC,0.6E-3
set?
;; FREQ_IAC,0.6E+3
That is my little interim result with the script looking like this and with some notes, what is still to do/solve...
#idString GMC,METRAHIT PM XTRA,
#name Gossen MetraHit PM XTRA
#handle PMXTRA
#port comFixedBaud
#baudrate 38400
#driver SCPIx
#eol \r\n
; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value VoltageDC V si VDC,DIO,Diode
#value CurrentDC A si IDC,ADC
#value VoltageAC V d4 VAC,VAC_F
#value CurrentAC A si IAC,AAC
#value VoltageACDC V d4 VACDC
#value CurrentACDC A si IACDC,AACDC
#value Resistance ohm si RES,BUZ,Resistance,Continuity
#value Capacitance F si CAP,Capacitance
#value Temperature °C d4 TEMP,TEMP_U,TEMP_R,Temperature_K,Temperature_PT100,Temperature_PT1000
#value Frequency Hz si Frequence_AC,FREQ_IAC,Frequence_TTL,FREQ_TTL
#value DutyCycle % d3 DUTY,Duty_cycle
#value Decibel dB d2 dB,Decibel
#scpiCmd *idn? txrx? idn?
:readmath: var v=split(value,"[,]");v[0]+","+v[1]+","+trim(replace(v[3],"SERIAL NO.:",""))+","+trim(replace(v[4],"SW:",""));
; How to poll for data, this is used for table and #values?
; a #askMode, #cmdMode and #prepareSample is used before this is string is used.
; This is a single line command
#askValues VAL?
#askValuesReadFormat uuuuuuxxxx
; Accept this delay when reading values (seconds), auto range can be very slow on this meter
#readingDelay 5
; Mode change have a longer delay on reading values (seconds)
#modeChangeDelay 10
; Switch meter to this mode during start, leave empty to avoid any switching
#initialMode
; String to ask about actual meter mode,
; This is a single line command
#askMode set?
#askModeMathFormat getElement(value,0,",");
#interfaceType DMM
#interface readValue 0
; Strings to configure device in different modes
; First parameter must match a #value (4 parameter) and second parameter must match what #askMode returns
; First parameter is also used in shortcut menu
; Prepare the meter to response to #askValues
#prepareSample
; Initial commands to meter when establishing connection
#initCmd txrx NOFF
#readingDelay 3
; Final command to meter before breaking connection
#finalCmd SET:APOFF 5
;#cmdModeLayout 4 10 ...is too big!
#cmdModeLayout 4 7
; Strings to configure device in different modes
; First parameter must match a #value (4 parameter) and second parameter must match what #askMode returns
; First parameter is also used in shortcut menu
#cmdMode VAC VAC
txrx sens:volt:ac:auto
#cmdMode Frequence_AC FREQ_VAC
txrx sens:freq:vac:auto,volt:rang 1000
; Does not work!
#cmdMode NoFilterFunction VAC_F
txrx sens:volt:ac:auto
#cmdMode Decibel dB
txrx sens:db
#cmdMode VAC VAC
txrx sens:volt:ac:auto
; Does not work!
#cmdMode NoFilterFunction VAC_F
txrx sens:volt:ac:auto
#cmdMode Frequence_AC FREQ_VAC
txrx sens:freq:vac:auto,volt:rang 1000
#cmdMode
#cmdMode VDC VDC
txrx sens:volt:dc:auto
#cmdMode VACDC VACDC
txrx sens:volt:acdc:auto
#cmdMode
#cmdMode
#cmdMode Frequence_TTL FREQ_TTL
txrx sens:freq_ttl:auto
#cmdMode Duty_cycle DUTY
txrx sens:duty:auto
#cmdMode
#cmdMode
#cmdMode Resistance RES
txrx sens:res:auto
#cmdMode
#cmdMode Continuity BUZ
txrx sens:short
#cmdMode Diode DIO
txrx sens:diode
#cmdMode Temperature_K TEMP
txrx sens:temp:tc k
#cmdMode Temperature_PT100 TEMP
txrx sens:temp:rtd pt100
#cmdMode Temperature_PT1000 TEMP
txrx sens:temp:rtd pt1000
#cmdMode Capacitance CAP
txrx sens:cap:auto
#cmdMode ADC IDC
txrx sens:curr:dc:auto
#cmdMode AACDC IACDC
txrx sens:curr:acdc:auto
#cmdMode AAC IAC
txrx sens:curr:ac:auto
; Does not work!
#cmdMode NoHzFunction FREQ_IAC
txrx sens:freq_iac
; For later use: I want to have a SetUp for some settings like "rate?" and "SET:RATE 00:01.0" and so on...
; Setup menu functions
; The parameters on the first line is: type name page
; Settings on the following lines are:
; read: SCPI to read value from device, is used to synchronize when opening setup page or setting equal named fields. Not always used
; readformat: Parse read value.
; write: Send the value to device, this field is used in combination with data fields in the details to send updates to device.
; tip: Add this tip to all components for this input field.
;Mode-------------------------------------------------------------------------------------------
Cheers!