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

0 Members and 379 Guests are viewing this topic.

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4225 on: June 21, 2025, 07:39:49 pm »
Something else, I like the text field behavior for this better. With it set as number, it hides the +/- sign. As text, it works perfectly and always shows as +/-.

If you don't mind, let's keep it this way. ;)

Proposed final attached.

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: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4226 on: June 21, 2025, 07:57:37 pm »
Something else, I like the text field behavior for this better. With it set as number, it hides the +/- sign. As text, it works perfectly and always shows as +/-.

If you don't mind, let's keep it this way. ;)

Proposed final attached.

You write the definition, I will not enforce a specific way. I will suggest what matches the intension and most definitions for TC.
I see TC as a tool and not everybody uses it the same way, I try to accommodate most people.

I believe your definition is a very useful addition to TC and if you publish scripts to do sweep measurements it will be even better. I have a page for user scripts on my website.

I have not even commented on your freq setting, the normal TC way would be to specify the range as 10M to 6G and let the user add the M to each input value.
« Last Edit: June 21, 2025, 08:00:04 pm by HKJ »
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4227 on: June 21, 2025, 09:49:16 pm »
the normal TC way would be to specify the range as 10M to 6G and let the user add the M to each input value.

The device functions as 10M to 6000M. Doing it differently would be inconsistent with the device, and require translating 1G to 1000, 2G to 2000, etc.

I'd prefer it your way too, but keeping consistent with how the device operates is what I went with.

Thanks for all your help!

I will try to make a script, but first I need to add either my SMIQ (06B) or SML (03), or maybe both to TC. I'll probably try the SMIQ first since that one can actually do the full frequency range of these power meters.

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

Offline DeanA

  • Regular Contributor
  • *
  • Posts: 128
  • Country: au
    • Design Electronics
Re: Program that can log from many multimeters.
« Reply #4228 on: June 22, 2025, 06:00:32 am »
Ok, I had a crack at getting it working with the QM1462 by modifying an existing example but couldn't get it to display anything in the "Current Values" tab.
After copying the driver file I modified "DigitechQM1462.txt" to the Devices folder, QM1462 comes up as an option in the "Load Devices"  and I connect it to the existing USB com port, then I hit reconnect but nothing seems to happen.
I have verified there is the 14 byte data coming in on the com port with a terminal program.
Attached is the driver file and  protocol description.
Any pointers please?

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4229 on: June 22, 2025, 06:49:55 am »
Ok, I had a crack at getting it working with the QM1462 by modifying an existing example but couldn't get it to display anything in the "Current Values" tab.
After copying the driver file I modified "DigitechQM1462.txt" to the Devices folder, QM1462 comes up as an option in the "Load Devices"  and I connect it to the existing USB com port, then I hit reconnect but nothing seems to happen.
I have verified there is the 14 byte data coming in on the com port with a terminal program.
Attached is the driver file and  protocol description.
Any pointers please?

It looks correct, except this format specification:
#dataFormat length firstByte firstByteMask

Stick a ; before it!

AUTO is not a valid range, but I believe TC will ignore it.
You might need a #rangeAC and #rangeDC, i.e. without a space

And run TC in debug mode when testing a new protocol, it usually makes it easier to see what goes wrong.
 
The following users thanked this post: DeanA

Offline DeanA

  • Regular Contributor
  • *
  • Posts: 128
  • Country: au
    • Design Electronics
Re: Program that can log from many multimeters.
« Reply #4230 on: June 22, 2025, 09:09:43 am »
Ok, thanks a lot.
The debug mode helps, I had too many bits in the Byte 13 definition as well.
After I fixed that other wierdness was happening such as displaying wrong range as I rotated range knob so I guess that definition document for the tp4000zc protocol doesn't match the QM1462 exactly, so I'll keep looking into correcting all that.
Thanks for your help, will update when I get it sorted.

Offline DeanA

  • Regular Contributor
  • *
  • Posts: 128
  • Country: au
    • Design Electronics
Re: Program that can log from many multimeters.
« Reply #4231 on: June 22, 2025, 10:20:31 am »
Ok, I've sorted the range things and I've checked the bytes for the seven segment data and it looks correct.
When I change to the Current Values tab, from the command window (see attached) it looks like TC trying to send something to the meter and expecting a response (these meters are send only) which I guess TC doesn't receive and maybe then just displays infinity in the current values tab.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4232 on: June 22, 2025, 10:44:41 am »
Ok, I've sorted the range things and I've checked the bytes for the seven segment data and it looks correct.
When I change to the Current Values tab, from the command window (see attached) it looks like TC trying to send something to the meter and expecting a response (these meters are send only) which I guess TC doesn't receive and maybe then just displays infinity in the current values tab.

The TX is to the meter driver, not the meter. Internal TC converts all devices to a sort of SCPI with its drivers. You can see the Tx only goes to the QM1462, not the com port.
This driver runs in the background and catches all communication, a read request will be answered with the last captured value.
 
The following users thanked this post: DeanA

Offline DeanA

  • Regular Contributor
  • *
  • Posts: 128
  • Country: au
    • Design Electronics
Re: Program that can log from many multimeters.
« Reply #4233 on: June 22, 2025, 11:08:09 am »
Ok, thanks, not sure why it reads infinity for the value then, I'll keep digging.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4234 on: June 22, 2025, 11:25:15 am »
Ok, thanks, not sure why it reads infinity for the value then, I'll keep digging.

It is the default answer when it fails to decode the value.

If you get stuck, send me the bytes as a hex dump together with the meter reading (No screen shoot, the bytes has to be as text) and your current definition, then I can look at it. But I do not have time today.
 
The following users thanked this post: DeanA

Offline DeanA

  • Regular Contributor
  • *
  • Posts: 128
  • Country: au
    • Design Electronics
Re: Program that can log from many multimeters.
« Reply #4235 on: June 22, 2025, 11:58:58 am »
Ok, thanks, I'll dig deeper tomorrow and if I can't sort it will send you the info.
Cheers and thanks greatly for your assistance.

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4236 on: June 22, 2025, 06:40:45 pm »
Off to a good start. I thought it would be more annoying to connect this one.

So far just the barebones:
Code: [Select]
#idString Rohde&Schwarz,SMIQ06B,
#name     R&S SMIQ06B
#handle   SMIQ06B
#port     com 5025 LXI GPIB
#baudrate 115200

Quote
*idn?
;; SMIQ06B: Tx <*idn?>
;; SMIQ06B: Rx <Rohde&Schwarz,SMIQ06B,XXXXXX/XXXX,5.93HX >
;; Rohde&Schwarz,SMIQ06B,XXXXXX/XXXX,5.93HX


Wow, this one is so much simpler with SCPI available. I just guess at crap, and it works. FREQ 500MHz, done. FREQ? works, etc. etc.
« Last Edit: June 22, 2025, 07:24:24 pm by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4237 on: June 23, 2025, 03:05:46 am »
I've run into a small issue...

Code: [Select]
#cmdSetup number Step_Size_Log Freq_Sweep
% 0.01 50
:read: SWE:FREQ:STEP:LOG?
:write: SWE:FREQ:STEP:LOG #
:updatealloff:
:tip: Enter log step size for sweep

This functions correctly, but shows the numbers awkwardly. The range is 0.01% to 50%, but TC shows 0.01% as 10m. 10m% is a little weird. 😉

Thanks,
Josh

PS. This is the range for the other one:
#cmdSetup number Step_Size_Lin Freq_Sweep
Hz 0 1G

Don't blame me for that 1000M 😉😉
« Last Edit: June 23, 2025, 03:07:27 am by KungFuJosh »
"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: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4238 on: June 23, 2025, 07:44:07 am »
This functions correctly, but shows the numbers awkwardly. The range is 0.01% to 50%, but TC shows 0.01% as 10m. 10m% is a little weird. 😉


In controls you can use the :format: tag: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html#Tags
If you want to change the way numbers are written to devices, use (formatDouble(...)) or (formatSI(...)) in the :write: definition. https://lygte-info.dk/project/TestControllerFunctions%20UK.html#formatDouble
The format in displays and tables is controlled by the #value definition. https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html#Data_type_definitions

Changing the format will not affect the input parser, you can type 10m, 0.01 or 1e-2, they all work.
« Last Edit: June 23, 2025, 11:55:25 am by HKJ »
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4239 on: June 23, 2025, 02:20:19 pm »
Thanks! :format: x2 is perfect.
"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: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4240 on: June 23, 2025, 02:30:39 pm »
Thanks! :format: x2 is perfect.

Good.

Don't blame me for that 1000M 😉😉

And I will not blame your for this one, I first step to next SI prefix if the value is above 1000, but even a very small amount above will get your the next prefix. If you really don't like it you can specify something like 1.00000001G, but personally I prefer the 1000M
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4241 on: June 23, 2025, 03:51:30 pm »
I was joking cause you teased me about the 6000M. ;)
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4242 on: June 23, 2025, 03:59:31 pm »
Is there a way to make each tab take up the full width so it looks more consistent?

Also curious if there's a way to make the border hug the edge of the full box, rather than shrinking to the content.

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

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4243 on: June 23, 2025, 05:32:10 pm »
Is this the correct way to add a variant?

Code: [Select]
#metadef
#idString Rohde&Schwarz,SMIQ02B,
#name     R&S SMIQ02B
#handle   SMIQ02B
#replace #cmdSetup multi Freq_Range Frequency_Sweep
:read: :FREQ:START?;:FREQ:STOP?
:write: :FREQ:START #;:FREQ:STOP #
number Start Hz 300k 2.2G
number Stop Hz 300k 2.2G
:tip: Enter start and stop frequencies for sweep

#replace #cmdSetup number Set_Frequency Main
Hz 300k 2.2G
:read: FREQ?
:write: FREQ #
:update: Set_Frequency
:format: si
:tip: Enter the desired frequency

For the settings I included, the only thing that needs to change is the max frequency that can be entered for each variant.

One other question: can I combine similar variants, or do they need their own metadefs? For example: SMIQ02B/SMIQ02E

Thanks,
Josh
« Last Edit: June 23, 2025, 05:47:27 pm by KungFuJosh »
"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: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4244 on: June 23, 2025, 06:09:07 pm »
Is there a way to make each tab take up the full width so it looks more consistent?
Also curious if there's a way to make the border hug the edge of the full box, rather than shrinking to the content.

The answer is no to both and I have tried to fix number two, but did not succeed as can be seen.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4245 on: June 23, 2025, 06:15:55 pm »
Is this the correct way to add a variant?

No.

You declare your full definition #meta, i.e. add a line with #meta and nothing else before the start of the current definition. This will make it a abstract definition, that cannot be loaded or rather is loaded to a hidden place.

The your add a #metadef line for each variant above the #meta.

Below each #metadef you will typical need #idstring #name and #handle, in addition to any modification to the #meta section.
The original definition can be reintroduced with only a #metadef line, because everything is already preset in the #meta definition.

To replace a value the #replaceText is often useful, instead of writing the value in the #meta definition you use a unique word (Like Max_output_freq) and then each #metadef has a #replaceText to replace the unique word with the actual value.


 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4246 on: June 23, 2025, 06:35:47 pm »
So, uh, what did I screw up here?

#metadef
#idString Rohde&Schwarz,SMIQ06B,
#name     R&S SMIQ06B
#handle   SMIQ06B
#port     com 5025 LXI GPIB
#baudrate 115200
#replaceText MaxFreq 6.4G

#meta
#idString Rohde&Schwarz,SMIQXXX,
#name     R&S SMIQXXX
#handle   SMIQXXX
#port     com 5025 LXI GPIB
#baudrate 115200

Thanks,
Josh
« Last Edit: June 23, 2025, 06:38:09 pm by KungFuJosh »
"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: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4247 on: June 23, 2025, 06:42:18 pm »
So, uh, what did I screw up here?

#metadef
#idString Rohde&Schwarz,SMIQ06B,
#name     R&S SMIQ06B
#handle   SMIQ06B
#port     com 5025 LXI GPIB
#baudrate 115200
#replaceText MaxFreq 6.4G

#meta
#idString Rohde&Schwarz,SMIQXXX,
#name     R&S SMIQXXX
#handle   SMIQXXX
#port     com 5025 LXI GPIB
#baudrate 115200

That looks fine, except you do not need to include #port and #baudrate in the #metadef when they are exactly the same as in the #meta
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4248 on: June 23, 2025, 06:49:24 pm »
Ok, so what's breaking this file then? It works fine without the meta/metadef stuff, but once that's added, the SMIQ devices don't exist in the dropdown list on the Load devices tab.

Thanks,
Josh
« Last Edit: June 23, 2025, 07:04:07 pm by KungFuJosh »
"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: 4789
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4249 on: June 23, 2025, 07:00:42 pm »
Ok, so what's breaking this file then? It works fine without the meta/metadef stuff, but once that's added, the SMIQ devices don't exist in the dropdown list on the Load devices tab.

Try moving the #helpurl into the #meta section, instead of placing it before the #metadef
 
The following users thanked this post: KungFuJosh


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf