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

0 Members and 209 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 #5675 on: February 07, 2026, 04:47:06 pm »
My current RS485 adapters say that they support 32 devices on the bus, due to the load of the signal path. I have ordered a 4 channel adapter with one USB input but that one also creates 4 ports so not a single port.

What adapters are you using?

Will you disclose the use of other addresses so that I can use in in definitions ?

I have already updated the documentation.
 
The following users thanked this post: 2X

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8217
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5676 on: February 07, 2026, 08:26:07 pm »
I want to add a screen dump to the CNT-90 definition, but it's returning this:
Quote
;; COM5: Tx: <:HCOP:SDUM:DATA?.> 3A 48 43 4F 50 3A 53 44 55 4D 3A 44 41 54 41 3F 0A
;; #ScreenDump failed due to 0

The result if I enter the command from the command window are attached in a text file (wouldn't let me post it).

Do I need to strip the leading #43942? Something else?

Thanks,
Josh
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5677 on: February 07, 2026, 08:49:10 pm »
I want to add a screen dump to the CNT-90 definition, but it's returning this:
Quote
;; COM5: Tx: <:HCOP:SDUM:DATA?.> 3A 48 43 4F 50 3A 53 44 55 4D 3A 44 41 54 41 3F 0A
;; #ScreenDump failed due to 0

The result if I enter the command from the command window are attached in a text file (wouldn't let me post it).

Do I need to strip the leading #43942? Something else?

Generally I would need a photo of the screen, the data and a description of the format, but it might not be strictly necessary in this case.
The issue is the extra 64 bytes. TC know how a BMP looks and can easily handle it, but the 64 bytes before it stops that.

I do not believe you can use readmath on this command, i.e. I have to add a option to the command to skip bytes.

TC uses a special read (deviceReadBytes) for these types of data, this read understand the 43942 and uses it to read the correct amount of bytes. I do not remember if it is supposed to have a leading #, but I will check.
https://lygte-info.dk/project/TestControllerFunctions%20UK.html#deviceWrite,_deviceRead,_deviceReadBytes,_deviceWriteBytes
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8217
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5678 on: February 07, 2026, 09:47:46 pm »
I tried changing it to:
#ScreenDump std
deviceReadBytes(device, ":HCOP:SDUM:DATA?") ;also tried handle,
:readmath: replace(value,"#","");

But that still gives the same ;; #ScreenDump failed due to 0

Do you mean a photo of the device display, or a screenshot of the TC response from the command line?

Thanks,
Josh
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5679 on: February 07, 2026, 09:48:48 pm »
I checked the code.
The # is supposed to be there.
It expect to read the data in 3 seconds or less.
I wonder if the 62 bytes header is part of the BMP format, in that case TC is supposed to accept it

The return value you show looks very strange: 3A 48 43 4F 50 3A 53 44 55 4D 3A 44 41 54 41 3F 0A
I have not translated it to letter to see what it says, maybe there is a clue there.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5680 on: February 07, 2026, 10:01:21 pm »
Do you mean a photo of the device display, or a screenshot of the TC response from the command line?

I mean the display, but that is mostly relevant if I have to add a new decoding algorithm.
For now it can handle standard image formats and a specific DMM that has a special screendump format where I had to write a decoding algorithm.

The #screendump tag calls the deviceReadBytes function with the specified command.
If it fails at decoding the data it is supposed to dump a exception to console, but that will only happen if it try to decode a image.
You use this format:

#ScreenDump std
:HCOP:SDUM:DATA?
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8217
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5681 on: February 07, 2026, 10:17:17 pm »
Do you mean a photo of the device display, or a screenshot of the TC response from the command line?

I mean the display, but that is mostly relevant if I have to add a new decoding algorithm.
For now it can handle standard image formats and a specific DMM that has a special screendump format where I had to write a decoding algorithm.

The #screendump tag calls the deviceReadBytes function with the specified command.
If it fails at decoding the data it is supposed to dump a exception to console, but that will only happen if it try to decode a image.
You use this format:

#ScreenDump std
:HCOP:SDUM:DATA?

That's how I had it originally. I added the deviceReadBytes stuff to try and use readmath- not that it matters since the # belongs there.

I attached an image of the display. It's not particularly exciting.

Thanks,
Josh
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5682 on: February 07, 2026, 10:33:01 pm »
That's how I had it originally. I added the deviceReadBytes stuff to try and use readmath- not that it matters since the # belongs there.

The only way to get access to the deviceReadBytes() is in the other menu where you do the coding, there you can also add printLog() statement to see what you receive.

I attached an image of the display. It's not particularly exciting.

It shows it is a two color display. Do it use network or serial communication? My 3 second timeout may be an issue if it is serial.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8217
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5683 on: February 07, 2026, 11:33:16 pm »
It shows it is a two color display. Do it use network or serial communication? My 3 second timeout may be an issue if it is serial.

It's GPIB communication. There is a variant with Ethernet, but I don't have that.
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

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 #5684 on: February 08, 2026, 06:58:00 am »
#metaDebug only works after the first #metadef in a definition.

This is not mentioned in the documentation: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html##metaDebug

How do I save the second #metadef without having to comment out the first section ?

The first:
Code: [Select]
#metaDebug on Eletechsup NT48A08
#idString Eletechsup,NT48A08,
#name Eletechsup NT48A08
#handle NT48A08
#metaSection Chan20  --Exclude--
#metaSection  --Include--
#metaSection Chan8  --Include--
#metaSection Chan20  --Exclude--
#metaSection  --Include--
#metaSection Chan20  --Exclude--
#metaSection  --Include--
;; jSerialComm version: 2.11.2

The second:
Code: [Select]
#metaDebug on Eletechsup NT48A08
#idString Eletechsup,NT48A20,
#name Eletechsup NT48A20
#handle NT48A20
;; jSerialComm version: 2.11.2
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 #5685 on: February 08, 2026, 08:54:26 am »
It's GPIB communication. There is a variant with Ethernet, but I don't have that.

GPIB may be the issue, I have not tried binary communication through a GPIB interface and in this case we are talking a single message that is a few kb long and may contains EOL characters.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5686 on: February 08, 2026, 08:57:51 am »
#metaDebug only works after the first #metadef in a definition.

This is not mentioned in the documentation: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html##metaDebug

Are we reading the same definition: "This is a debug tag that can be placed on the line after a #metadef tag"


How do I save the second #metadef without having to comment out the first section ?

You can only have on "#metaDebug save" at a time, you need to comment the other ones 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 #5687 on: February 08, 2026, 10:09:55 am »
I would rephrase into "This is a debug tag that can be placed once after the first occurrence of a #metadef tag"
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 #5688 on: February 08, 2026, 10:12:35 am »
I would rephrase into "This is a debug tag that can be placed once after the first occurrence of a #metadef tag"

It can be placed after any #metadef tag.
 

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 #5689 on: February 08, 2026, 10:19:25 am »
Yes, but if I place it after the second metatag, it does not output the debug information on the log, like I showed on my example.

My example only one metaDebug was active.
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 #5690 on: February 08, 2026, 10:45:30 am »
Yes, but if I place it after the second metatag, it does not output the debug information on the log, like I showed on my example.

My example only one metaDebug was active.

I just tried it in my test definition, add 3 #metadef (3 was empty)
Then did 3 runs with "#metadebug save" place on the line just below the 3 #metadef
Each time I got a list of changes and a saved file of the generated definition.

I also tried placing "#metadebug" without save in all 3 sections and got changes for all 3 sections in one long list with #metadebug section heads.

You must place it on the line just after #metadef to get all changes.
I hope you are looking at the console output, not in the log window!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4788
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5691 on: February 08, 2026, 10:59:10 am »
You can email me you definition if you want me to take a look at the #meta stuff.
The email is if you want to avoid posting preliminary definitions here.
 

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 #5692 on: February 08, 2026, 11:48:24 am »
I will mail you my development version. You can see that de #sections do not work when it's the second #metadef.

Yes, console output.... my main screen during coding of definitions !

Mail is sent !!
« Last Edit: February 08, 2026, 12:04:45 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 #5693 on: February 08, 2026, 02:13:08 pm »
I will mail you my development version. You can see that de #sections do not work when it's the second #metadef.

Yes, console output.... my main screen during coding of definitions !

Mail is sent !!

It toke me some time to realize what the issue was, but here is the explanation:
Code: [Select]
#metadef
#metadef filename without path and extension
#metadef device name

#metadef has 3 formats, internally the first format is replaced with #metadef filename and as filename is using the name of the file with the definition (of course), but in your case it also matches a device name and TC uses the device as basic for the second and third definition, not the intended definition file.
Knowing this, the fix is easy: Change the filename of the definition.
 

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 #5694 on: February 08, 2026, 02:28:39 pm »
I changed my file from into Eletechsup NT48A08.txt into Eletechsup NT48 series.txt and with success.

Code: [Select]
Starting
#metaDebug on Eletechsup NT48 series
#idString Eletechsup,NT48A20,
#name Eletechsup NT48A20
#handle NT48A20
#metaSection Chan20  --Include--
#metaSection  --Include--
#metaSection Chan20  --Include--
#metaSection  --Include--
#metaSection Chan20  --Include--
#metaSection  --Include--
#metaSection Chan20  --Include--
#metaSection  --Include--
#metaSection Chan8  --Exclude--
#metaSection Chan20  --Include--
#metaSection  --Include--
#metaSection Chan20  --Include--
#metaSection  --Include--
;; jSerialComm version: 2.11.2

It was not only that the #metaDebug did not work, it was also affecting the #sections and #metaSection as you know.

Well I am glad that is resolved...
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 #5695 on: February 08, 2026, 02:40:01 pm »
I changed my file from into Eletechsup NT48A08.txt into Eletechsup NT48 series.txt and with success.

It was not only that the #metaDebug did not work, it was also affecting the #sections and #metaSection as you know.

Well I am glad that is resolved...

I had forgotten all details about how TC handled the actual #meta stuff and had to find that out first, now I know again  ;D
TC scans all definitions and saves everything with #meta and #metadef in some special buffers, when all files are processes it starts on the list of #metadef it has saved. These are processed and scanned, then added to the loaded devices and remove from the #metadef list. When the #metadef list is empty, the loading is finished.
When a definition is going to be used, a full parse of it is done and it is not just loading that triggers a full parse of a definition.
 

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 #5696 on: February 08, 2026, 02:46:41 pm »
One problem with the saved meta is that some character codes get converted wrongly.

Source:
#value TempCH20 °C D1 Temperature
#value OhmCH1 kΩ D2 Resistance

Meta after save metaDebug
#value TempCH20 °C D1 Temperature
#value OhmCH1 k? D2 Resistance

The Ω sign gets screwed up. My file is encoded UTF-8-BOM.
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 #5697 on: February 08, 2026, 02:51:49 pm »
One problem with the saved meta is that some character codes get converted wrongly.

#value OhmCH1 kΩ D2 Resistance
#value OhmCH1 k? D2 Resistance

The Ω sign gets screwed up. My file is encoded UTF-8-BOM.

I do not remember if the output file is in unicode, but probably not.
What count is the units in TC and if the file has a BOM marker TC will read it correctly, another way is to use unicode escapes \u0000
 

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 #5698 on: February 08, 2026, 03:02:12 pm »
My current RS485 adapters say that they support 32 devices on the bus, due to the load of the signal path. I have ordered a 4 channel adapter with one USB input but that one also creates 4 ports so not a single port.

What adapters are you using?

I use a  CH340T + Max485 USB-A male, a FT232RL + Max485 USB-B female and a new 4 channel CH344 + Max485 USB-B female in on the way to me. If you want I can give direct links.
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 #5699 on: February 08, 2026, 03:08:05 pm »
What adapters are you using?

I use a  CH340T + Max485 USB-A male, a FT232RL + Max485 USB-B female and a new 4 channel CH344 + Max485 USB-B female in on the way to me. If you want I can give direct links.

Yes, link please.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf