Author Topic: Program that can log from many multimeters.  (Read 486964 times)

0 Members and 5 Guests are viewing this topic.

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1400 on: January 23, 2021, 08:23:40 am »
You might be able to use numberDual instead for some of the cases.
Also unreadable :(
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1401 on: January 23, 2021, 10:26:05 am »
You might be able to use numberDual instead for some of the cases.
Also unreadable :(

I tested with numberDual inside selector and it worked fine for me.
multi is fixed and I will update a new version later today.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1402 on: January 23, 2021, 02:09:17 pm »
V1.51 is up.
It contains bug fixes, a new device, some function and a bit more for GridPanel
   Added: GridPanel dual chart and min/max chart
   Fixed: Multi control did not work inside Selector control.
   Added: Tenma 72-132xx, thanks joxelito
   Changed: ID for RD6012 power supply and modified scale factor, thanks Pukker & MikeLud
   Added: Log message if #askValues is undefined.
   Fixed: String with binary values did not always convert correctly, used in protocol definitions.
   Added: binConvBit(value,index,count{,signed}) to use when processing binary answers
   Added: binConv(value,index,count{,signed{,swap}}) to use when processing binary answers
   Added: hex(value,digits), i.e. a version of hex where number of digits can be specified.




A small chart that can show two channels, i.e. a current and voltage for a power supply or load.



A min/max/average chart, this will show small spikes in a long data set.



 
The following users thanked this post: joxelito, PaWill68

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1403 on: January 23, 2021, 02:57:38 pm »
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.
On version 1.51 multi everything works correctly

There is also such a question.
How can I turn off the automatic conversion of 0.1 to 100m?
Artifacts during Selector operation and interface redrawing.
« Last Edit: January 23, 2021, 03:04:24 pm by PaWill68 »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1404 on: January 23, 2021, 03:31:23 pm »
How can I turn off the automatic conversion of 0.1 to 100m?

You cannot.
Maybe adding a tag to change number format could be useful for some devices.

Artifacts during Selector operation and interface redrawing.

I have not seen that before, I wonder where that issue comes from. As a workaround you can try using _Volts_ and see if it works.
I will see if I can reproduce it (That is required before I can fix it).
 

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1405 on: January 23, 2021, 06:43:12 pm »
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?

Code: [Select]
#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:
« Last Edit: January 23, 2021, 06:45:01 pm by PaWill68 »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1406 on: January 23, 2021, 06:53:26 pm »
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.
 

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1407 on: January 23, 2021, 08:00:45 pm »
You need to use :readmath: to scale the value.
In control Number is working correctly. There seems to be an error in Multi.

Code: [Select]
#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:
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1408 on: January 23, 2021, 08:43:30 pm »
In control Number is working correctly. There seems to be an error in Multi.

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.
 

Offline joxelito

  • Contributor
  • Posts: 13
  • Country: es
Re: Program that can log from many multimeters.
« Reply #1409 on: January 23, 2021, 09:38:25 pm »
What is wrong with this command?

I want to calculate Energy from product of Voltage * Current

Code: [Select]
;; #math EnergyCh Wh SumTimeHour 0 (nameVoltage(load) * nameValue(bmm)) failed due to *
nameVoltage(load) * nameValue(bmm)____<----____
 

Offline Helix70

  • Supporter
  • ****
  • Posts: 289
  • Country: au
  • VK4JNA
Re: Program that can log from many multimeters.
« Reply #1410 on: January 24, 2021, 02:24:46 am »
Are there any plans to support VISA drivers or Agilent 82357B USB GPIB interfaces?
 

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1411 on: January 24, 2021, 07:41:45 am »
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.
Syntactically correct?
Code: [Select]
#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:
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1412 on: January 24, 2021, 12:49:04 pm »
Are there any plans to support VISA drivers

If I find a good Java VISA library I may look at it.

or Agilent 82357B USB GPIB interfaces?

Probably not, the AR488 is a cheap and simple solution for GPIB.

 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1413 on: January 24, 2021, 12:54:41 pm »
Syntactically correct?

No:
replace(getElement(value,0),"R","")+" "+(replace(getElement(value,1),"R","")/1000.0)

If you are in doubt how something works, you can use a "displayVar()" function to show the result.


You can test expression on the command line, just do something like this:
=var value="3.4R 5R"
=replace(getElement(value,0),"R","")+" "+(replace(getElement(value,1),"R","")/1000.0)
« Last Edit: January 24, 2021, 01:16:03 pm by HKJ »
 
The following users thanked this post: PaWill68

Offline jk2017

  • Contributor
  • Posts: 14
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1414 on: January 25, 2021, 03:57:36 am »
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.

JL24 is an AC Device that uses the same protocol as Atorch AT3010, so I added it as AT3010 in Load Devices screen. When I reconnect devices, Test Controller successfully recognize it as AT3010, and says, "Found AT3010" in Commands screen. However, all values in Current Values screen are zero. Sometimes, actual values show up right away. Sometimes, actual values show up after 20-30 seconds. But most of time, I never see actual values. All I see are zeroes. I deleted the device, re-added it, and reconnected it, but that didn't make any difference. It only starts reading actual values roughly 1 out of 20 times I start Test Controller. It's very frustrating.

After reading posts in this thread's page 50 and on, I used termite to dump the data sent from JL24 over the serial port. I attached it to this post. I compared it to the AC Device protocol on the following page to make sure it's the same as AT3010, and it seems so.
https://github.com/NiceLabs/atorch-console/blob/master/docs/protocol-design.md

I also tried Atorch's PC software E_Test, and it connects and read values from JL24 right away every time, so I don't think the serial connection (which is over bluetooth) is a problem. I tried changing the baud rate in the device file, but it didn't help.

Is there any other troubleshooting I can do?

-JK
 
The following users thanked this post: Pukker

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1415 on: January 25, 2021, 01:59:05 pm »
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.
The load is off.
Code: [Select]
;; 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
Code: [Select]
;; 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
Code: [Select]
;; 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>
« Last Edit: January 25, 2021, 02:18:44 pm by PaWill68 »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1416 on: January 25, 2021, 06:24:14 pm »
Is there any other troubleshooting I can do?

I have four protocols for ATorch called: AC/DC/DCLoad/USB
If none of them works I need both communications data and display readings and I will try if I can match it up.
There is not device defined for the DC type, you can add that in the ATorchDevice file by defining a #metadef with #sections DC_DEVICE.
   
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1417 on: January 25, 2021, 06:26:42 pm »
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.

Look like you have problems with a leading space, try adding a trim(replace(...))
 
The following users thanked this post: PaWill68

Offline electronrancher

  • Newbie
  • Posts: 3
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1418 on: January 26, 2021, 03:47:50 am »
Hello HKJ,

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.

My current formatting is something like
V=2500mV
I=372mA
Q=15873mAh

Number of digits in each field is currently variable but could me made fixed if it is easier.
Do you have a suggestion on how i could parse it in to testcontroller?  Thanks in advance for any advice
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1419 on: January 26, 2021, 06:42:47 am »
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.

A simple SCPI do not take up much space, this one will work:
Code: [Select]

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);
        }
      }
    }
  }
}

The definition file:
Code: [Select]

; 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

The above device is for a ATMega 32U4, serial port must be initialized different for other ATMega processors.


For this to work well it is best if the loop is performed many times each second.
« Last Edit: January 26, 2021, 07:08:08 am by HKJ »
 
The following users thanked this post: joxelito

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1420 on: January 26, 2021, 08:37:52 am »
Look like you have problems with a leading space, try adding a trim(replace(...))
Thanks HKJ. This is the right decision.
I am not good at the syntax of the TestController program. How to write a value depending on another selected value in radio?
Code: [Select]
#cmdSetup radio Range_I_
:read: LOAD:CRANge?;
:write: LOAD:CRANge #;[300]; <<--here
:string:
Low_(3.100A)  LOW
High_(42.00A) HIGH
Something like that
if LOAD:CRANge?=="HIGH"  then :write: LOAD:CRANge #;[300];CURR:IMAX 42 else :write: LOAD:CRANge #;[300];CURR:IMAX 3.1
« Last Edit: January 26, 2021, 09:02:36 am by PaWill68 »
 
The following users thanked this post: electronrancher

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1421 on: January 26, 2021, 10:39:40 am »
Something like that
if LOAD:CRANge?=="HIGH"  then :write: LOAD:CRANge #;[300];CURR:IMAX 42 else :write: LOAD:CRANge #;[300];CURR:IMAX 3.1

With two values you can use: (value=="HIGH"?32:3.1), i.e. the ?: operator
TC maps the value to the variable "value" when using expressions, for lines without expressions # can be used.

The write statement would be:
:write: LOAD:CRANge (value);[300];CURR:IMAX (value=="HIGH"?32:3.1)
 
The following users thanked this post: PaWill68

Offline PaWill68

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ru
Re: Program that can log from many multimeters.
« Reply #1422 on: January 26, 2021, 06:31:46 pm »
:write: LOAD:CRANge (value);[300];CURR:IMAX (value=="HIGH"?32:3.1)
Thanks HKJ.
How can you dynamically change the limit values? For example in the photo.
Perhaps via a global variable or is there another way?
 

Offline electronrancher

  • Newbie
  • Posts: 3
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1423 on: January 26, 2021, 10:54:24 pm »
Thank you for the code and definition.  I am seriously considering changing over my software, but I am reluctant to tear up my already working command interpreter.  Maybe I will clean up and finish this version and switch it over to SCPI in the next revision.

So am I correct in thinking there is not an easy way for testcontroller to parse my output without querying?
 

Offline Pukker

  • Regular Contributor
  • *
  • Posts: 148
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1424 on: January 27, 2021, 07:11:48 am »
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.

Hello jk2017,
You have succes with DL24P.
Please can you share your device file for it.
I have faulty readings. Some values are correct,
some not all digits and some complete wrong.
I couldn't fix it myself.
Thanks anyway.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf