﻿

#metadef
#idString Riden,Riden DPS5015
#name Riden DPS5015
#handle DPS5015
#author aszasza + rachdatu
#replacetext ModelId 5015
#replaceText MaxCurrent 15.0
#replaceText MaxVoltage 50.00
#replaceText MaxOPP 600
#replaceText MaxOCP 15.1
#replaceText MaxOVP 51
#replaceText CurrentScaleFactor 100


#metadef
#idString Riden,Riden DPS5005
#name Riden DPS5005
#handle DPS5005
#author aszasza + rachdatu
#replacetext ModelId 5005
#removeline 12A
#removeline 10A
#removeline 8A
#removeline 60V
#replaceText MaxCurrent 5.0
#replaceText MaxVoltage 50.00
#replaceText MaxOPP 265
#replaceText MaxOCP 5.2
#replaceText MaxOCV 51
#replaceText CurrentScaleFactor 1000

#metadef
#idString Riden,Riden DPH5005
#name Riden DPH5005
#handle DPH5005
#author rachdatu
#replacetext ModelId 5205
#removeline 12A
#removeline 10A
#removeline 8A
#removeline 60V
#replaceText MaxCurrent 5.0
#replaceText MaxVoltage 50.00
#replaceText MaxOPP 265
#replaceText MaxOCP 5.2
#replaceText MaxOCV 51
#replaceText CurrentScaleFactor 1000




#meta
#idString Riden,Riden DPH5205
#name Riden DPH5005
#handle DPH5205
#port comfixedbaud
#baudrate 9600
#driver Modbus
#author rachdatu
#verifyDevice ModelId Model?




; R: read, W: write

; Voltage setting R/W
#scpiCmd VSet? holding? 0x00 /100
#scpiCmd VSet holding 0x00 (value) *100

; Current setting R/W
#scpiCmd ISet? holding? 0x01 /CurrentScaleFactor
#scpiCmd ISet holding 0x01 (value) *CurrentScaleFactor

; Output voltage display R
#scpiCmd VOut? holding? 0x02 /100

; Output current display R
#scpiCmd IOut? holding? 0x03 /CurrentScaleFactor

; Output power display R
#scpiCmd Power? holding? 0x04 /100

; Output Input voltage display R
#scpiCmd Uin? holding? 0x05 /100

; Key lock (0-1) R/W
#scpiCmd Lock? holding? 0x06
#scpiCmd Lock holding? 0x06 

; Protection status (0:running, 1:OVP, 2:OCP, 3:OPP) R
#scpiCmd Protect? holding? 0x07

; Constant voltage/constant current status (0:CV, 1:CC)
#scpiCmd CVCC? holding? 0x08

; Switch output state (0:close, 1:open) R/W
#scpiCmd OUTPUT? holding? 0x09
#scpiCmd OUTPUT holding 0x09 (value)

; Backlight brightness level (0-5) R/W
#scpiCmd BLED? holding? 0x0A
#scpiCmd BLED holding 0x0A (value)

; Model
#scpiCmd Model? holding? 0x0B

; Version
#scpiCmd Version? holding? 0x0C

; Shortcut to bring up the required data set (M0 to M9) R/W
#scpiCmd ExtractM? holding? 0x23
#scpiCmd ExtractM holding 0x23 (value)

#scpiCmd MN? holding? 0x50
:setvar: MNS=int(value)
#scpiCmd MN holding 0x50 (value) 
#scpiCmd MV? holding? (MNS) /100
#scpiCmd MV holding (MNS) (value) *100
#scpiCmd MI? holding? (MNS+1) /CurrentScaleFactor
#scpiCmd MI holding (MNS+1) (value) *CurrentScaleFactor
#scpiCmd OVP? holding? (MNS+2) /100
#scpiCmd OVP holding (MNS+2) (value) *100
#scpiCmd OCP? holding? (MNS+3) /100
#scpiCmd OCP holding (MNS+3) (value) *100
#scpiCmd OPP? holding? (MNS+4) /10
#scpiCmd OPP holding (MNS+4) (value) *10

; Over-voltage protection R/W
#scpiCmd SOVP? holding? 0x52 /100
#scpiCmd SOVP holding 0x52 (value) *100

; Over-current protection R/W
#scpiCmd SOCP? holding? 0x53 /CurrentScaleFactor
#scpiCmd SOCP holding 0x53 (value) *CurrentScaleFactor

; Over-power protection R/W
#scpiCmd SOPP? holding? 0x54 /10
#scpiCmd SOPP holding 0x54 (value) *10

; Memory Preset Number R/W
#scpiCmd MPRE? holding? 0x56
#scpiCmd MPRE holding 0x56 (value)

; Power output switch R/W
#scpiCmd SINI? holding? 0x57
#scpiCmd SINI holding 0x57 (value)

; VSet, ISet, VOut, IOut, Power
#scpiCmd values? holding? 0x00 /100;holding? 0x01 /CurrentScaleFactor;holding? 0x02 /100;holding? 0x03 /CurrentScaleFactor;holding? 0x04 /100

; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value VoltageSet V D2 
#value CurrentSet A D3
#value Voltage V D2 
#value Current A D3 
#value Power W D2

; This is a single line command, definition just above
#askValues values?

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

; Initial commands to meter when establishing connection
#initCmd MN?

; Final command to meter before breaking connection
#finalCmd OUTPUT 0

; Used when output off button is pressed
#outputOff OUTPUT 0

#interfaceType PS
#interface setVoltage VSet (value)
#interface setCurrent ISet (value)
#interface setOn OUTPUT (value)
#interface getVoltage VOut?
#interface getCurrent IOut?
#interface getOn OUTPUT?
#interface readVoltage 0
#interface readCurrent 1

# Buttons for all tabs
#cmdSetup buttonsOn Output
:read: OUTPUT?
:write: OUTPUT 
:tip: Turn output on or off
:updatealloff:
:update: Output
:updatedelayed: 0.3 
Off 0
On 1

; Main tab
#cmdSetup radio Voltage Main 
:read: VSet?
:write: VSet
:update: Voltage
:update: 0.3 
:tip: Setup this voltage
3.3V 3.3
5V 5.0
9V 9.0
12V 12.0
13,8V 13.8
19V 19.0
24V 24.0
36V 36.0
48V 48.0
60V 60.0

#cmdSetup radio Current Main 
:read: ISet?
:write: ISet
:update: Current
:updatedelayed: 0.3 
:tip: Output will current limit at this current
100mA 0.1
250mA 0.25
500mA 0.5
1A 1.0
2A 2.0
3A 3.0
5A 5.0
8A 8.0
10A 10.0
12A 12.0

#cmdSetup number Voltage Main 
:read: VSet?
:write: VSet
:tip: Setting this voltage, does not turn output on/off
V 0.00 MaxVoltage

#cmdSetup number Current Main
:read: ISet?
:write: ISet
:tip: Setting this current, does not turn output on/off
A 0.000 MaxCurrent


#cmdSetup combobox Memory Main
:read: ExtractM?
:write: ExtractM 
:tip: Setting this memory, turns output off
:update: Voltage Current
:updatedelayed: 0.3 
M0 0
M1 1
M2 2
M3 3
M4 4
M5 5
M6 6
M7 7
M8 8
M9 9

#cmdSetup indicatornum Status Main
:read: CVCC?
CV 0 blue
CC 1 red

#cmdSetup indicatornum Status Main
:read: Protect?
OK 0 blue
OVP 1 red
OCP 2 red
OPP 3 red

#cmdSetup info Input_Voltage Main
:read: Uin?
V

#cmdSetup number OVP Limits
:read: SOVP?
:write: SOVP
:tip: Output will turn off if it is above this voltage
V 0 MaxOVP

#cmdSetup number OCP Limits
:read: SOCP?
:write: SOCP
:tip: Output will turn off if it is above this current
A 0 MaxOCP

#cmdSetup number OPP Limits
:read: SOPP?
:write: SOPP
:tip: Output will turn off if it is above this power
W 0 MaxOPP


#cmdSetup radio Boot_Power Settings
:read: SINI?
:write: SINI
:tip: Turn on the “Boot Power”, it will turn on the output automatically when started
On 1
Off 0

#cmdSetup slider Backlight Settings
:read: BLED?
:write: BLED
:tip: 0=Minimal brightness, 5=Maximal brightness
_ 0 5

; Values in combo in decimal
#cmdSetup comboboxhot Memory Memory
:read: MN?
:write: MN
:update: V-Set I-Set OVP OCP OPP
:updatedelayed: 0.3
M0 80
M1 96
M2 112
M3 128
M4 144
M5 160
M6 176
M7 192
M8 208
M9 224

#cmdSetup number V-Set Memory
:read: MV?
:write: MV
:tip: Output will turn off if it is above this voltage
V 0 MaxVoltage

#cmdSetup number I-Set Memory
:read: MI?
:write: MI
:tip: Output will turn off if it is above this current
I 0 MaxCurrent

#cmdSetup number OVP Memory
:read: OVP?
:write: OVP
:tip: Output will turn off if it is above this voltage
V 0 MaxOVP

#cmdSetup number OCP Memory
:read: OCP?
:write: OCP
:tip: Output will turn off if it is above this current
I 0 MaxOCP

#cmdSetup number OPP Memory
:read: OPP?
:write: OPP
:tip: Output will turn off if it is above this power
W 0 MaxOPP



