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

0 Members and 188 Guests are viewing this topic.

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 969
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5825 on: February 21, 2026, 02:35:19 pm »
No I don't

If I comment out the 4 #cmdSetup toggleButton I have, the debug command works.

The are 4 buttons all with #cmdSetup toggleButton Output to group them together.



I found the problem !!!!!!

I use a grouped buttons called Output, but I also have a {page} called Output !!

So if I rename the  toggleButton Output into  toggleButton Output1 it works again.


I do want both to have the same name though...

I only get the java exception when I add the debug statement.... works fine if I remove the debug statement



The group creates a variable, should it do that ?
« Last Edit: February 21, 2026, 02:56:25 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5826 on: February 21, 2026, 03:10:01 pm »

I found the problem !!!!!!

I use a grouped buttons called Output, but I also have a {page} called Output !!

That explains it and only solution is to use different names.
A bit about the var system:
A var is in two parts:
A container that has the name and space for a value.
A value that is put into the container.
A struct or array is simply a special value that get put into the container, exactly like int, string or double.
But there is a interlock: A struct or array cannot be changed to a regular value type and a regular value type cannot be changed to a struct or array.
You hit the issue that the var container already had a regular value, but you tried to replace it with struct. That triggered the error message.
 
The following users thanked this post: 2X

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 969
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5827 on: February 21, 2026, 03:14:31 pm »
But only the :enable: return1(displayVar(split(getVarList(1),"\n"))); triggered this?

Since the Setup menu works fine and no Java errors if they are the same name.

I now use Output_
« Last Edit: February 21, 2026, 03:20:36 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5828 on: February 21, 2026, 03:20:44 pm »
But only the :enable: return1(displayVar(split(getVarList(1),"\n"))); triggered this?

:enable: and :visible: creates these variable, the adv control do also create them.

Since the Setup menu works fine and no Java errors if they are the same name.

TC can handle controls with the same name, but it spoils the vars that get used for the above. Usually it do not give an error, it assigns the value from the last control to the var.
 
The following users thanked this post: 2X

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 969
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5829 on: February 21, 2026, 03:51:09 pm »
Can I make a {page} (or Tab as I call it) in a Setup menu, default when opening ?

Or is the only way to re-order the {page} to be the first one in the definition to open as default ?

Did you miss this question?

Reordering is the only way to go ?
They say attention is a shovel. It's time to dig 'em out.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5830 on: February 21, 2026, 03:54:31 pm »
Can I make a {page} (or Tab as I call it) in a Setup menu, default when opening ?

Or is the only way to re-order the {page} to be the first one in the definition to open as default ?

Did you miss this question?

Reordering is the only way to go ?

Sorry about that. No you cannot, it will always be first page,
 
The following users thanked this post: 2X

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #5831 on: February 25, 2026, 09:07:49 am »
Hi HKJ.
How do I set the request time interval so that requests for values ​​from the #ackvalues ​​device occur once per second? ...or 2 sec?
tks...

Hi flash2b,,, and if you know, please tell me.
« Last Edit: February 25, 2026, 09:52:07 am by homico »
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5832 on: February 25, 2026, 09:48:02 am »
Hi HKJ.
How do I set the request time interval so that requests for values ​​from the #ackvalues ​​device occur once per second? ...or 2 sec?
tks...

You do not, #askValues is called each time TC needs a new sample, different display uses different sample rate and the only one you control is logging.
TC will reuse a sample for multiple purposes to not artificially increase sample rate.
 

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #5833 on: February 25, 2026, 10:01:40 am »
ok,, i understand.

Can I have another question from a newbie Ж: how to write the formula :readmath: so that the voltage parameter is displayed as multiplied by 2 and sent to the device as half as much.
2770317-0
2770333-1
« Last Edit: February 25, 2026, 10:31:59 am by homico »
 
The following users thanked this post: 2X

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #5834 on: February 25, 2026, 10:13:58 am »
Well, I've made some progress connecting two electronic loads as one.

2770329-0
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5835 on: February 25, 2026, 10:38:08 am »
ok,, i understand.

Can I have another question from a newbie Ж: how to write the formula :readmath: so that the voltage parameter is displayed as multiplied by 2 and sent to the device as half as much.

That is two questions:
To double the incoming value:
:readmath: value*2
To write half the value:
:write: command (value/2)


 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5836 on: February 25, 2026, 10:39:37 am »
Well, I've made some progress connecting two electronic loads as one.

You are aware that TC has a popup (A panel in GridPanel) to control a number of load and automatic distribute the load across them.
 

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #5837 on: February 25, 2026, 12:07:38 pm »
Yes, I remember you wrote... it's where /Specific Device Setting/ ....
But I didn't understand how to use it.  :(

Or - in me case this function don^t work
2770375-0
« Last Edit: February 25, 2026, 12:49:11 pm by homico »
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5838 on: February 25, 2026, 12:14:19 pm »
Yes, I remember you wrote... it's where /Specific Device Setting/ ....
But I didn't understand how to use it.  :(

For it to work the load must support a few interface commands.
The you can right click in the panel, select loads, define current settings.
There is also a min setting that defines when TC use more than one load.
 

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #5839 on: February 25, 2026, 12:52:47 pm »
...the image didn't load...
The "Devices" tab doesn't see my loads (?!)
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5840 on: February 25, 2026, 12:56:04 pm »
...the image didn't load...
The "Devices" tab doesn't see my loads (?!)

Then they do not implement the required interface commands.
 

Offline homico

  • Contributor
  • Posts: 43
  • Country: ru
Re: Program that can log/control many multimeters and other devices.
« Reply #5841 on: February 25, 2026, 12:56:56 pm »
But these loads are MODBUS and work with command reassignment.

 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5842 on: February 25, 2026, 01:25:32 pm »
But these loads are MODBUS and work with command reassignment.

It do not matter, you can easily implement interface commands on modbus, what is needed is:
setOn()
setCurrent()
and maybe also getCurrent()
https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html#A_generic_interface
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 969
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5843 on: February 25, 2026, 02:32:42 pm »
homico

You should add this to the original definition:

#interfaceType Load
#interface setOn on (value)
#interface setCurrrent current (value)
#interface getCurrent current?
#interface readVoltage 0
#interface readCurrent 1
They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 969
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5844 on: February 25, 2026, 02:50:34 pm »
#cmdSetup toggleButton Output_
:read: setVoltageCH1?
:write: setVoltageCH1 ((value==1)?lastVoltageCH1:0
CH1_Off 0
CH1_On 1

I get a Java exception: Exception in thread "AWT-EventQueue-0" dk.hkj.script.ProgramExceptions$UnknownException: Variable not found lastVoltageCH1
(value==1)?double(lastVoltageCH1)____<----____:0

But I have declared the lastVoltageCH1 variable and defaulted to 0.00 with :setvar: lastVoltageCH1=0.00 in my init.

What do I do wrong ?

They say attention is a shovel. It's time to dig 'em out.
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5845 on: February 25, 2026, 02:54:36 pm »
#cmdSetup toggleButton Output_
:read: setVoltageCH1?
:write: setVoltageCH1 ((value==1)?lastVoltageCH1:0
CH1_Off 0
CH1_On 1

I get a Java exception: Exception in thread "AWT-EventQueue-0" dk.hkj.script.ProgramExceptions$UnknownException: Variable not found lastVoltageCH1
(value==1)?double(lastVoltageCH1)____<----____:0

But I have declared the lastVoltageCH1 variable and defaulted to 0.00 with :setvar: lastVoltageCH1=0.00 in my init.

What do I do wrong ?

This stuff is generally support in #scpiCmd, not everywhere.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 969
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5846 on: February 25, 2026, 03:10:12 pm »
I had already devised a toggleVoltageCH1 #pgm# that fulfilled my needs, but was curious if it could be shorter.
They say attention is a shovel. It's time to dig 'em out.
 
The following users thanked this post: 2X

Offline Tjuurko

  • Regular Contributor
  • *
  • Posts: 165
Re: Program that can log/control many multimeters and other devices.
« Reply #5847 on: February 26, 2026, 09:20:21 am »
Code: [Select]
#driver Modbus

#scpiCmd A holding 0x10 (value) *ScaleFactor
#scpiCmd A? holding? 0x10 /ScaleFactor
#scpiCmd B holding 0x11 (value) *ScaleFactor
#scpiCmd B? holding? 0x11 /ScaleFactor
#scpiCmd C holding 0x12 (value)
#scpiCmd C? holding? 0x12
How can I make "ScaleFactor" change depending on "C"?
"C"=0, "ScaleFactor"=10
"C"=1, "ScaleFactor"=100
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4841
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5848 on: February 26, 2026, 10:18:54 am »
Code: [Select]
#driver Modbus

#scpiCmd A holding 0x10 (value) *ScaleFactor
#scpiCmd A? holding? 0x10 /ScaleFactor
#scpiCmd B holding 0x11 (value) *ScaleFactor
#scpiCmd B? holding? 0x11 /ScaleFactor
#scpiCmd C holding 0x12 (value)
#scpiCmd C? holding? 0x12
How can I make "ScaleFactor" change depending on "C"?
"C"=0, "ScaleFactor"=10
"C"=1, "ScaleFactor"=100

You cannot use the shorthand *100 or /100, but must use expression, this means for reading you use readmath:

#scpiCmd A? holding? 0x10
:readmath: value*ScaleFactor

And for writing you use inline expressions
#scpiCmd A holding 0x10 (value*ScaleFactor)

The above assumes you create a var called ScaleFactor:
#scpiCmd C holding 0x12 (value)
:setvar: ScaleFactor=value==0?10:100

You must initialize the var before its first use, i.e. call C from #initCmd

 

Offline monz

  • Contributor
  • Posts: 25
Re: Program that can log/control many multimeters and other devices.
« Reply #5849 on: February 27, 2026, 02:07:01 am »
Hello, it was suggested that I ask this in this thread as it may be related to a bug.

I built an AR488 GPIB interface and it seems to work ok. I have two HP 34401As configured and connected. When I configure both in Testcontroller, it's not able to talk to either.

However, If I disable either one, the enabled one works as expected. Just not when both are enabled.  I'm not changing any of the connections, so I think the cabling is ok.

I'm using a standard GPIB cable between the two and plugging the AR488 in to the back of the cable.

I can connect via serial terminal to the AR488 and access either with no trouble by manually entering commands.

Any ideas?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->