You might be able to use numberDual instead for some of the cases.
You might be able to use numberDual instead for some of the cases.Also unreadable
That sounds like a bug in my code, I will have to look at it, probably tomorrow.
You might be able to use numberDual instead for some of the cases.
How can I turn off the automatic conversion of 0.1 to 100m?
Artifacts during Selector operation and interface redrawing.
#cmdSetup multi Level_A_C
:read: CURR:TA?;TIME:WA?;
:readmath: value.replace("R","")
:write: CURR:TA #;[300];TIME:WA #;[300];
:enable: Tran_State=="CC"
:tip: Set the dynamic test A value
Number I A 0 40
Number T s 0 60000
:updatemodechange:
Help me figure out the timer.
To write the value I need to write the value in seconds
TIME: WA 59.999
TIME: WA? the answer is obtained in microseconds
TIME: WA 59999
How to format a response or record in the MULTI control?
You need to use :readmath: to scale the value.
#cmdSetup number Timer test
:read: TIME:WA?;
:readmath: (value.replace("R",""))/1000
:write: TIME:WA #;[300];
:update: Level_A_C
:tip: Set the delay shutdown time to query the current delay shutdown time value
Seconds 0 60
:updatemodechange:
#cmdSetup multi Level_A_C
:read: CURR:TA?;TIME:WA?;
:readmath: value.replace("R","");(value.replace("R",""))/1000
:write: CURR:TA #;[300];TIME:WA #;[300];
:enable: Tran_State=="CC"
:update: Timer
:tip: Set the dynamic test A value
Number Curr A 0 40
Number Width s 0 60
:updatemodechange:
In control Number is working correctly. There seems to be an error in Multi.
;; #math EnergyCh Wh SumTimeHour 0 (nameVoltage(load) * nameValue(bmm)) failed due to *
nameVoltage(load) * nameValue(bmm)____<----____
The problem is that you are getting a string with both values, you need to add code to split the string and then scale each value according and then return a string with the correct values. This is not a simple operation, but not that hard either.
#cmdSetup multi Level_A_C
:read: CURR:TA?;TIME:WA?;
:readmath: getElement(value,0).replace("R","")+" "+ (getElement(value,1).replace("R",""))/1000
:write: CURR:TA #;[300];TIME:WA #;[300];
:enable: Tran_State=="CC"
:update: Timer
:tip: Set the dynamic test A value
Number Curr A 0 40
Number Width s 0 60
:updatemodechange:
Are there any plans to support VISA drivers
or Agilent 82357B USB GPIB interfaces?
Syntactically correct?
;; ET5410: Tx <MEAS:CURR?>
;; ET5410: Rx <R 0.000>
;; ET5410: Tx <MEAS:VOLT?>
;; ET5410: Rx <R15.833>
;; ET5410: Tx <MEAS:POWE?>
;; ET5410: Rx <R 0.00>
;; ET5410: Tx <MEAS:RESI?>
;; ET5410: Rx <R 0.000>
;; ET5410: Tx <BATT:CAPA?>
;; ET5410: Rx <R 0.000>
;; ET5410: Rx after :readmath: replace(value,"R","") < 0.000 15.833 0.00 0.000 0.000>
;; ET5410: Rx as numbers <0.0 0.0 15.833 0.0 0.0>
The load is on, current =15A;; ET5410: Tx <MEAS:CURR?>
;; ET5410: Rx <R15.001>
;; ET5410: Tx <MEAS:VOLT?>
;; ET5410: Rx <R14.462>
;; ET5410: Tx <MEAS:POWE?>
;; ET5410: Rx <R216.60>
;; ET5410: Tx <MEAS:RESI?>
;; ET5410: Rx <R 0.96>
;; ET5410: Tx <BATT:CAPA?>
;; ET5410: Rx <R 0.006>
;; ET5410: Rx after :readmath: replace(value,"R","") <15.001 14.462 216.60 0.96 0.006>
;; ET5410: Rx as numbers <15.001 14.462 216.6 0.96 0.006>
The load is on, current =2.2A;; ET5410: Tx <MEAS:CURR?>
;; ET5410: Rx <R 2.208>
;; ET5410: Tx <MEAS:VOLT?>
;; ET5410: Rx <R15.346>
;; ET5410: Tx <MEAS:POWE?>
;; ET5410: Rx <R 0.00>
;; ET5410: Tx <MEAS:RESI?>
;; ET5410: Rx <R 0.000>
;; ET5410: Tx <BATT:CAPA?>
;; ET5410: Rx <R 0.066>
;; ET5410: Rx after :readmath: replace(value,"R","") < 2.208 15.346 0.00 0.000 0.066>
;; ET5410: Rx as numbers <0.0 2.208 15.346 0.0 0.0>
Is there any other troubleshooting I can do?
HKJ, I have a problem again. String formatting happens in a strange way. I don’t know how to solve this issue.
An extra section is added at the beginning and the last one is cut off.
I would like to log from an arduino project, multiple datas that are sent over USB serial every 1 second or so.
I do not see an good example of how to parse ascii text, could you point me to one? I can surely format the text in any convenient manner the tool needs,, but my micro does not have enough space to impement SCPI.
const int BUF_SIZE=100;
char cmdBuf[BUF_SIZE];
double s1=0;
void setup() {
Serial.begin(9600);
unsigned long t = millis();
while (!Serial && millis() - t < 3000); // Wait for USB connection to get ready, but do not hang when running without USB
}
void loop() {
if (Serial.available() > 0) {
int n = Serial.readBytesUntil('\n', cmdBuf, BUF_SIZE-1);
if (n > 0) {
*(cmdBuf + n) = 0;
strlwr(cmdBuf);
char* cmd = strtok(cmdBuf, " ");
if (strcmp(cmd, "*idn?") == 0) {
// Device name
Serial.print("HKJ,Test,1,1\n");
} else if (strcmp(cmd, "values?") == 0) {
// Measured values
Serial.print("1 2 3\n");
} else if (strcmp(cmd, "set?") == 0) {
// Read setting
Serial.print(s1);
Serial.print("\n");
} else if (strcmp(cmd, "set") == 0) {
// Set setting
char *p = strtok(NULL, " ");
if (p != NULL) {
s1 = atof(p);
}
}
}
}
}
; TestController must be restarted before any changes in this file will be used.
; Manual is here: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html
#idString HKJ,Test,
#name HKJ Test
#handle Test
#port comfixedbaud
;#port com
; Alternate port types: comnobaud or com, com lets the user define baudrate on the "Load devices" page
#baudrate 115200
; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
; Format: #value ColumnName Unit Format {Selector}
; Selector is only used when column layout varies with mode, this often require the use of #cmdMode
#value Voltage1 V X8
#value Voltage2 V X8
#value Voltage3 V X8
; 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.
; Number of returned values must match number of columns defined with #value
; This is a single line command
#askValues values?
#cmdSetup number Set
:read: set?
:write: set #
V 0 500 t1
Look like you have problems with a leading space, try adding a trim(replace(...))
#cmdSetup radio Range_I_
:read: LOAD:CRANge?;
:write: LOAD:CRANge #;[300]; <<--here
:string:
Low_(3.100A) LOW
High_(42.00A) HIGH
Something like that Something like that
if LOAD:CRANge?=="HIGH" then :write: LOAD:CRANge #;[300];CURR:IMAX 42 else :write: LOAD:CRANge #;[300];CURR:IMAX 3.1
:write: LOAD:CRANge (value);[300];CURR:IMAX (value=="HIGH"?32:3.1)
Hello HKJ,
Thanks for creating and maintaining a very useful program. I have been using TestController with Atorch DL24P successfully. It connects to DL24P right away every time. However, I recently added another Atorch device called JL24, but Test Controller is not working with it reliably. Test Controller can connect to JL24, but it doesn't always start reading values from it.