#scpiCmd setKey
:setvar: key=1234;
#initCmd setKey;
If you want to define more variables you can do it in the same command:
#scpiCmd setKey
:setvar: key=1234;var key2=5678;var key3=9012;
I thought I understood, but..........
This works:#initCmd address 5
#scpiCmd Enable holding 0x4000 1234
#scpiCmd Ratio? holding? 0x4001
:readmath: value<0?getElement("OK,Illegal Function,Illegal Data Address,Illegal Data Value,Slave Device Failure,Acknowledge,Slave Device Busy,Negative Acknowledge,Memory Parity Error,Gateway Path Unavailable,Gateway Target Device Failed to Respond",abs(value),","):value
#scpiCmd Ratio holding 0x4001 (value)
#cmdSetup number Ratio Settings
:read: Enable;Ratio?
:write: Ratio
N1/N2 50 3000
This does not work:#scpiCmd SetVars
:setvar: Key=1234;
#initCmd address 5;SetVars;
#scpiCmd Enable holding 0x4000 Key
#scpiCmd Ratio? holding? 0x4001
:readmath: value<0?getElement("OK,Illegal Function,Illegal Data Address,Illegal Data Value,Slave Device Failure,Acknowledge,Slave Device Busy,Negative Acknowledge,Memory Parity Error,Gateway Path Unavailable,Gateway Target Device Failed to Respond",abs(value),","):value
#scpiCmd Ratio holding 0x4001 (value)
#cmdSetup number Ratio Settings
:read: Enable;Ratio?
:write: Ratio
N1/N2 50 3000
Evidently, there is still something I did not understand.