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

Chernobyl and 20 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4500 on: September 10, 2025, 01:56:28 pm »
I wrote each command on the command line and then from the log window I marked both commands with the mouse and I select the F2 key. If I press one time the F2 it starts log and the second time when I press it stops. There is a way to make that every time I will press the F2 to clear the table and start logging from the begging and to have to press it two times.

It look like something goes wrong with #cleartable when TC is logging.
Try using these two lines instead:

#log 0
#log 1

They work. The first one stops logging, the second one starts logging and that includes clearing the table.
 
The following users thanked this post: 2X

Offline punaise

  • Newbie
  • Posts: 2
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #4501 on: September 10, 2025, 02:07:40 pm »
Hello HKJ,

Thanks for the information and support.
I solved my issue by writing a specific driver (attached).
It is working fine for me.

Many thanks.

Punaise.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4502 on: September 10, 2025, 02:26:40 pm »
Thanks for the information and support.
I solved my issue by writing a specific driver (attached).
It is working fine for me.

I will include it, but add a V+A to the name and a note to it.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4503 on: September 10, 2025, 03:59:46 pm »
I'm guessing I'm trying to do this oversimplified. I want to hide the CH1 page when :CHAN1:STAT? is OFF.


Code: [Select]
#cmdSetup toggleButton Channels Main
:read: :CHAN1:STAT?
:write: :CHAN1:STAT
:string:
:nogrid:
:color: gray yellow
:update: Channels,Channel_1,Channel_2,Channel_3,Channel_4
:tip: Enable or disable channel
CH1 OFF
CH1 ON

#cmdSetup selector CH1_visible_in_On_State Main
:read: :CHAN1:STAT?
OFF
ON CH1

CH1 is the page. For example:
Code: [Select]
#cmdSetup info CH1_Unit CH1
:read: :CHAN1:UNIT?
:readmath: replace(replace(value,"V","Volts"),"A","Amps"))
:tip: Channel unit.

What is required to make this work?

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

Offline 2X

  • Frequent Contributor
  • **
  • Posts: 726
  • Country: gr
Re: Program that can log from many multimeters.
« Reply #4504 on: September 10, 2025, 04:02:40 pm »
I wrote each command on the command line and then from the log window I marked both commands with the mouse and I select the F2 key. If I press one time the F2 it starts log and the second time when I press it stops. There is a way to make that every time I will press the F2 to clear the table and start logging from the begging and to have to press it two times.

It look like something goes wrong with #cleartable when TC is logging.
Try using these two lines instead:

#log 0
#log 1

They work. The first one stops logging, the second one starts logging and that includes clearing the table.

With the "#log 0" & "#log 1" now works perfectly. I beleive it would be useful to be a clear button on the "Chart" and on the "Table" tab.
Many thanks again for your time to reply.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4505 on: September 10, 2025, 04:06:12 pm »
I'm guessing I'm trying to do this oversimplified. I want to hide the CH1 page when :CHAN1:STAT? is OFF.

One obvious detail is that CH1 is not the correct name.
You can use CH1. for all controls on CH1 page
or you can use CH1.CH1_Unit for that specific control
Using CH1_Unit will work if you do not use page names.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4506 on: September 10, 2025, 04:23:10 pm »
I'm guessing I'm trying to do this oversimplified. I want to hide the CH1 page when :CHAN1:STAT? is OFF.

One obvious detail is that CH1 is not the correct name.
You can use CH1. for all controls on CH1 page
or you can use CH1.CH1_Unit for that specific control
Using CH1_Unit will work if you do not use page names.

Do you mean I need the dot?: CH1. instead of CH1?
ETA: Yup.  :palm: Thanks!

It's confusing because it's easy to look over the period in the instructions.

Thanks,
Josh
« Last Edit: September 10, 2025, 04:26:59 pm by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
Best Continuity Tester Ever...Got Betterer!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4507 on: September 10, 2025, 04:26:07 pm »
How is CH1 not the correct name? If so, that's confusing because your website says:
Quote
The "control" is the name of a control, when pages are used use page.name or page. for all controls on that page (The page will not be created then, because all controls are inside the selector).

CH1 is the page name, so shouldn't it work? I want to hide the whole page.

The quote is correct, you have to look out for the point (.).

I would assume that means I can hide all by designating CH1 (page), or hide a specific item by designating CH1.CH1_Unit (page.name).

Correct.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4508 on: September 10, 2025, 04:29:09 pm »
Thanks! I edited my reply before I saw your response. It's very easy to overlook the dot. I'd suggest adding color to that so it's clearer on your website, or add something in parenthesis to point out the point. Then the page. in the middle of the sentence is more obvious for dummies reading too quickly.  :-DD
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
Best Continuity Tester Ever...Got Betterer!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4509 on: September 10, 2025, 04:33:17 pm »
Thanks! I edited my reply before I saw your response. It's very easy to overlook the dot. I'd suggest adding color to that so it's clearer on your website, or add something in parenthesis to point out the point. Then the page. in the middle of the sentence is more obvious for dummies reading too quickly.  :-DD

I have added text pointing it out, it wont be published yet due to the :noGrid: documentation that do not work in the current version.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4510 on: September 10, 2025, 04:42:51 pm »
I want to hide the entire page/tab, including the tab. The selectors work to hide the content of the page/tab, but not the tab itself.

If I place the selectors on the Main page, then it hides the entire CH1 page, but it also shows the CH1 page content on the Main page, instead of adding a new tab for that page.

If I place the selectors on the channel pages, then it always shows the tab. Depending on the button state, it either shows the content or blank space (I created an empty separator as you suggested, and placed it on the Main tab).

Is there currently a way to hide the tab also?

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

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4511 on: September 10, 2025, 04:47:42 pm »
I want to hide the entire page/tab, including the tab. The selectors work to hide the content of the page/tab, but not the tab itself.

If I place the selectors on the Main page, then it hides the entire CH1 page, but it also shows the CH1 page content on the Main page, instead of adding a new tab for that page.

If I place the selectors on the channel pages, then it always shows the tab. Depending on the button state, it either shows the content or blank space (I created an empty separator as you suggested, and placed it on the Main tab).

Is there currently a way to hide the tab also?

No, you cannot hide a tab.
You can add a info control that says: "Channel is off" to show on the tab, instead of the normal content.

One advantage with selector is that hidden controls are not updated, this often makes TC faster.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4512 on: September 10, 2025, 04:51:57 pm »
I want to hide the entire page/tab, including the tab. The selectors work to hide the content of the page/tab, but not the tab itself.

If I place the selectors on the Main page, then it hides the entire CH1 page, but it also shows the CH1 page content on the Main page, instead of adding a new tab for that page.

If I place the selectors on the channel pages, then it always shows the tab. Depending on the button state, it either shows the content or blank space (I created an empty separator as you suggested, and placed it on the Main tab).

Is there currently a way to hide the tab also?

No, you cannot hide a tab.
You can add a info control that says: "Channel is off" to show on the tab, instead of the normal content.

One advantage with selector is that hidden controls are not updated, this often makes TC faster.

Fair enough. A future feature request then. ;)

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

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4513 on: September 10, 2025, 09:42:51 pm »
Is it possible to have sub pages / nested pages?

For example, I have a page tab for Trigger. There's way too many options for triggers, but I don't want to have 10 pages added on the top level if I separate them. I'm going to see if hiding each section when inactive is sufficient, but in some cases I think having separate subpages would be better.

For example:
#cmdSetup combobox Trigger_Selector Trigger ;parent page
#cmdSetup combobox Trigger_Edge Trigger:Edge ;child page

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

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4514 on: September 11, 2025, 01:27:45 am »
Sorry for using the B-word, but I think I found a bug (attempting to set 10u):

Code: [Select]
;; Magnova: Tx <:TRIG:SHOL:STIM 1.0000000000000001E-7>
;; Magnova: Tx <:TRIG:SHOL:STIM?>
;; Magnova: Rx <1E-07>
;; Magnova: Rx as number <1.0E-7>
;; Magnova: Tx <:TRIG:SHOL:STIM 9.999999999999999E-6>
;; Magnova: Tx <:TRIG:SHOL:STIM?>
;; Magnova: Rx <9.999E-06>
;; Magnova: Rx as number <9.999E-6>

This is not limited to any specific number box, it happens in those I've tried so far, but here's an example of one:
Code: [Select]
#cmdSetup number Setup_Time Trigger_Shold
s 1n 10
:read: :TRIG:SHOL:STIM?
:write: :TRIG:SHOL:STIM #
:update: Setup_Time
:tip: Set the setup time.

If I enter 1n, 10n, 100n, 1u-4u, no issue. When I enter 5u to 100u, it sends the wrong value. Setting 10u is the example from the debug log above. 5u comes back as 4.999u. nano and mili work fine. 101u and above seem fine too.

This only occurs when TC converts the numbers from the setup window. Command line sends everything correctly. For example:
Code: [Select]
:TRIG:SHOL:STIM?
;; 0.000101
:TRIG:SHOL:STIM 100u
:TRIG:SHOL:STIM?
;; 0.0001

Thanks,
Josh
« Last Edit: September 11, 2025, 02:37:40 am by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
Best Continuity Tester Ever...Got Betterer!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4515 on: September 11, 2025, 06:18:23 am »
Is it possible to have sub pages / nested pages?

For example, I have a page tab for Trigger. There's way too many options for triggers, but I don't want to have 10 pages added on the top level if I separate them. I'm going to see if hiding each section when inactive is sufficient, but in some cases I think having separate subpages would be better.

For example:
#cmdSetup combobox Trigger_Selector Trigger ;parent page
#cmdSetup combobox Trigger_Edge Trigger:Edge ;child page

The answer is no, but I will think about it.

If I do it the style will be similar to the separator, not with extra page names. This is because extra page names would require a major overhaul of the code, a control similar to the separator would not.
 
The following users thanked this post: KungFuJosh

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4516 on: September 11, 2025, 06:33:02 am »
Sorry for using the B-word, but I think I found a bug (attempting to set 10u):

Interesting, I do plea innocence, it is the computer!

This expression: Double.parseDouble("10") * 1.0e-6; returns 9.999999999999999E-6

Technically it is because decimal numbers in a computer are nearly never precise. The reason is they use base 2 instead of 10, it is a very small error, but it is always there. You can find the same issue on many calculators (Typically 1/3*3-1 do not give zero), but in some smarter calculators they use a complicated algorithm that eliminates this error (That algorithm is not practical for a computer).

I will see if I can add some rounding to fix it.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4517 on: September 11, 2025, 03:29:34 pm »
Is it possible to force it to send the XXXu instead of converting? Then you don't need any rounding. 5u to 100u work fine in the command prompt without converting the number.

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

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4518 on: September 11, 2025, 03:36:19 pm »
Is it possible to force it to send the XXXu instead of converting? Then you don't need any rounding. 5u to 100u work fine in the command prompt without converting the number.

It is always possible to add formatting, something like this can be used:
:write: (formatSI(value,4))

https://lygte-info.dk/project/TestControllerFunctions%20UK.html#formatSI

I have added that rounding and it would probably be useful in other places in TC, but I am not going to find all of them.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4519 on: September 11, 2025, 04:02:47 pm »
Thanks! That works nicely. I changed it to:

:write: :TRIG:SHOL:STIM (formatSI(value))

Now I need to update all the others with the issue.

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

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4520 on: September 11, 2025, 04:09:13 pm »
Riddle me this, Batman... Why isn't it consistently weird?

Code: [Select]
#cmdSetup number Negative_Edge_Trigger_Level Trigger_NEdge
_ 0 2.1k
:read: :TRIG:NEDG:LEV?
:write: :TRIG:NEDG:LEV #
:update: Negative_Edge_Trigger_Level
:tip: Set the trigger level in V or A.

#cmdSetup number Negative_Edge_Idle Trigger_NEdge
s 100n 10
:read: :TRIGger:NEDGe:IDLe?
:write: :TRIGger:NEDGe:IDLe #
:update: Negative_Edge_Idle
:tip: Set the negative edge trigger idle time.

Only one of those screw it up??

ETA: It appears any level line so far works without (formatSI(value)) but any value relating to time (s) does need the correction. Changing the s to _ has no effect.

Thanks,
Josh
« Last Edit: September 11, 2025, 04:36:28 pm by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
Best Continuity Tester Ever...Got Betterer!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4521 on: September 11, 2025, 04:45:37 pm »
Riddle me this, Batman... Why isn't it consistently weird?

...

Only one of those screw it up??

ETA: It appears any level line so far works without (formatSI(value)) but any value relating to time (s) does need the correction. Changing the s to _ has no effect.

I have no idea, they all goes through exactly the same code.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4522 on: September 11, 2025, 04:58:09 pm »
Riddle me this, Batman... Why isn't it consistently weird?

...

Only one of those screw it up??

ETA: It appears any level line so far works without (formatSI(value)) but any value relating to time (s) does need the correction. Changing the s to _ has no effect.

I have no idea, they all goes through exactly the same code.

Me neither. I tried changing the ranges, and matched everything besides the :write: variable, and it didn't change the behavior.

Then, to make it even weirder, I copied just the :TRIGger:NEDGe:IDLe (that has the error) to replace the :TRIG:NEDG:LEV (no error) in the Negative_Edge_Trigger_Level command, and the bug followed it, despite all else being the same as it was with Level.

In other words, this works:
Code: [Select]
#cmdSetup number Negative_Edge_Trigger_Level Trigger_NEdge
_ 0 2.1k
:read: :TRIG:NEDG:LEV?
:write: :TRIG:NEDG:LEV #
:update: Negative_Edge_Trigger_Level
:tip: Set the trigger level in V or A.

This does not:
Code: [Select]
#cmdSetup number Negative_Edge_Trigger_Level Trigger_NEdge
_ 0 2.1k
:read: :TRIGger:NEDGe:IDLe?
:write: :TRIGger:NEDGe:IDLe #
:update: Negative_Edge_Trigger_Level
:tip: Set the trigger level in V or A.

And for reference, they both respond the same:
Code: [Select]
:TRIGger:NEDGe:IDLe 10u
:TRIGger:NEDGe:IDLe?
;; 1E-05
:TRIG:NEDG:LEV 10u
:TRIG:NEDG:LEV?
;; 1E-05


Weird. Anyway, the screwy commands work fine with (formatSI(value)) instead of the #.

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

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4965
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #4523 on: September 11, 2025, 05:13:36 pm »
Me neither. I tried changing the ranges, and matched everything besides the :write: variable, and it didn't change the behavior.

Then, to make it even weirder, I copied just the :TRIGger:NEDGe:IDLe (that has the error) to replace the :TRIG:NEDG:LEV (no error) in the Negative_Edge_Trigger_Level command, and the bug followed it, despite all else being the same as it was with Level.

And nothing of that matters, the code converts the input value to double and in the next line convert it back to string. That way output is always supposed to be in a predictive format, independent of how your type the input value. All the bit about combining it with the command is done somewhere else in the code.
I wonder if it has something to do with how the calculating part of the cpu do rounding it is a bit far fetched, but not completely impossible.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8471
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #4524 on: September 11, 2025, 05:16:44 pm »
Me neither. I tried changing the ranges, and matched everything besides the :write: variable, and it didn't change the behavior.

Then, to make it even weirder, I copied just the :TRIGger:NEDGe:IDLe (that has the error) to replace the :TRIG:NEDG:LEV (no error) in the Negative_Edge_Trigger_Level command, and the bug followed it, despite all else being the same as it was with Level.

And nothing of that matters, the code converts the input value to double and in the next line convert it back to string. That way output is always supposed to be in a predictive format, independent of how your type the input value. All the bit about combining it with the command is done somewhere else in the code.
I wonder if it has something to do with how the calculating part of the cpu do rounding it is a bit far fetched, but not completely impossible.

I've no idea. It makes no sense that one SCPI command would do it, and another wouldn't. Consistently. I also had another command that turned 400u to 399u.  :-//
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
Best Continuity Tester Ever...Got Betterer!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->