;Fluke 45
;RS 232 - GPIB may be later 
;Rev. 0.9 - my first try - Nov 2020

#author Bad Drive


#idString FLUKE, 45,
#name Fluke 45
#handle Fluke 45
#port comfixedbaud
; Alternate port types: comnobaud or com, com lets the user define baudrate on the "Load devices" page
#baudrate 9600n81
#driver SCPIx
#removePromptChars 4


#cmdSetup radio RATE
:write: RATE
:read: RATE?
:string:
Slow S
Medium M
Fast F

#cmdSetup buttons RANGE
:write:
:tip: Enters AUTO RANGE or set current Range fixed
Auto AUTO
Fixed FIXED 

#cmdSetup buttons HOLD_Main
:write:
:tip: Force reading and HOLD  / RETURN to normal operation
HOLD HOLD
RETURN HOLDCLR

#cmdSetup comboboxhot Main_Display
:write: 
:read: FUNC1?
VAC VAC
VDC VDC
VACDC VACDC
AAC AAC
ADC ADC
AACDC AACDC
ADC ADC
DIODE DIODE
FREQ FREQ
OHMS OHMS

#cmdSetup comboboxhot 2nd_Display
:write: 
:read: FUNC2?
VAC VAC2
VDC VDC2
AAC AAC2
ADC ADC2
ADC ADC2
DIODE DIODE2
FREQ FREQ2
OHMS OHMS2
2nd_OFF CLR2
 

; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value VoltageDC V D4 VDC, VACDC, Diode
#value CurrentDC A si ADC, AADC
#value VoltageAC V D4 VAC
#value CurrentAC A si AAC
#value Resistance Ohms si ohms
#value Frequency Hz si

; 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 VAL1?
;#removePromptChars 4



; When it gets extra measurements they will be put into the log window.
; It may be due to a timeout on reading the data or because it receives two lines of data.
; You can change the timeout with (Default is 1 second)
;#readingDelay 3
#modeChangeDelay 3
 

; Switch meter to this mode during start, leave empty to avoid any switching
#initialMode VDC

; String to ask about actual meter mode, 
; This is a single line command
#askMode func1?



; 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 conf
#mayModifyMode meas
#mayModifyMode abor
#mayModifyMode trig

#interfaceType DMM BMM
#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

#cmdMode VDC VDC
*cls
VDC

#cmdMode VAC VAC
*cls;
VAC

#cmdMode Ohms OHMS
*cls;
OHMS

#cmdMode Diod DIODE
*cls;
DIODE

#cmdMode Hz FREQ
*cls;
FREQ

#cmdMode ADC ADC
*cls;
ADC

#cmdMode AAC ADC
*cls;
AAC

; Prepare the meter to response to #askValues
#prepareSample

; Initial commands to meter when establishing connection
#initCmd *cls


; Final command to meter before breaking connection
#finalCmd *cls
*rst


