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

HKJ, flash2b, SerjP and 26 Guests are viewing this topic.

Offline Kurt_!

  • Regular Contributor
  • *
  • Posts: 208
  • Country: at
Re: Program that can log/control many multimeters and other devices.
« Reply #4900 on: October 11, 2025, 05:14:43 am »
Still the FA-3...

Oh...my English...
 

Offline Kurt_!

  • Regular Contributor
  • *
  • Posts: 208
  • Country: at
Re: Program that can log/control many multimeters and other devices.
« Reply #4901 on: October 11, 2025, 08:18:20 am »
With this command "#driver asciiBlock" he did not log
Oh...my English...
 

Offline Kurt_!

  • Regular Contributor
  • *
  • Posts: 208
  • Country: at
Re: Program that can log/control many multimeters and other devices.
« Reply #4902 on: October 11, 2025, 08:59:02 am »
#value Frequency_A Hz SI FA ( CH1 )
#value Frequency_B Hz SI FB ( CH2 )
Channels A and B are displayed correctly.
I was previously only using CH1....

Name changed as in start screen
Oh...my English...
 

Offline Kurt_!

  • Regular Contributor
  • *
  • Posts: 208
  • Country: at
Re: Program that can log/control many multimeters and other devices.
« Reply #4903 on: October 11, 2025, 09:22:32 am »
Question: What can I adjust better?
In the chart on the left. (Values)
It's a cheap OCXO board....

Is there anything written about these settings somewhere?

« Last Edit: October 11, 2025, 09:24:36 am by Kurt_! »
Oh...my English...
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4904 on: October 11, 2025, 09:31:14 am »
Question: What can I adjust better?
In the chart on the left. (Values)
It's a cheap OCXO board....

Is there anything written about these settings somewhere?

Select the "Scale for charts" page.
You might want to click on the header "Minimum" or "Maximum", that will change it to "Center" and "Span"
Remove the "Auto" checkmark and fill in some good values for center and span (Maybe 10M and 1) for the frequency row. Take a look on the charts and fine adjust them.
« Last Edit: October 11, 2025, 09:33:06 am by HKJ »
 
The following users thanked this post: KungFuJosh

Offline Kurt_!

  • Regular Contributor
  • *
  • Posts: 208
  • Country: at
Re: Program that can log/control many multimeters and other devices.
« Reply #4905 on: October 11, 2025, 09:57:33 am »
Question: What can I adjust better?
In the chart on the left. (Values)
It's a cheap OCXO board....

Is there anything written about these settings somewhere?

Select the "Scale for charts" page.
You might want to click on the header "Minimum" or "Maximum", that will change it to "Center" and "Span"
Remove the "Auto" checkmark and fill in some good values for center and span (Maybe 10M and 1) for the frequency row. Take a look on the charts and fine adjust them.

I've had it before.
It's very sensitive.
I'll keep testing.
Thanks
Oh...my English...
 

Online flash2b

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #4906 on: October 12, 2025, 08:07:53 am »
If I set a variable using :setvar: within the askMode? scpiCmd, and i do a #cmdMode using the Mode menu, TC issues an automatic #askMode get the working mode of the device. However the variable that is set does not change afterwards.
If I do an #askModeGet or the same #askMode again, the variable is set.

Why is this ?

I looks like the automatic askMode runs in parallel from the rest of the code in the definition and values are not passed towards that other thread.

I  have tried delays [xxx];, :updatedelayed: etc. but the Setup menu does not show in sync and Yes, i am using :updatemodechange: to fetch mode changes, while reading the value content with :readmath: it shows the value is actually changed. But some time between the cmdMode execution and the completion of it the existing values where assigned.

All I can say it is the most annoying feature while making a definition, determining the impact on the Setup menu after a :updatemodechange: since there is no synchronization when the actual  #cmdMode execution is complete.

I am using the ascii driver and a 'slow'  device on 9600 bps.
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4907 on: October 12, 2025, 08:47:13 am »
If I set a variable using :setvar: within the askMode? scpiCmd, and i do a #cmdMode using the Mode menu, TC issues an automatic #askMode get the working mode of the device. However the variable that is set does not change afterwards.
If I do an #askModeGet or the same #askMode again, the variable is set.

Why is this ?

TC do a lot of stuff in parallel to increase speed, but vars are shared between threads. Generally each script get its own content, including vars, but that script/content is used across threads, because all threads uses the same code.

In the ascii driver it is "public synchronized boolean write(String msg)" that handles all communication with the device, scpiCmd and also :setvar: (The synchronized word prevents two threads from using it simultaneous).

There are bugs in my code, but I am not sure if that is the issue here.
 

Online flash2b

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #4908 on: October 12, 2025, 01:58:44 pm »
When :updatemodechange: updates a control on the Setup menu, the value of variable was not synchronized. If i do a manual :readmath: variable via a dummy scpiCmd the value is there, but the screen logic used the value it was just before the mode change. If I add a wait within the Setup menu control, like 1 second, it is still using the previous value.

It seems that :updatemodechange: is triggered before the actual mode change is complete. :updatedelayed: also does not help to correct it.

:updatemodechange: should be triggered after mode change is complete and the variable from that thread are synchronized. Maybe we need :updatemodechangecomplete: if needed to support both, but my opinion is that the setup menu should not be rendered during the modechange since a lot of meters keep their settings (e.g. range, sampling time) together with there mode. Like ACV Auto, DCV 100V, and Ohm Auto.

My workaround is to do a second askMode or use the new cmdModeGet command. I see then the setup menu get rendered correctly. But adding another askMode costs additional time due to the communication to the meter.

Also when I close the setup menu and re-open, without an askMode, the screen gets rendered correctly. So the variables have the correct value.
« Last Edit: October 12, 2025, 02:01:57 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4909 on: October 12, 2025, 02:12:15 pm »
It sounds like you're using a #cmdMode button, and you want it to also update something in the #cmdSetup dialog?

What are you trying to do exactly?
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4910 on: October 12, 2025, 02:56:33 pm »
Is there a reason #SYNCPOPUPS ignores :readmath:?

For example, I have this:
#cmdSetup info Thermal_Status Main
:read: :SYST:THER:STAT?
:readmath: replace(replace(replace(value,"COLD","Cold"),"WUP","Warming Up"),"STABle","Stable")

It works as expected, however, when I did SYNCPOPUPS the info box showed COLD instead of Cold.

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4911 on: October 14, 2025, 10:59:50 am »
When :updatemodechange: updates a control on the Setup menu, the value of variable was not synchronized. If i do a manual :readmath: variable via a dummy scpiCmd the value is there, but the screen logic used the value it was just before the mode change. If I add a wait within the Setup menu control, like 1 second, it is still using the previous value.

It seems that :updatemodechange: is triggered before the actual mode change is complete. :updatedelayed: also does not help to correct it.

I do not remember the mode change sequence in TC, it is rather complex.
I have uploaded a new debug version with forced output to console, it shows what commands are send to the device and the result.

You can output your own info to console with printConsole("") or return0(printConsole("")), the last one can be used in places where you have an expression, it exist in a few version: return0, return1 and returnS (The last one returns a empty string)

 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4912 on: October 14, 2025, 11:00:30 am »
Is there a reason #SYNCPOPUPS ignores :readmath:?

For example, I have this:
#cmdSetup info Thermal_Status Main
:read: :SYST:THER:STAT?
:readmath: replace(replace(replace(value,"COLD","Cold"),"WUP","Warming Up"),"STABle","Stable")

It works as expected, however, when I did SYNCPOPUPS the info box showed COLD instead of Cold.

That is not supposed to happen, try the new debug version, output is to console.
 
The following users thanked this post: KungFuJosh

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4913 on: October 14, 2025, 05:28:40 pm »
That is not supposed to happen, try the new debug version, output is to console.


Normal:
Code: [Select]
;; Magnova: Tx <:SYST:THER:STAT?>
Tx input: :SYST:THER:STAT?
;; IP: Tx: <:SYST:THER:STAT?.> 3A 53 59 53 54 3A 54 48 45 52 3A 53 54 41 54 3F 0A
;; IP: Rx: <STABle> 53 54 41 42 6C 65 0A
Rx after processing: [STABle]
;; Magnova: Rx <STABle>
;; Magnova: Rx after :readmath: replace(replace(replace(value,"COLD","Cold"),"WUP","Warming Up"),"STABle","Stable") <Stable>

SYNCPOPUPS Command:
#scpiCmd SyncPops #pgm#
runScript("#syncPopups");
Result:
Code: [Select]
;; Magnova: Tx <SyncPops>
Tx input: SyncPops
;; Magnova: Script start
;; Magnova: Script end <1>
Tx after SCPIcmd: none
Rx after processing: [1]
;; Magnova: Tx <:SYST:THER:STAT?>
Tx input: :SYST:THER:STAT?
;; IP: Tx: <:SYST:THER:STAT?.> 3A 53 59 53 54 3A 54 48 45 52 3A 53 54 41 54 3F 0A
;; IP: Rx: <STABle> 53 54 41 42 6C 65 0A
Rx after processing: [1, STABle]
;; Magnova: Rx <1>
;; Magnova: Rx after :readmath: replace(replace(replace(value,"COLD","Cold"),"WUP","Warming Up"),"STABle","Stable") <1>

SYNCPOPUPS manually entered on command tab:
Code: [Select]
#syncPopups
;; Magnova: Cache Tx: <:SYST:THER:STAT?> Rx: <1>
;; Magnova: Rx after :readmath: replace(replace(replace(value,"COLD","Cold"),"WUP","Warming Up"),"STABle","Stable") <1>
;; Magnova: Cache Tx: <:ACQ:RCL?> Rx: <STABle>
;; Magnova: Rx after :readmath: replace(replace(value,"INT","Int"),"EXT","Ext") <STABle>

Thermal status response:
Code: [Select]
:SYST:THER:STAT?
;; Magnova: Tx <:SYST:THER:STAT?>
;; IP: Tx: <:SYST:THER:STAT?.> 3A 53 59 53 54 3A 54 48 45 52 3A 53 54 41 54 3F 0A
;; IP: Rx: <STABle> 53 54 41 42 6C 65 0A
;; Magnova: Rx <STABle>
;; STABle

Maybe a bug with the caching?

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

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4914 on: October 15, 2025, 12:51:17 am »
I have what's probably a feature request that you probably won't like. ;)

I want to be able to color code options in a combobox. For example:
Code: [Select]
#cmdSetup combobox Waveform Output_1
:write: c1:BSWV WVTP,#
:read: c1:BSWV?
:readmath: getElement(value,1,",")
:update: Frequency Periode Amplitude Offset Duty_cycle Symmetry Arbitrary
:updatedelayed: 0.1
Sine SINE :color: red
Square SQUARE :color: red
Ramp RAMP :color: blue
Pulse PULSE
Noise NOISE :color: pink
Arbitrary ARB
DC DC

The reason being that I would like to color code values that will always be listed, but not always functional. Specific memory depths are available depending on the number of active channels, and I'd like that color coded. The alternative is to either ignore it, or use selectors to hide different comboboxes based on the number of active channels, but that's more effort than this function is worth. ;)

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

Online flash2b

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #4915 on: October 15, 2025, 06:36:15 am »
I do not remember the mode change sequence in TC, it is rather complex.
I have uploaded a new debug version with forced output to console, it shows what commands are send to the device and the result.

You can output your own info to console with printConsole("") or return0(printConsole("")), the last one can be used in places where you have an expression, it exist in a few version: return0, return1 and returnS (The last one returns a empty string)

Where can I download this debug version, since I would really want to get the problem found.
They say attention is a shovel. It's time to dig 'em out.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4916 on: October 15, 2025, 01:59:09 pm »
Where can I download this debug version, since I would really want to get the problem found.

betas are always here: https://lygte-info.dk/pic/Projects/TestController/TestController.jar
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 
The following users thanked this post: flash2b

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4917 on: October 16, 2025, 01:14:32 am »
There's a weird bug in 2.80 that's not present in 2.79. Maybe it's related to the logging, I dunno.

In 2.79, I can open all the measurements I want, with no issues.

In 2.80, once I get to the 4th or 5th measurement, TC freezes. The combobox dropdown is frozen open, the windows don't update (including the debug log window), and that's it. I can switch between the windows, move them around, but the content in TC is entirely frozen.

See the screenshots for details. Note that the specific measurement it freezes on is entirely dependant on when you click the last measurement that freezes it. Last time was M3, the screenshot was M4, etc.

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

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log/control many multimeters and other devices.
« Reply #4918 on: October 17, 2025, 03:09:07 am »
I have a couple of items that are somewhat related to each other.

1. #scriptScript bug?
I've noticed what I perceive to be some issues with hidden scripts (that should use the #scriptScript tag).

Scripts can not be created in a text editor and saved in the appropriate directory so that Test Controller recognises them - they can only be saved via the UI in Test Controller.

Any modification to a script in a text editor results in Test Controller being unable to execute the script.

Saving a hidden script via the UI does not add the #scriptScript tag to the start of the script.

Hidden scripts by design can not be accessed by the menu for execution, which makes sense. However if Test Controller will not accept hidden scripts created or modified by a text editor, then they need to be listed under "Generate Scripts > List and manage scripts".

2. File dialogue convenience
It seems all file browse dialogues (on Windows) open to the last accessed directory. This makes sense for most programs, however I think it needs to be more granular:

For example, if from the Commands window I select "Save > Save as log", then it should default to the data directory (either the custom directory passed as an argument when starting, or the default directory if this is not present).

However, if I select any of the other options that are related to scripts, it should default to the script directory.

In the grand scheme of things these are minor gripes, but they make life a lot easier when you have vast directory structures to navigate to find your way back to the correct location - especially given that the file browse dialogue in java is fairly primitive.

3. Return variables from a script
I'm struggling to determine the syntax for returning a variable from a script that has been called.
I know in C it would be return <var_name>, and the function would be called with an assignment:
Code: [Select]
uint8_t new_variable = FunctionWithReturn();
But I can't work out how to do this with the Test Controller syntax. The only method I have found so far is to create a global variable in the parent script, then assign to that variable within the child script, but that is not good practise for flexible code.

What I have been doing:

Code: (Parent script) [Select]
=globalvar var_name = ""
#runScript MyScript (<argument>)


Code: (Child script "MyScript") [Select]
; Do things
=var_name = "Result of MyScript"
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4919 on: October 17, 2025, 11:02:47 am »
Normal:
...
SYNCPOPUPS Command:

I will have to setup a test and look at it.
 
The following users thanked this post: KungFuJosh

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4920 on: October 17, 2025, 11:04:48 am »
I have what's probably a feature request that you probably won't like. ;)

I want to be able to color code options in a combobox. For example:
Code: [Select]
#cmdSetup combobox Waveform Output_1
:write: c1:BSWV WVTP,#
:read: c1:BSWV?
:readmath: getElement(value,1,",")
:update: Frequency Periode Amplitude Offset Duty_cycle Symmetry Arbitrary
:updatedelayed: 0.1
Sine SINE :color: red
Square SQUARE :color: red
Ramp RAMP :color: blue
Pulse PULSE
Noise NOISE :color: pink
Arbitrary ARB
DC DC

The reason being that I would like to color code values that will always be listed, but not always functional. Specific memory depths are available depending on the number of active channels, and I'd like that color coded. The alternative is to either ignore it, or use selectors to hide different comboboxes based on the number of active channels, but that's more effort than this function is worth. ;)

I am not sure that is possible, the SCPI commands may accept a space and I am not going to check all definitions if it is used.
It would probably have to be a new combobox for this.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4921 on: October 17, 2025, 11:08:49 am »
There's a weird bug in 2.80 that's not present in 2.79. Maybe it's related to the logging, I dunno.

In 2.79, I can open all the measurements I want, with no issues.

In 2.80, once I get to the 4th or 5th measurement, TC freezes. The combobox dropdown is frozen open, the windows don't update (including the debug log window), and that's it. I can switch between the windows, move them around, but the content in TC is entirely frozen.

I do not believe I have changed anything with that logic in the update.
There is a bug, but it is extremely hard to find for me. I do not believe you can set the scope up in the virtual driver, it is way to complex, but that would be a way to open for my trying it out (But for simple stuff it can be done).
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4922 on: October 17, 2025, 11:21:26 am »
I have a couple of items that are somewhat related to each other.

1. #scriptScript bug?
I've noticed what I perceive to be some issues with hidden scripts (that should use the #scriptScript tag).

Scripts can not be created in a text editor and saved in the appropriate directory so that Test Controller recognises them - they can only be saved via the UI in Test Controller.

Any modification to a script in a text editor results in Test Controller being unable to execute the script.

Script can easily be edited and save with any plain ascii text editor, but you have to use the correct name and file location
Anything in ...\Documents\TestController\ScriptLibrary must end in ...Script.txt

And again: Use a plain ascii text editor, no extra control characters is allowed.

Saving a hidden script via the UI does not add the #scriptScript tag to the start of the script.

Hidden scripts by design can not be accessed by the menu for execution, which makes sense. However if Test Controller will not accept hidden scripts created or modified by a text editor, then they need to be listed under "Generate Scripts > List and manage scripts".

The UI do not by itself support hidden scripts, it is something you have to do.
I sort of agree with you about the management.

2. File dialogue convenience
It seems all file browse dialogues (on Windows) open to the last accessed directory. This makes sense for most programs, however I think it needs to be more granular:

For example, if from the Commands window I select "Save > Save as log", then it should default to the data directory (either the custom directory passed as an argument when starting, or the default directory if this is not present).

However, if I select any of the other options that are related to scripts, it should default to the script directory.

In the grand scheme of things these are minor gripes, but they make life a lot easier when you have vast directory structures to navigate to find your way back to the correct location - especially given that the file browse dialogue in java is fairly primitive.

The script directory is for menu scripts, not for any random script you make.
Most save dialogs remember the last save location, until you restart TC.

3. Return variables from a script
I'm struggling to determine the syntax for returning a variable from a script that has been called.
I know in C it would be return <var_name>, and the function would be called with an assignment:
Code: [Select]
uint8_t new_variable = FunctionWithReturn();
But I can't work out how to do this with the Test Controller syntax. The only method I have found so far is to create a global variable in the parent script, then assign to that variable within the child script, but that is not good practise for flexible code.

There are two ways to return values:
1) Last line of you script generate a value: It can be a function with a return value or a expression. Any datatype can be return this way.
2) You use the print() statement, it can be used multiple times in a function, the return value will always be string.

 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3905
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4923 on: October 17, 2025, 11:31:12 am »
Where can I download this debug version, since I would really want to get the problem found.

Josh already answered the location, but one extra note:
If I says I have uploaded a new test/beta, always check the version number is updated if you want to download it imminently. The server may be up to an hour delayed from I upload, until you can download it.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4924 on: October 17, 2025, 02:19:59 pm »
I am not sure that is possible, the SCPI commands may accept a space and I am not going to check all definitions if it is used.
It would probably have to be a new combobox for this.
That's fine with me. ;)

Or either way, you could possibly do:
:color: color1 color2 color3 separate of the choices, and let the colors assign in order of options.

Like this:
Code: [Select]
#cmdSetup combobox Waveform Output_1
:write: c1:BSWV WVTP,#
:read: c1:BSWV?
:readmath: getElement(value,1,",")
:update: Frequency Periode Amplitude Offset Duty_cycle Symmetry Arbitrary
:updatedelayed: 0.1
:color: red red red blue blue blue black
Sine SINE
Square SQUARE
Ramp RAMP
Pulse PULSE
Noise NOISE
Arbitrary ARB
DC DC



I do not believe I have changed anything with that logic in the update.
There is a bug, but it is extremely hard to find for me. I do not believe you can set the scope up in the virtual driver, it is way to complex, but that would be a way to open for my trying it out (But for simple stuff it can be done).
Whatever it is, I had to downgrade to 2.79 to continue testing my driver. 2.80 crashed, and 2.79 is stable. If there's something I can do to help test, let me know.

Thanks,
Josh
« Last Edit: October 17, 2025, 02:22:49 pm by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf