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

0 Members and 41 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5900 on: March 10, 2026, 08:25:02 am »
Might be a little overkill, but last year I threw together a very rough (still needs debugging) definition for this relay module:
https://www.waveshare.com/product/modules/others/power-relays/modbus-rtu-relay-32ch.htm

I was using it to multiplex the source and sense lines of an SMU across a bank of 8 batteries for charge/discharge/charge cycle testing.
If I can ever find the time to finish the definition file, I'll upload it.

It is definitely overkill for this, but it would still be nice to have.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 942
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5901 on: March 10, 2026, 09:14:20 am »
32 Channels  :-DD ... overkill indeed.

For my Eletechsup model, there is also a 8 Channel and 12 Channel version. I can do that in the same definition, but not very likely that someone using it. So therefore 1CH, 2CH and 4CH I will focus on.

Like I said there are so many models and brands available, but I am not going to buy them all.
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5902 on: March 10, 2026, 03:59:21 pm »
A test version with battery test is up, all a welcome to try it out.

http://lygte-info.dk/pic/Projects/TestController/TestController.jar

it is not in the menu yet, but can be activated with this command:
#SHOWPOPUPSYSTEM batterytest

To test the states fast adjust the discharge stop voltage to 3.8 or 3.9 volt and the charge end current to 100mA, the result will not be a real battery test, but speeds up the states significantly. I have done one real test and it took about two days with the default settings.



With fast I do not mean in minutes, but a full test cycle can be done in a night!

I look forward to comments about what can be improved (I already have some stuff listed).
I have coded all functions, but not tested everything yet, please post here if you find anything that do not work as expected.

For help about the page press F1 while on it, I have made a rather long help page. Please list if some more info is needed on the page about something.

 

Offline dUkk

  • Contributor
  • Posts: 14
  • Country: 00
Re: Program that can log/control many multimeters and other devices.
« Reply #5903 on: March 11, 2026, 09:01:03 pm »
Hello everyone here!

Does TestController supports COM (Serial Port) based binary protocols ? I have CEM DT-99x multimeter that is feeding only data (i cant request any). so i was guess how to pass data to TestController. (i have PoC python code getting and parsing data from binary flow over serial port).
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5904 on: March 11, 2026, 09:07:22 pm »
Hello i am new here
I work with TC for 1 week and my first definition works fine, but doesn't supprot all function in ASCII mode. I want to rewrite the defintion to HEX mode. That's wat the manual say about is. It loeks like Modbus but it also different.

It is about aan acsourse from Matrix APS-7100.

I need to say i am very happy with your work on testcontoller. The manual however is to difficult for me and i don't understand how things work together. For example how does #checksum work and when does it work?
How can i change and modify (value) before it is transmitted

I will show you my definition and i have added a lot of remarks.

Code: [Select]
#idString Matrix, APS-7100,
#name Matrix APS-7100
#handle APS7100
#port com
#baudrate 9600
#driver ASCII
#checksum sum8 binlh 0 0 0 0
#author Benleentje

#scpiCmd Current? txrxnBin? 7 \x01\x52\x60\x00\x00\x00\x00\xB3
; Checksum = B3 is hard coded this works fine for reading
; From the rx string i need bytes 4, 5, 6 and 7, byte 4 = lsb, 7 = msb.
; For reading the current it is in mA
:readmath:  (((value >> 24) & 0xFF) + (((value >> 32) & 0xFF) << 8) + (((value >> 40) & 0xFF) << 16) + (((value >> 48) & 0xFF) << 24))/1000.0

#scpiCmd Voltage txrxnBin 7 \x01\x57\x33\xB0\x04\x00\x00\x3F
; 3F is chesum value sum8 but somehow TC does not at it while sending the string

#scpiCmd V txrxnBin 7 \x01\x57\x33((value))   
;I want value to be converted to 4 bytes (not ascii)

; The protocol is not modbus, but it is simulair.
; Total 7 bytes of data + checksum,
; id nummer, 1 byte
;               command ( read, write or reset), 1 byte
; function code ( = register adres), 1 byte
; Data, 4 bytes with high byte follows low byte
; chesum sum8 over 7 bytes
; x01 is id nummer
; x57 write data and x52 read data, 0x58 = reset
; x33 is register adres to write to as example
; value is Always 4 bytes to read or write
; 120.0V = 1200 = B0 04 00 00
; The 7 bytes checksum sum8 has to be calculated and add to string before sending it

#value Current A D3
#askValues Current?




« Last Edit: March 11, 2026, 09:11:19 pm by Benleentje »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5905 on: March 12, 2026, 08:01:56 am »
Does TestController supports COM (Serial Port) based binary protocols ? I have CEM DT-99x multimeter that is feeding only data (i cant request any). so i was guess how to pass data to TestController. (i have PoC python code getting and parsing data from binary flow over serial port).

Yes.
You will probably want to use this one: https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Binary_DMM_protocol
It is designed to handle 7segment data and a variety of flags in a binary message.
For more general binary data you use this one: https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Binary_with_fixed_communication_blocks_(Block)
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5906 on: March 12, 2026, 08:09:16 am »
Hello i am new here
I work with TC for 1 week and my first definition works fine, but doesn't supprot all function in ASCII mode. I want to rewrite the defintion to HEX mode. That's wat the manual say about is. It loeks like Modbus but it also different.

; The protocol is not modbus, but it is simulair.
; Total 7 bytes of data + checksum,
;      id nummer, 1 byte
;               command ( read, write or reset), 1 byte
;      function code ( = register adres), 1 byte
;      Data, 4 bytes with high byte follows low byte
;      chesum sum8 over 7 bytes
; x01 is id nummer
; x57 write data and x52 read data, 0x58 = reset
; x33 is register adres to write to as example
; value is Always 4 bytes to read or write
; 120.0V = 1200 = B0 04 00 00
; The 7 bytes checksum sum8 has to be calculated and add to string before sending it

Take a look at https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Binary_with_fixed_communication_blocks_(Block)



Checksum is always added to the end of a message. It only works on the protocol that list it, not on all protocols. Checksums are never verified on received messages, they are just ignored.
« Last Edit: March 12, 2026, 08:11:52 am by HKJ »
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5907 on: March 12, 2026, 06:05:27 pm »
Thanks. I looked at block before but i think it one of the most difficult to understand.
In the definitons ADCxxF103 and Giant Force GTH i see how to use it. Maybe a good idee to ad to the manual under Block
I now see that checksum is for block. It is a little hard to see when a new chapter has started, maybe that is only with me.

I have a lot of info to work with en many thing to try to make it work.

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5908 on: March 12, 2026, 06:20:29 pm »
Thanks. I looked at block before but i think it one of the most difficult to understand.
In the definitons ADCxxF103 and Giant Force GTH i see how to use it. Maybe a good idee to ad to the manual under Block
I now see that checksum is for block. It is a little hard to see when a new chapter has started, maybe that is only with me.

I may look complicated, but that is because it has to cover a lot of different formats/encodings and it can work 3 different ways.

Your idea about listing some drivers that uses it is a good idea, I will add it to the documentation.
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5909 on: March 12, 2026, 08:05:08 pm »
I have the definition working for setting a voltage. For testing i only used V. This works great and the checksum is added correctly. The acsource respond very nice and set the voltage.

To read back from the acsource i get a timeout and i don't understand why.
The answer Rx is correct

 |O Forget the things below. I thougth hex is what i needed. I am tring with 3ur4 and getting something back

Code: [Select]
#idString Matrix, APS-7100,
#name Matrix APS-7100
#handle APS7100
#port com
#baudrate 9600
#driver Block
#checksum sum8 binlh 0 0 0 0
#author Benleentje

#scpiCmd V? txrxn? 8 0x01 0x52 0x33 0x00 0x00 0x00 0x00  / 3hr4

#scpiCmd V txrxn 8 01 0x57 0x33 (value) (value >> 8) (value >> 16) (value >> 24) / 3hr4/10

#value Current A D3
#askValues Current?



« Last Edit: March 12, 2026, 08:26:43 pm by Benleentje »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5910 on: March 12, 2026, 08:14:59 pm »
I have the definition working voor setting a voltage. For testing i only used V. This works great and the checksum is added correctly.

To read back from the acsource i get a timeout and i don't understand why.
The answer Rx is correct
#scpiCmd V? txrxn? 8 0x01 0x52 0x33 0x00 0x00 0x00 0x00  / 3hr4

....
;; COM3: Tx: 01 52 33 00 00 00 00 86
;; COM3: Rx: 01 52 33 DC 05 00 00 67
java.lang.NumberFormatException: For input string: "Ü"

The issue is you uses the hex decoder, it assumes ascii hex, but the format is directly in binary. That means i or u decoder and maybe a r
I.e. try 3i4 3u4 3ir4 3ur4
i is signed, u is unsigned.

And you do not need a decoder on a transmit only line.


Generally a timeout is because some bytes are missing, here it is the decoded line that is lost in the decoder, due to the format error.
« Last Edit: March 12, 2026, 08:17:33 pm by HKJ »
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5911 on: March 12, 2026, 08:39:34 pm »
Code: [Select]
The issue is you uses the hex decoder,I was trying 3h1 and finally get an answer "U". Then i realised what was going on. H is for ascii.
I was thinking a is for ascii. After the answer "U" tried 3ur4 en get a really long number.

3u4 is working greet.

This block is really power full and i can even test bits what i need for reading the alarms. And a lot of conversion is done.

3u4/10 is perfect  i don't need a readmath anymore.




 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5912 on: March 12, 2026, 08:49:58 pm »
I was trying 3h1 and finally get an answer "U". Then i realised what was going on. H is for ascii.
I was thinking a is for ascii. After the answer "U" tried 3ur4 en get a really long number.

3u4 is working greet.

a is for numbers like 123456 in ascii
h is for numbers like 123abc in ascii

Block handles binary, bcd and ascii encoded values and with the modifiers can move bits around to match, but it do not handle 7 segment encoding (That is for the "Binary DMM protocol").

This block is really power full and i can even test bits what i need for reading the alarms. And a lot of conversion is done.

3u4/10 is perfect  i don't need a readmath anymore.

:readmath: is only needed for some special encoding, like number and exponent separately encoded instead of using floating point binary formats.
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5913 on: March 12, 2026, 09:35:16 pm »
Quote
a is for numbers like 123456 in ascii
h is for numbers like 123abc in ascii

If read it back with your manual then i understand. it know.

Somehow (value) * 10) didn't work and give a lot of error.
The debug window is a great tool and showed "100,0".
 
(((value) * 10) & 0xff) Works really well.

 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5914 on: March 12, 2026, 09:45:45 pm »
Somehow (value) * 10) didn't work and give a lot of error.
The debug window is a great tool and showed "100,0".
 
(((value) * 10) & 0xff) Works really well.

The trick is that inside () you can do expressions (i.e. multiply and other stuff), but it do not work outside ()

((value * 10) & 0xff)

Would also work


You can test expression in the calculator or on the command line, if you want a variable that is called "value" simply type "=var value" on the command line or just "var value" in the calculator.
Then you can assign a value to var with
"=value=5" or "value=5"
And type you expression, again with a = prefix on the command line and without any prefix if you uses the calculator.

The variable you create in the calculator is not the same as you create on the command line. To make the same variable accessible in both places you must use "globalvar" instead of "var"

 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 942
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5915 on: March 13, 2026, 04:42:56 pm »
My definition for #interfaceType Relay is recognized.  8)



The battery popup is polling the status of the relay board, but since I did not connect all devices yet (on purpose !) the Start and Stop/Abort buttons are disabled. My relays are predefined in CH1 and CH2 "On" at the moment. I hope is this how it was supposed to work.

On the pictures: https://lygte-info.dk/project/TestControllerPopupBatteryTest%20UK.html

What is the meaning of the Yellow and Green dots? I think you use green as Channel 1 and yellow as Channel 2 and probably NO contacts.

I think it better to label them with common terminology like  COM, NO and NC then I know which contact I should use. The thin red line that goes to yellow, is that the sense wire?

They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5916 on: March 13, 2026, 05:06:21 pm »
The battery popup is polling the status of the relay board, but since I did not connect all devices yet (on purpose !) the Start and Stop/Abort buttons are disabled. My relays are predefined in CH1 and CH2 "On" at the moment. I hope is this how it was supposed to work.

It is, but to show up on hardware it only need to define what is needed, it do not check if it works (I assume it does).


On the pictures: https://lygte-info.dk/project/TestControllerPopupBatteryTest%20UK.html

What is the meaning of the Yellow and Green dots? I think you use green as Channel 1 and yellow as Channel 2 and probably NO contacts.

Correct.

I think it better to label them with common terminology like  COM, NO and NC then I know which contact I should use. The thin red line that goes to yellow, is that the sense wire?

The thin red and black lines are sense wires.


I have updated the documentation and .jar file, a lot of stuff is fixed (Most of the untested stuff did not work). It is uploaded.
I also support thermometers know, but you will have to do a small modification in your files.
I did also add right click menus to the input field with common values.
And the test menu for #interface commands can easily handle a 32 unit device now, it switches from radio buttons to a text box when there are more than 8 units in a device.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 942
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5917 on: March 13, 2026, 05:20:04 pm »
For thermometer you mean:

From:
#interfaceType TEMP
#interface readValueCH1 0

To:
#interfaceType Thermometer
#interface readTemperature 0

Previously Thermometer was not a Type. Therefore I use TEMP.

My definitions support both temperature and well as resistance that is why I used readValue.

Can I just add #interface readTemperature 0 and leave all other in place ?

In other words for the NT18B07:
#interfaceType Thermometer
#interface readTemperature 0
#interface readValueCH1 0
#interface readValueCH2 1
#interface readValueCH3 2
#interface readValueCH4 3
#interface readValueCH5 4
#interface readValueCH6 5
#interface readValueCH7 6

Can I have two variables to the same value on position 0 ?
« Last Edit: March 13, 2026, 05:28:19 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5918 on: March 13, 2026, 05:27:56 pm »
For thermometer you mean:

From:
#interfaceType TEMP
#interface readValueCH1 0

To:
#interfaceType Thermometer
#interface readTemperature 0

Previously Thermometer was not a Type. Therefore I use TEMP.

My definitions support both temperature and well as resistance that is why I used readValue.

Something like:
#interfaceType Thermometer Thermometer:2 Thermometer:3 Thermometer:4 Thermometer:5 Thermometer:6 Thermometer:7
#interface readTemperature 0 1 2 3 4 5 6

Would be more correct

The part about resistance is a issue, but I do not see that you can do anything about it. TC will not accept a readValue

Note that get/set will include a channel var in addition to the value var, for stuff that affect all channels you can ignore it.


Can I just add #interface readTemperature 0 and leave all other in place ?

Leaving the other #interface definitions is not nice, but I do not see any real issues with it.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 942
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5919 on: March 13, 2026, 05:41:49 pm »
I not not understand you  :o

So my approach with a line with *CH1, *CH2, etc. is incorrect ?

When I was writing these definitions, I did not see/find these. Seem that I need to update all my thermometer definitions.

I always understood the #interface section was to support scripting. I understand that for a popup you need to have a standard, but I could not see/find it, and I have also asked you in the past.

You write: " TC will not accept a readValue ' do you mean that the popup will not accept it (I understand) or TC as a whole (I do not understand). ??

And the unit of measure, what do you expect? readTemperature is in Celsius I guess, and Current in A (not mA), etc.
« Last Edit: March 13, 2026, 06:21:48 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 942
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5920 on: March 13, 2026, 05:47:57 pm »
Interface command: #interface setRelays, Bitmask specifying what relays to turn on/off.

For me to understand
- Does this mean that if I write 0b00 to the interface function, both relays are off and 0b11 both relays are on ? So bit 0 is relay 0 etc. ?
- Do you support pulsing as well ?
- Do you support toggling as well ?
- Do you support 2 relays work together or always independent ?

The relays sends a bitmask that controls multiple relays, like you guessed.
I have a setRelay() that has a 1 or 0 parameter to turn a relay on/off, that might not be obvious for a relay with multiple channels.
The trick is this line:

#interfaceType Relay Relay:2 Relay:3 Relay:4

It declares that the interface has 4 independent devices that is accessed by adding :2, :3 or :4 to the handle.
This will also be reflected in popup "Test interface for current selected device" where you can select what number to test.

I have not defined commands for other functions, but you are welcome to define them.

I also do not understand this  :o

I  have now:
#interfaceType Relay
#interface setRelays setOutput (value)
#interface readInput 0
#interface readOutput 1

Is this also wrong ??

Value is int that can set each channel 1-8 so 8 bits steer 8 relays, only 1 call !!
They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 942
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5921 on: March 13, 2026, 06:05:15 pm »
My Yokogawa 7562 is NOT recognized:

In the definition:
#interfaceType DMM, BMM
#interface readValue 0

in the spec I read:
#interfaceType DMM
#interface readValue

Why it it not recognized ???
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5922 on: March 13, 2026, 06:25:10 pm »
I not not understand you  :o

So my approach with a line with *CH1, *CH2, etc. is incorrect ?

When I was writing these definitions, I did not see/find these. Seem that I need to update all my thermometer definitions.

I always understood the #interface section was to support scripting. I understand that for a popup you need to have a standard, but I could not see/find it, and I have also asked you in the past.

And the unit of measure, what do you expect? readTemperature is in Celsius I guess, want Current in A (not mA), etc.

I would not call CH1 etc. wrong, but it is not the most elegant solution.

The standard for thermometers are new, I made it for the battery test to support temperature sensors in addition to DMM's and you are basically the reason I did that  :)

I always expect basic units, i.e. volt, ampere, Celsius, etc. That is the same all over TC, it will add any needed prefix to the unit.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5923 on: March 13, 2026, 06:31:51 pm »
I also do not understand this  :o

I  have now:
#interfaceType Relay
#interface setRelays setOutput (value)
#interface readInput 0
#interface readOutput 1

Is this also wrong ??

Value is int that can set each channel 1-8 so 8 bits steer 8 relays, only 1 call !!

No, but notice that there are two calls for relays:
setRelays()
setRelay()
The first for a bitmask, the second for a specific relay and it requires declaring a unit for each relay.

Also note that it is legal to declare multiple types in the #interfaceType declaration, one obvious example is DMM and BMM, where BMM is bench multimeter that supports remote control, but it also works perfectly fine as a DMM.

 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5924 on: March 13, 2026, 06:33:29 pm »
My Yokogawa 7562 is NOT recognized:

In the definition:
#interfaceType DMM, BMM
#interface readValue 0

in the spec I read:
#interfaceType DMM
#interface readValue

Why it it not recognized ???

Get rid of the comma, only valid delimiter is space in this case, it is registers as a DMM, and do not match a DMM
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf