

#idString THURLBY THANDAR, CPX200DP, 
#name TTi CPX200DP
#handle CPX200D
#port 9221

; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value Voltage1 V D2 
#value Current1 A D2 
#value Voltage2 V D2 
#value Current2 A D2

; 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 V1O?;I1O?;V2O?;I2O?;

; Format of answer: f=float, u=remove trailing letters, x=skip
#askValuesReadFormat uuuu

; Accept this delay when reading values (seconds)
;#readingDelay 2

; 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 

; When one of these commands are used through the command interface a new configuration will be done before using #askMode
; Only one word for each #mayModifyMode
; Specify command without initial colon and in the shortest possible form
;#mayModifyMode 



; Prepare the meter to response to #askValues
#prepareSample


; Initial commands to meter when establishing connection
#initCmd  


; Final command to meter before breaking connection
#finalCmd OP1 0;V1 0;I1 0;OP2 0;V2 0;I2 0;local

#outputOff OP1 0;OP2 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
;#cmdMode 


#interfaceType PS PS:2
#interface setVoltage V(channel) (value)
#interface setCurrent I(channel) (value)
#interface setOVP OVP(channel) (value)
#interface setOCP OCP(channel) (value)

interface setOn OP(channel) (value)
#interface getVoltage V(channel)?
:readFormat: xf
#interface getCurrent I(channel)?
:readFormat: xf
#interface getOVP OVP(channel)?
:readFormat: xf
#interface getOCP OCP(channel)?
:readFormat: xf
#interface getOn OP(channel)?
#interface readVoltage 0 2
#interface readCurrent 1 3


; 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.


#cmdSetup radio Voltage Output_1
:read: V1?;
:readFormat: xf
:write: V1 #; OP1 1
:tip: Setup this voltage, turn output on
3.3V 3.3
5V 5.0
12V 12.0
24V 24.0
60V 60.0

#cmdSetup radio Current Output_1
:read: I1?
:readFormat: xf
:write: I1
:tip: Output will current limit at this current
100mA 0.1
300mA 0.3
1A 1.0
3A 3.0
10A 10.0



#cmdSetup buttonsOn Output Output_1
:read: OP1?
:write: TRIPRST;*cls;OP1
:tip: Turn output on or off
:updatealloff:
Off 0
On 1


#cmdSetup number Voltage Output_1
:read: V1?
:readformat: xf
:write: V1
:tip: Setup this voltage, do not turn output on/off
Volt 0 60


#cmdSetup number Current Output_1
:read: I1?
:readformat: xf
:write: I1
:tip: Setup this current, do not turn output on/off
Amps 0.0001 10


#cmdSetup number OverVoltage Output_1
:read: OVP1?
:write: OVP1
:tip: Output will turn off if it is above this voltage
Volt 1 66

#cmdSetup number OverCurrent Output_1
:read: OCP1?
:write: OCP1
:tip: Output will turn off if it is above this current
Amps 0.01 11





#cmdSetup radio Voltage Output_2
:read: V2?;
:readFormat: xf
:write: V2 #; OP2 1
:tip: Setup this voltage, turn output on
:enable: Config==0
3.3V 3.3
5V 5.0
12V 12.0
24V 24.0
60V 60.0

#cmdSetup radio Current Output_2
:read: I2?
:readFormat: xf
:write: I2
:tip: Output will current limit at this current
100mA 0.1
300mA 0.3
1A 1.0
3A 3.0
10A 10.0



#cmdSetup buttonsOn Output Output_2
:read: OP2?
:write: TRIPRST;*cls;OP2
:tip: Turn output on or off
:update: Config
:updatealloff:
Off 0
On 1


#cmdSetup number Voltage Output_2
:read: V2?
:readformat: xf
:write: V2
:tip: Setup this voltage, do not turn output on/off
:enable: Config==0
Volt 0 60


#cmdSetup number Current Output_2
:read: I2?
:readformat: xf
:write: I2
:tip: Setup this current, do not turn output on/off
Amps 0.0001 10


#cmdSetup number OverVoltage Output_2
:read: OVP2?
:write: OVP2
:tip: Output will turn off if it is above this voltage
Volt 1 66

#cmdSetup number OverCurrent Output_2
:read: OCP2?
:write: OCP2
:tip: Output will turn off if it is above this current
Amps 0.01 11










#cmdSetup radio Config
:read: CONFIG?
:write: CONFIG
:update: Voltage
:enable: !Output_2.Output
Independently 2
Tracking 0



#cmdSetup number Tracking_ratio
:read: RATIO?
:write: RATIO
:tip: Specify output 2 compare to output 1
:update: Voltage
Ration 0 100


#cmdSetup buttons All_Output
:write: TRIPRST;*cls;
:tip: Turn output on or off
:update: Output
Off OP1_0;OP2_0
On OP1_1;OP2_1


