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

0 Members and 14 Guests are viewing this topic.

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6300 on: April 27, 2026, 02:39:27 pm »
I have never tried it, but is it possible to set the Modbus broadcast address 0xFF with command: "address 0xFF" and then send other commands (e.g. holding) which then will start with FF as a hex code ?
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6301 on: April 27, 2026, 02:40:51 pm »
I have never tried it, but is it possible to set the Modbus broadcast address 0xFF with command: "address 0xFF" and then send other commands (e.g. holding) which then will start with FF as a hex code ?

I do not remember if I filter that address, but you can try.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6302 on: April 28, 2026, 10:03:50 am »
My holding register returns 2 bytes. However this needs to be represented with only 3 characters.

So:
;; COM4: Tx: 01 03 00 1F 00 01 B5 CC
;; COM4: Rx: 01 03 02 36 51 6E 18

holdingBytes? 0x1F 1 returns ;; $3651$

But I need to mask off the last nibble of byte 2 since it needs to be 365. (this represents 36 (size) and 5 (digits))

Also how do I put byte1 in a variable and byte2 after masking in another variable ?


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

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6303 on: April 28, 2026, 10:11:42 am »
My holding register returns 2 bytes. However this needs to be represented with only 3 characters.

So:
;; COM4: Tx: 01 03 00 1F 00 01 B5 CC
;; COM4: Rx: 01 03 02 36 51 6E 18

holdingBytes? 0x1F 1 returns ;; $3651$

But I need to mask off the last nibble of byte 2 since it needs to be 365. (this represents 36 (size) and 5 (digits))

Also how do I put byte1 in a variable and byte2 after masking in another variable ?

use :readmath:

<< and >> can be used to shift bits
& can be used to mask bits. Note: && is logical and and & is bitwise and

((value >>2) & 0x0f) will return bits 2345 from value
You can probably do string(value)+" "+string(value) to return two values and value can be something like the expression above.





 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6304 on: April 28, 2026, 10:36:29 am »
If I do holding? 0x1F i get 13905 (which is hex 0x3651)

If I do value>>8 I get 54 (which is hex 36)
If I do (value & 0xF0)>>4 I get 5 (which is hex 5)

How do I get my decimal values back into hex format ?

bytes(value).... right

so
Code: [Select]
:readmath: string(bytes(value>>8))+"-"+string(bytes((value & 0x00F0)>>4)))
$3600000000000000$-$0500000000000000$


Not what I want  |O

I want 36-5

« Last Edit: April 28, 2026, 10:46:50 am by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6305 on: April 28, 2026, 10:46:41 am »
If I do holding? 0x1F i get 13905 (which is hex 0x3651)

If I do value>>8 I get 54 (which is hex 36)
If I do (value & 0xF0)>>4 I get 5 (which is hex 5)

How do I get my decimal values back into hex format ?

bytes(value).... right

so
Code: [Select]
:readmath: string(bytes(value>>8))+"-"+string(bytes((value & 0x00F0)>>4)))
$3600000000000000$-$0500000000000000$>


Not what I want  |O

Stay away from bytes in this case.
Hex and decimal is the same, just different ways to express the integer value. Integer parsers in TC will generally accept hex (Floating point parsers will not, they only accept integer in decimal format)
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6306 on: April 28, 2026, 10:50:55 am »
Sure... but the vendor coded hex into the shown value

I do not want to show 54 on the screen but 36. Sure I can do an expression comparing 0x36 which is 54 but in this case the value should be shown.

(same for the 5, however 5 = 0x05)

How do I show a hex value then ?
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6307 on: April 28, 2026, 10:52:33 am »
Sure... but the vendor coded hex into the shown value

I do not want to show 54 on the screen but 36. Sure I can do an expression comparing 0x36 which is 54 but in this case the value should be shown.

(same for the 5, however 5 = 0x05)

How do I show a hex value then ?

Use hex(number), it will return a string with the hex number, be aware that most controls do not accept strings with a :string: tag.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6308 on: April 28, 2026, 11:02:19 am »
With

Code: [Select]
:readmath: hex(bytes(value>>8))+"-"+hex(bytes((value & 0x00F0)>>4))
I get

0036-0005

Where are the 0 coming from (and how to suppress them) ?

Even this
Code: [Select]
:readmath: hex(value>>8)+"-"+hex((value & 0x00F0)>>4)
Same result 0036-0005

« Last Edit: April 28, 2026, 11:07:18 am by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6309 on: April 28, 2026, 11:10:11 am »
With

Code: [Select]
:readmath: hex(bytes(value>>8))+"-"+hex(bytes((value & 0x00F0)>>4))
I get

0036-0005

Where are the 0 coming from (and how to suppress them) ?

I always display hex in a fixed amount of digits, the smallest size if 4 digits, in most cases that is practical.
You must use string handling to remove them, like substring(hex(bytes(value>>8)),2)+"-"+substring(hex(bytes((value & 0x00F0)>>4)),3)
or the replace function, i.e. replace "00" with "" (Do not replace a single 0 with empty, that would spoil a value like 10).
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6310 on: April 28, 2026, 11:17:16 am »
Code: [Select]
:readmath: substring(hex(value>>8),2,4)+"-"+substring(hex((value & 0x00F0)>>4),3,4)
Produces 36-5 what I wanted !!

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

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6311 on: April 28, 2026, 11:37:53 am »
Code: [Select]
:readmath: substring(hex(value>>8),2,4)+"-"+substring(hex((value & 0x00F0)>>4),3,4)
Produces 36-5 what I wanted !!

An alternate way to filter preceding zeros are:
getMatch(value,"[1-9a-fA-F][0-9a-fA-F]*")
It will work with anything from no zeros and up and always strip all preceding zeroes.

It uses regular expressions, the [1-9a-fA-F] matches one hex digit, except zero, the second one [0-9a-fA-F] also matches zero and by putting a * behind it, it can match from zero and up digits.

 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6312 on: April 28, 2026, 11:59:57 am »
Well I figured out how the Vendor coded the device id into the holding register !!  :box:

Code: [Select]
:readmath: replace(substring(hex(value>>8),2,4)+"-"+substring(hex((value & 0x00F0)>>4),3-(value & 0x000F),4),"-","")
The last nibble was actual a digit position. The model for this device is 3605. So I made some good use of the preceding zero's I had anyway. The Chinese manual did not mention what the last nibble was used for. I have another different device from the same vendor and it decodes also ok with what I found out.

Now I can link it to the instrument identification.
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6313 on: April 28, 2026, 12:07:25 pm »
Well I figured out how the Vendor coded the device id into the holding register !!  :box:

Code: [Select]
:readmath: replace(substring(hex(value>>8),2,4)+"-"+substring(hex((value & 0x00F0)>>4),3-(value & 0x000F),4),"-","")
The last nibble was actual a digit position. The model for this device is 3605. So I made some good use of the preceding zero's I had anyway. The Chinese manual did not mention what the last nibble was used for. I have another different device from the same vendor and it decodes also ok with what I found out.

Now I can link it to the instrument identification.

Then it sound like substring is the best choice.
 

Offline janteau

  • Newbie
  • Posts: 1
  • Country: us
B&K Precision 9130
« Reply #6314 on: April 29, 2026, 01:49:17 am »
Here is a device configuration for the B&K Precision 9130 triple output power supply.  This should work with units with firmware version >= 1.66 (according to the manual), but my unit has 1.74.  Earlier firmware versions don't support writing to all channels with one command, so only a few commands would have to be changed.

The 9130 supports Series/Parallel configuration, but this doesn't appear to support this through the serial port.  Therefore this driver only supports the individual channel voltage and currents limits.  I believe these limits could be updated in the driver to support if you manually put the supply in this mode through the front panel menu.

Unfortunately I don't think this will directly work with the 9130B/C models or the 9131x, 9132x, etc.  I'm sure it could easily be updated to support then, but I didn't bother since I don't have a way to test it.
« Last Edit: April 29, 2026, 03:27:48 am by janteau »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: B&K Precision 9130
« Reply #6315 on: April 29, 2026, 10:19:24 am »
Here is a device configuration for the B&K Precision 9130 triple output power supply.  This should work with units with firmware version >= 1.66 (according to the manual), but my unit has 1.74.  Earlier firmware versions don't support writing to all channels with one command, so only a few commands would have to be changed.

The 9130 supports Series/Parallel configuration, but this doesn't appear to support this through the serial port.  Therefore this driver only supports the individual channel voltage and currents limits.  I believe these limits could be updated in the driver to support if you manually put the supply in this mode through the front panel menu.

Unfortunately I don't think this will directly work with the 9130B/C models or the 9131x, 9132x, etc.  I'm sure it could easily be updated to support then, but I didn't bother since I don't have a way to test it.

Thanks, I have added it.
 

Online CaptainBucko

  • Regular Contributor
  • *
  • Posts: 138
  • Country: au
Re: Program that can log/control many multimeters and other devices.
« Reply #6316 on: April 29, 2026, 01:23:00 pm »
I have been hammering my DL24MP 600w version to test the health of about 30 sealed lead acid batteries gifted to me my by my fire safety system technical friend...

I was testing the latest Pukka DL24 script "Battery Test with IntResistance Check AutosaveTussen", but its not reliable for me. The root cause is the DL24 in 600w configuration occasionally returns garbage data (weirdly the 150W version didn't, but once configured into 600W it did) and sometimes this causes a TestController controlled script to abort prematurely.

So the 2nd last script from Pukka, "Discharge_ATDL24_PX100_TimeOption.txt" which just monitors the DL24 but lets it control the discharge test, is far more reliable for me.

However, I prefer the graphing of the latest script, so I added this capability back to the earlier one. I also added a percentage of Ah capacity to the measurement where I discharge (manually set) at C/30 and stop at 11.8 and measure the capacity as a percentage of stated on the battery.

If someone could advise how I could automatically set the discharge current based on battery capacity / 30 I would be much obliged.
 

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 73
  • Country: au
Re: Program that can log/control many multimeters and other devices.
« Reply #6317 on: April 30, 2026, 02:53:47 am »
I find the "Other" menu very confusing. I managed to get it shown, but the programming around it is so different and (imho) not very user friendly. I was not successful in getting a script embedded in the definition file.  :(

You may wish to refer to my definition for the GTH thermal chambers for an example of syntax for the "Other" menu.
I attached the most recent version here.
 

Offline Gertjan

  • Frequent Contributor
  • **
  • Posts: 340
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #6318 on: April 30, 2026, 09:44:44 am »
The latest Java update broke my Chart:


TC-chart-broken-1000pix.png

Now there are only some semi-random dots instead of a curve....

The offending Java update:



This is on Windows 7 32bit.
I suspected a Windows problem. So I restored to a fresh Windows install. Re-installed TC v3.00, and an older Java Runtime.

And all was good again. Until next day Java updated, and the same problem returned.

Unfortunately, I can't find a way to roll-back a Java update. So I uninstalled Java, and re-installed the older (2025) version. And switched off the automatic Java updates.

I did not test if the same problem occurs on my Win 10 and 11 machines. I just switched off the Java updates for now. :)

regards, Gertjan.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6319 on: April 30, 2026, 09:54:07 am »
The latest Java update broke my Chart:

I just did a update of Java to see it:

C:\Users\hkj>java -version
java version "1.8.0_491"
Java(TM) SE Runtime Environment (build 1.8.0_491-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.491-b10, mixed mode)


My chart works fine, both with release and test version of TC
« Last Edit: April 30, 2026, 09:55:39 am by HKJ »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6320 on: April 30, 2026, 10:57:57 am »
I also updated Java on my other computer and it also works fine, i.e. I have tested on both Win10 and Win11.

This means its is some obscure problem.
Do it only happen with a logarithmic scale?
Do it match the sample points or is it random?

One possible issue may be that Java uses the graphic windows driver different and that is causing the problem, but then I would expect it to show up in more places.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6321 on: April 30, 2026, 12:26:39 pm »
Working with the modbus I realized that I have never made a help page for the GPIB popup (Now GPIB+Modbus) and made one:

http://lygte-info.dk/project/TestControllerGPIBandModbusInterfaces%20UK.html

Next version of TC will access this page with F1 when on the page.
 
The following users thanked this post: KungFuJosh

Offline Gertjan

  • Frequent Contributor
  • **
  • Posts: 340
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #6322 on: April 30, 2026, 02:28:36 pm »
The latest Java update broke my Chart:

I just did a update of Java to see it:
[...]
My chart works fine, both with release and test version of TC

Thanks. Good to know there is no issue in Windows 10 and 11.

So it is probably an issue with Win 7 or 32bits. I did not test with other scales.
I do not want to waste more time with further testing. I will just try another Java update  after a few months, or when the need arises.

On this PC I need 32bits to run ancient measurement software and tools, originally written for DOS, Win3 or Win98. Furthermore, Windows 7 is convenient because it is very stable, and no updates to mess with my drivers :).

Regards, Gertjan.
 

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #6323 on: May 02, 2026, 04:09:37 pm »
Dear flash2b ,,, for some reason, if I enter any value other than "0,"  value is not accepted. If I enter 1 or 10, etc., the value looks like the screenshot.
« Last Edit: May 02, 2026, 04:14:09 pm by homico »
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 948
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #6324 on: May 02, 2026, 04:22:46 pm »
If you type autoTempInterval 10 from the command line, does it work then ?
They say attention is a shovel. It's time to dig 'em out.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf