Author Topic: Program that can log/control many multimeters and other devices.  (Read 1808398 times)

Gertjan and 212 Guests are viewing this topic.

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5425 on: January 14, 2026, 08:51:18 am »
You need to put those statements in your definition file. You cannot run them directly from the command line.
They say attention is a shovel. It's time to dig 'em out.
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5426 on: January 14, 2026, 10:53:35 am »
I tried the below and also the exact example from the TC page but again invalid error.

You deleted your last post before I could answer it, can I assume you solved the problem?

When tested definition TC has a great tool called debug mode, there is a special .bat file to start it. It will show communication to the device and how TC process it.
 
The following users thanked this post: 2X

Offline 2X

  • Frequent Contributor
  • **
  • Posts: 726
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5427 on: January 14, 2026, 11:26:51 am »
I tried the below and also the exact example from the TC page but again invalid error.

You deleted your last post before I could answer it, can I assume you solved the problem?

When tested definition TC has a great tool called debug mode, there is a special .bat file to start it. It will show communication to the device and how TC process it.

Thank you very much for all the help.
I solve the problem (I restart the TC again and it worked).
#value Voltage_CH1 V SI
#askValues DVM1:RESult?


Something else. I triyed to read the two voltmeters simultaneously, but only one it works (the second column is created but no data received).
#value Voltage_CH1 V SI
#askValues DVM1:RESult?
#value Voltage_CH2 V SI
#askValues DVM2:RESult?


I have a query... how the value from the result command "#askValues DVM1:RESult?" knows in which column to assigned? Maybe this is the problem?

 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5428 on: January 14, 2026, 11:39:03 am »
Something else. I triyed to read the two voltmeters simultaneously, but only one it works (the second column is created but no data received).
#value Voltage_CH1 V SI
#askValues DVM1:RESult?
#value Voltage_CH2 V SI
#askValues DVM2:RESult?


Only one #askValues command is allowed, all commands to read must be placed after it with a ; between them.

#askValues DVM1:RESult?;DVM2:RESult?[/b][/b]

I have a query... how the value from the result command "#askValues DVM1:RESult?" knows in which column to assigned? Maybe this is the problem?

They are taken in sequence, first number goes in first column, second number goes in second column, etc.
You can do some string processing (#askValuesMathFormat) before parsing the numbers and you can switch between a couple of parsers (#askValuesReadFormat), but in most cases it is not needed.
« Last Edit: January 14, 2026, 12:15:58 pm by HKJ »
 
The following users thanked this post: 2X

Offline 2X

  • Frequent Contributor
  • **
  • Posts: 726
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5429 on: January 14, 2026, 12:08:12 pm »
Something else. I triyed to read the two voltmeters simultaneously, but only one it works (the second column is created but no data received).
#value Voltage_CH1 V SI
#askValues DVM1:RESult?
#value Voltage_CH2 V SI
#askValues DVM2:RESult?


Only one #askValues command is allowed, all commands to read must be placed after it with a ; between them.

#askValues DVM1:RESult?;#askValues DVM2:RESult?[/b][/b]

I have a query... how the value from the result command "#askValues DVM1:RESult?" knows in which column to assigned? Maybe this is the problem?

They are taken in sequence, first number goes in first column, second number goes in second column, etc.
You can do some string processing (#askValuesMathFormat) before parsing the numbers and you can switch between a couple of parsers (#askValuesReadFormat), but in most cases it is not needed.

I placed this:
#value Voltage_CH1 V SI
#value Voltage_CH2 V SI
#askValues DVM1:RESult?;#askValues DVM2:RESult?

but still the second column "Voltage_CH2" for some reason is zero.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5430 on: January 14, 2026, 12:15:46 pm »

I placed this:
#value Voltage_CH1 V SI
#value Voltage_CH2 V SI
#askValues DVM1:RESult?;#askValues DVM2:RESult?

but still the second column "Voltage_CH2" for some reason is zero.

Sorry, I did a mistake, the correct line is:
#askValues DVM1:RESult?;DVM2:RESult?
 
The following users thanked this post: 2X

Offline 2X

  • Frequent Contributor
  • **
  • Posts: 726
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5431 on: January 14, 2026, 12:50:36 pm »

I placed this:
#value Voltage_CH1 V SI
#value Voltage_CH2 V SI
#askValues DVM1:RESult?;#askValues DVM2:RESult?

but still the second column "Voltage_CH2" for some reason is zero.


#askValues DVM1:RESult?; DVM2:RESult?; DVM3:RESult?; DVM4:RESult?
; ------------------------------------------------------------------------


Sorry, I did a mistake, the correct line is:
#askValues DVM1:RESult?;DVM2:RESult?

Now worked flawless and with 4 channels. Thanks!!!!
Two more queries if you please.
1. With semicolon ";" can we write a comment at a definition file?
2. There is a way to define the width of each column in "Table" tab (Picture: Columns Width)?

Commands where I wrote in the definition file:
; ------------------------------------------------------------------------
; RTB24 Reading Values from 4 Digital Voltmeters
#value DVM1_Voltage V SI
#value DVM2_Voltage V SI
#value DVM3_Voltage V SI
#value DVM4_Voltage V SI

#askValues DVM1:RESult?;DVM2:RESult?

; ------------------------------------------------------------------------
« Last Edit: January 17, 2026, 02:27:15 pm by 2X »
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5432 on: January 14, 2026, 01:15:19 pm »
Two more queries if you please.
1. With semicolon ";" can we write a comment at a definition file?

Yes, but semicolon must be at the start of the line.
This works in most of TC's files.

2. There is a way to define the width of each column in "Table" tab (Picture: Columns Width)?

No, you have to adjust them manually each time.
 
The following users thanked this post: 2X

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5433 on: January 14, 2026, 03:29:02 pm »
How do I convert a value of 19792 which is 0x4D50 into the letters MP ?

I have tried all functions and bytes gets it to $4D50$ when using high byte shift and low byte.

No luck of converting it into an ascii string.

In decimal I got it to
Code: [Select]
:readmath: ((value >> 8) & 0xFF)+" "+(value & 0xFF)) which results into 77 80
If I type bytes(77,80) into the Calulator popup I get MP but I cannot get the comma into my string.
« Last Edit: January 14, 2026, 04:24:49 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5434 on: January 14, 2026, 05:56:26 pm »
How do I convert a value of 19792 which is 0x4D50 into the letters MP ?

I have tried all functions and bytes gets it to $4D50$ when using high byte shift and low byte.

No luck of converting it into an ascii string.

In decimal I got it to
Code: [Select]
:readmath: ((value >> 8) & 0xFF)+" "+(value & 0xFF)) which results into 77 80
If I type bytes(77,80) into the Calulator popup I get MP but I cannot get the comma into my string.

Check the function binConvString()
https://lygte-info.dk/project/TestControllerFunctions%20UK.html#binConvString

 

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5435 on: January 14, 2026, 06:55:17 pm »
Thank you !!

Code: [Select]
:readmath: binConvString(((value >> 8) & 0xFF),0,1)+binConvString((value & 0xFF),0,1) did the trick.

I guess I was not looking at it since it starts with "bin".

Code: [Select]
:readmath: binConvString(int(value),0,2) also works.
« Last Edit: January 14, 2026, 07:35:52 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5436 on: January 14, 2026, 07:06:25 pm »
Thank you !!

Code: [Select]
:readmath: binConvString(((value >> 8) & 0xFF),0,1)+binConvString((value & 0xFF),0,1) did the trick.

I guess I was not looking at it since it starts with "bin".


Cant you do it with binConvString((value ,0,2) or binConvString((value ,0,2,"ISO-8859-1",1)

There is a couple of binConv functions to do some conversion and byte masking/swapping
 

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5437 on: January 14, 2026, 07:16:51 pm »
I needed to typecast to int() since the value comes from answer of holding? which is a string.

I found that very strange since holding registers generally contain numbers, so binConvString(value ,0,2) was returning the same as value.

binConvString(int(value),0,2) worked for me.
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5438 on: January 14, 2026, 07:33:26 pm »
I needed to typecast to int() since the value comes from answer of holding? which is a string.

That is because everything is handled as SCPI commands that returns a string, usually you do not see it due to the automatic type conversion.
 

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5439 on: January 16, 2026, 07:46:17 am »
While working decoding another register i noticed that TC does not seem to support unsigned right shift.

Code: [Select]
:readmath: ((value >> 8) & 0xFF)+" "+((value >> 4) & 0xF)+" "+(value & 0xF)Works and since my top bit in my case 0x0233 is always 0 it works.

But I wanted this
Code: [Select]
:readmath: ((value >>> 8) & 0xFF)+" "+((value >>> 4) & 0xF)+" "+(value & 0xF)But then I get a Java exception on >>> (unsigned right shift).

Note, my value comes from an answer of holding? so it is a string.

How to I unsigned right shift ?
« Last Edit: January 16, 2026, 08:19:33 am by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5440 on: January 16, 2026, 09:16:49 am »
How to I unsigned right shift ?

That is not supported, but it is easy to get around:

Do (int(value)&0xffff) before shifting. Internally TC do integer math in 64 bits, i.e. anything shorter can be masked before shifting and you get unsigned shift.

I was not aware of the >>> operator, when was it introduced?
I can easily add it, but I am not sure there is much point in doing it, the issue will be the expansion to 64 bit, before the math is done. The number will not end up negative, but will have a lot of preceding 1 bit.
 

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5441 on: January 16, 2026, 09:31:18 am »
The unsigned right‑shift operator >>> has been part of Java since its very first public release (JDK 1.0, January 1996).

I will give your solution a try and report back with my findings.
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5442 on: January 16, 2026, 09:39:05 am »
The unsigned right‑shift operator >>> has been part of Java since its very first public release (JDK 1.0, January 1996).

Strange, I am sure I have checked some Java documentation in the past, but I moved over from C/C++ long time ago and because they uses the same shift operators (>> and <<), I have not really bothered checking much.
 

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5443 on: January 16, 2026, 09:43:37 am »
My findings:

This works:
Code: [Select]
:readmath: (int(value) & 0xFFFF)
:readmath: ((value >> 8) & 0xFF)+" "+((value >> 4) & 0xF)+" "+(value & 0xF)

But this does not work:
Code: [Select]
:readmath: ((int(value) & 0xFFFF) >> 8) & 0xFF)+" "+((int(value) & 0xFFFF) >> 4) & 0xF)+" "+((int(value) & 0xFFFF) & 0xF)
The last one only outputs one digit, I believe since an integer can not be added to a " " space.

About >>> I looked it up it was together with >> and << in Java.

In C/C++ there is no >>>.
« Last Edit: January 16, 2026, 10:01:10 am by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5444 on: January 17, 2026, 02:02:39 pm »
Dear HKJ, I've made 2 new and one updated definitions.

New definition for the: eTOMMENS eTM-xxxxP series (eTM-152P, eTM-155P, eTM-1520P, eTM-305P, eTM-3010P, eTM-605P, eTM-1003P and eTM-1502P) and Hanmatek HM305P and HM3010P and Rockseed RS305P, RS3010P and RS605P power supply.
New definition for the: eTOMMENS eTM-xxxxMP series (eTM-152MP, eTM-155MP, eTM-1520MP, eTM-305MP, eTM-3010MP, eTM-605MP, eTM-1003MP and eTM-1502MP) and A-BF SS-305MP and SS-3010MP power supply.
Updated definition for the: BSide I8305, I83010 and I84020 power supply.

All the power supplies are made by Dongguan TongMen (eTOMMENS) Electronic Technology Co., Ltd. using an ARM32 based ModBus control platform. The specification of the protocol is available on different websites.

I enhanced the setup menu with all offered protection indicators that these power supply offer.



Please add the attached definition files to the next release of the wonderful TestController.

Thank you for all your support HKJ !

Please note: The BSide defintion needs TC >= v2.93 !!!!

Note: Added to TestController v2.94 released on 18-1-2026
« Last Edit: January 18, 2026, 07:57:59 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5445 on: January 17, 2026, 02:18:21 pm »
Please add the attached definition files to the next release of the wonderful TestController.

I have added them, thanks.
 

Offline 2X

  • Frequent Contributor
  • **
  • Posts: 726
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5446 on: January 17, 2026, 02:31:15 pm »

I placed this:
#value Voltage_CH1 V SI
#value Voltage_CH2 V SI
#askValues DVM1:RESult?;#askValues DVM2:RESult?

but still the second column "Voltage_CH2" for some reason is zero.


#askValues DVM1:RESult?; DVM2:RESult?; DVM3:RESult?; DVM4:RESult?
; ------------------------------------------------------------------------


Sorry, I did a mistake, the correct line is:
#askValues DVM1:RESult?;DVM2:RESult?

Now worked flawless and with 4 channels. Thanks!!!!
Two more queries if you please.
1. With semicolon ";" can we write a comment at a definition file?
2. There is a way to define the width of each column in "Table" tab (Picture: Columns Width)?

Commands where I wrote in the definition file:
; ------------------------------------------------------------------------
; RTB24 Reading Values from 4 Digital Voltmeters
#value DVM1_Voltage V SI
#value DVM2_Voltage V SI
#value DVM3_Voltage V SI
#value DVM4_Voltage V SI

#askValues DVM1:RESult?;DVM2:RESult?

; ------------------------------------------------------------------------

HK could you also include these commands at a definition file on the Test Controller or are incomplete (R&S RTB24 Oscilloscope - Reading Values from four Digital Voltmeters)?
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5447 on: January 17, 2026, 02:38:41 pm »
HK could you also include these commands at a definition file on the Test Controller or are incomplete (R&S RTB24 Oscilloscope - Reading Values from four Digital Voltmeters)?

What you do is post the definition file here.
Add a #author statement, this way you get credit for the definition and people can see who made it.
Many people also add some comments at the top of the files and maybe a #notes statement that list limitations and settings for this definition to work.
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5448 on: January 17, 2026, 06:02:38 pm »
A few more notes:
I do not require a complete definition, it must be a working one, that support logging or at least partial control (preferable both).
Definitions can be posted here or emailed to me, both works.
The #author statement is not your name, but some nickname or handle your usually use online, it will be shown on the about page in TC.
#notes is optional, but is a great way to add information about limits and requirements.
Comments in the top of definition is probably not seen by many, but can be used for version information and specifying stuff other people need to be aware of if they try to extend the definition.
 
The following users thanked this post: 2X

Offline MrPete

  • Regular Contributor
  • *
  • Posts: 152
  • Country: us
Re: Program that can log/control many multimeters and other devices.
« Reply #5449 on: January 17, 2026, 09:55:06 pm »
@HKJ I'm making good progress on defining Owon Load devices. Along the way have found a bug (or doc typo?), and need a hint...

BUG/Typos

In the Configuration doc file, it says:
Quote
To check variable names, it is possible to use:
Code: [Select]
:enable: return1(displayVar(split(getVarList(1),"\n")));"
Instead of displayVar(), it is also possible to use printConsole() or printLog().
1) There's a spurious quote (") at the end of the example line.
2) If I change displayVar to printConsole or printLog -- I get a Java exception:
Quote
dk.hkj.script.ProgramExceptions$UnknownException: A array can not contain a value
return1(printLog(split(getVarList(1),"\n")))____<----____;
        at dk.hkj.script.Script.expression(Script.java:1242)
        at dk.hkj.devices.SetupFormats.calcEnable(SetupFormats.java:426)
        at dk.hkj.devices.SetupFormats.enableItems(SetupFormats.java:411)
      ....

Hint Needed

I've got a situation that's got to be pretty common:

In the Load settings are a variety of items that combine two values in a particular way:
* An enabling toggle (Example: Vstop ON/OFF)
* An associated value, that is disabled if the toggle is off (Example: nnn.nnn V)

In both the physical device and the PC software supplied by the mfg, this is a very simple UI/UX:
* The toggle clicks on/off, which highlights or grays out the value
* The value can be directly edited, which immediately modifies the value in the device as soon as you leave the field.
2734717-0

In TC, I'm hoping to put those together on a single, reasonably nice-looking line. I'm not particularly close...
2734721-1
* I'd love to shrink the On/Off button if possible
* The number input doesn't need a prompt. That's supplied by "Vstop".
* I don't know how to fit both onto a single line. (Seems maybe multi could do this but I don't see how -- these are two separate settings...)

AND... this makes a few suggestions obvious. I realize these are likely "Round Tuit -- someday if ever" ideas ;)
* Having a way to avoid the "Set" button would be awesome
* Having a way to enhance with more color would be great:
    - Buttons with defined colors for foreground text and background (particularly nice for toggles)
    - Defineable colors for data entry fields
* Related: I'd love to be able to combine info and indicator items all together on one status line :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->