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

0 Members and 636 Guests are viewing this topic.

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5925 on: March 13, 2026, 06:39:54 pm »
, remove. Still not recognized.

« Last Edit: March 13, 2026, 06:42:27 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5926 on: March 13, 2026, 06:53:04 pm »
, remove. Still not recognized.

The battery test popup also checks on the mode of the DMM and it must include "volt" or it will not include it, as a thermometer the mode must include temp.
I.e. it checks for type=dmm, support readValue() and mode name includes "volt" (Not case sensitive)
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5927 on: March 13, 2026, 06:53:27 pm »
I also do not understand this  :o

I  have now:
#interfaceType Relay
#interface setRelays setOutput (value)
#interface readInput 0
#interface readOutput 1

Is this also wrong ??

Value is int that can set each channel 1-8 so 8 bits steer 8 relays, only 1 call !!

No, but notice that there are two calls for relays:
setRelays()
setRelay()
The first for a bitmask, the second for a specific relay and it requires declaring a unit for each relay.

Also note that it is legal to declare multiple types in the #interfaceType declaration, one obvious example is DMM and BMM, where BMM is bench multimeter that supports remote control, but it also works perfectly fine as a DMM.

Is this what you mean ?

They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5928 on: March 13, 2026, 06:58:37 pm »
, remove. Still not recognized.

The battery test popup also checks on the mode of the DMM and it must include "volt" or it will not include it, as a thermometer the mode must include temp.
I.e. it checks for type=dmm, support readValue() and mode name includes "volt" (Not case sensitive)

My Yokogawa definition, does not. (and a lot of other definitions (from other authors (and myself)) do also not follow this standard that you need.

It seems that I need to update (almost) all of my definitions to get further. (and others also need to update their stuff).

I will check my power supply next, but the Siglent load definition I did no write so I hope it works.

They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5929 on: March 13, 2026, 07:00:10 pm »
Is this what you mean ?

I am not sure what you mean, my relay definitions look this way:



PWM and Frequency is only relevant for SS relays, but notice it has both setRelay and setRelays and is defined as a four channel device (It is not, but I uses the same software for a couple of different relay boxes).
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5930 on: March 13, 2026, 07:03:44 pm »
, remove. Still not recognized.

The battery test popup also checks on the mode of the DMM and it must include "volt" or it will not include it, as a thermometer the mode must include temp.
I.e. it checks for type=dmm, support readValue() and mode name includes "volt" (Not case sensitive)

My Yokogawa definition, does not. (and a lot of other definitions (from other authors (and myself)) do also not follow this standard that you need.

It seems that I need to update (almost) all of my definitions to get further. (and others also need to update their stuff).

I will check my power supply next, but the Siglent load definition I did no write so I hope it works.

My PSU is recognized  8)

They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5931 on: March 13, 2026, 07:05:19 pm »
Is this what you mean ?

I am not sure what you mean, my relay definitions look this way:



PWM and Frequency is only relevant for SS relays, but notice it has both setRelay and setRelays and is defined as a four channel device (It is not, but I uses the same software for a couple of different relay boxes).

Tell me what is missing then....

I have now:
#interfaceType  Relay Relay:2 Relay:3 Relay:4
#interface setRelays setOutput (value)
#interface readInput 0
#interface readOutput 1

Note my relays remember their last state even after power off. Furthermore my relays have digital inputs as well that can be used as normal inputs but also to steer an output to high or low when they are related. The relation is global so but on on on for input and output.
« Last Edit: March 13, 2026, 07:08:20 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5932 on: March 13, 2026, 07:07:30 pm »
My Yokogawa definition, does not. (and a lot of other definitions (from other authors (and myself)) do also not follow this standard that you need.

I sort of expected that. This is the first popup that makes it really visible what is expected, a lot of grid panel items do also expect this, but not for as many different devices simultaneous.

It seems that I need to update (almost) all of my definitions to get further. (and others also need to update their stuff).

I will check my power supply next, but the Siglent load definition I did no write so I hope it works.

I generally do not enforce guidelines very strict and the usage of #interface has not been very obvious in the past, but for battery test I either needed to enforce it or add a separate device configuration page (Maybe more than one page).
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5933 on: March 13, 2026, 07:13:12 pm »
Tell me what is missing then....

I have now:
#interfaceType  Relay Relay:2 Relay:3 Relay:4
#interface setRelays setOutput (value)
#interface readInput 0
#interface readOutput 1

All this looks fine and is enough for TC to use it for battery test, but for the full implementation you also need:
getRelays() Returns the bitmask
setRelay()  Set one relay depending on device/unit handle
getRelay() Return status of one relay depending on device/unit handle

For the last two you use the defined channel variable to set or get a 0/1 status for the specified relay (I.e. the :number after the handle, TC do the math and gives you a channel variable with the correct number).
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5934 on: March 13, 2026, 07:25:38 pm »
getRelays() Returns the bitmask
setRelay()  Set one relay depending on device/unit handle
getRelay() Return status of one relay depending on device/unit handle

getRelays() I understand.

For the setRelay() and getRelay() I see that the handle is $10IOA01, $10IOA01:2, $10IOA01:3 or $10IOA01:4  (and so on).

Do I need to parse the hande to find out which bit I need to return? I probably need to do a #pgm# then ?

Conclusion for the battery test popup.

- PSU OK, 100%
- Relay OK, but work to be done. But kinda understand whats needed
- Voltmeter, NOK all my definitions need updating. (which is a lot of work)
- Temperature, NOK, work to be done. But kinda understand whats needed

Well I am a little disappointed. I will make some updates soon (for Temperature and Relay), but for my multi meter definitions I will not do this soon since the latter I spend already hours and hours writing and perfecting them.
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5935 on: March 13, 2026, 07:39:37 pm »
getRelays() Returns the bitmask
setRelay()  Set one relay depending on device/unit handle
getRelay() Return status of one relay depending on device/unit handle

getRelays() I understand.

For the setRelay() and getRelay() I see that the handle is $10IOA01, $10IOA01:2, $10IOA01:3 or $10IOA01:4  (and so on).

Do I need to parse the hande to find out which bit I need to return? I probably need to do a #pgm# then ?

No, as I stated above then channel variable contains the index.

Conclusion for the battery test popup.

- PSU OK, 100%
- Relay OK, but work to be done. But kinda understand whats needed
- Voltmeter, NOK all my definitions need updating. (which is a lot of work)
- Temperature, NOK, work to be done. But kinda understand whats needed

Well I am a little disappointed. I will make some updates soon (for Temperature and Relay), but for my multi meter definitions I will not do this soon since the latter I spend already hours and hours writing and perfecting them.

I wonder what the issue with the DMM definition is and I do not believe updating the temperature is much work (I did it to one of my own designs, it was only two channels, but did add 16 (fake) channels to test the test popup).

If you named some volt columns "VDC" (I have not checked the definitions), I will be willing to add that to the battery test popup, I believe that is a completely valid name.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5936 on: March 13, 2026, 07:56:54 pm »
How do I test 1 single relay

#scpiCmd relayOutput (value)
:readmath: (lastOutput && 2^inputValue)

It does not work.

I want to return a single bit from lastOutput based on a bit position 1 true 8
They say attention is a shovel. It's time to dig 'em out.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5937 on: March 13, 2026, 08:04:52 pm »
I wonder what the issue with the DMM definition is and I do not believe updating the temperature is much work (I did it to one of my own designs, it was only two channels, but did add 16 (fake) channels to test the test popup).

If you named some volt columns "VDC" (I have not checked the definitions), I will be willing to add that to the battery test popup, I believe that is a completely valid name.

All my thermometer definitions I will update, that is clear now.

Then unit from the Yokogawa (and many others) is VDC (many other also use this convention). If it is only the column name than needs to be compatible... but I thought you meant the mode.
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5938 on: March 13, 2026, 08:06:15 pm »
How do I test 1 single relay

#scpiCmd relayOutput (value)
:readmath: (lastOutput && 2^inputValue)

It does not work.

I want to return a single bit from lastOutput based on a bit position 1 true 8

As a programmer I am very used to handle bits and do not always think about that other people is not.
Some useful expression:
1<<bitNo will return a mask with bitNo as 1, note bitNo is zero based.

~ flips all bits in a value.
i.e. mask=mask&~(1<<bitNo) will reset bitNo in mask.
And (obvious for me):
mask=mask|(1<<bitNo) will set bitNo in mask.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5939 on: March 13, 2026, 08:15:26 pm »
Then unit from the Yokogawa (and many others) is VDC (many other also use this convention). If it is only the column name than needs to be compatible... but I thought you meant the mode.

It is the mode name that is shown on the buttons in the mode menu, but I will add VDC to the list.
When I did the programming I was thinking "Volt DC", but VDC is just as good.
That is one reason I wanted it out for testing, I want silly bugs removed before I release a official version.

The only reason I check the mode is to make it possible to use a DMM for both voltage and temperature, I do not want to exclude any meter on silly grounds for this. I.e. if there are other names I need to include, please speak up.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5940 on: March 13, 2026, 08:26:55 pm »
In your SSR relay you have this:

#interface setRelay relay(value?"on":"off") (channel)
#interface getRelay relay? (channel)

So your scpi is "relay on 1"  and "relay off 1" ?

How can I have two parameters in a #scpiCmd ? and how do I split inputValue... do I need getElement ? 

They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5941 on: March 13, 2026, 08:37:23 pm »
In your SSR relay you have this:

#interface setRelay relay(value?"on":"off") (channel)
#interface getRelay relay? (channel)

So your scpi is "relay on 1"  and "relay off 1" ?

How can I have two parameters in a #scpiCmd ? and how do I split inputValue... do I need getElement ?

The actual command to the relay box is:
relayon channel
relayoff channel

relay(value?"on":"off")  simply modify the word to either relayon or relayoff, then channel put the channel number in as a parameter.
I do not remember it exactly now, but I believe multiple parameters may be passed as "1 2 3", i.e. you can split it on spaces (For some stuff it works that way, I do not remember if it is #scpiCmd).

 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5942 on: March 13, 2026, 09:17:52 pm »
My definition for the Matrix APS-7100 is working.   :clap:
For so far i am happy with it, i have to test it some more.

I used #metadef to add al the models.
But there is no way to test for anything but only for a seral number. So I think the #metadefs are useless?.
Last week i tested a definition in ASCII for the APS7100. And when a change the definition to simulate another model it always showed APS7100 for the connected device it found. Or is this change only inside the definition like replace some text?

In this definition with block there is no way to test voor device model identification so i am confused what to do with it.
For me it is working but for other model they have to change manually?
Or do make 8 definition file for the 8 models?

To make 8 definition is not that mutch work it is more changing some text for each definition while only the max current wil change.

IS there a way in #driver Block to ask for a device id nummer? Like where you set Com3 for the adress in load devices? Ore any other idea?
« Last Edit: March 13, 2026, 09:21:46 pm by Benleentje »
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8201
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5943 on: March 13, 2026, 09:21:31 pm »
My definition for the Matrix APS-7100 is working.   :clap:
For so far i am happy with it, i have to test it some more.

I used #metadef to add al the models.
But there is no way to test for anything but only for a seral number. So I think the #metadefs are useless?.
Last week i tested a definition in ASCII for the APS7100. And when a change the definition to simulate another model it always showed APS7100 for the connected device it found. Or is this change only inside the definition like replace some text?

In this definition with block there is no way to test voor device model identification so i am confused what to do with it.
For me it is working but for other model they have to change manually?
Or do make 8 definition file for the 8 models?

To make 8 definition is not that mutch work it is more changing some text for each definition while only the max current wil change

To test metadefs, the device ID response has to match one of the alternate IDs. If it still shows the original, than you're not changing the ID of the device in a meaningful way.
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5944 on: March 13, 2026, 09:24:40 pm »
My device is non SCPI and dont have ?IDN. The only way i can check is with the maxpow? query.
In the metadef the maxpow? match with a string
example

Code: [Select]
;meta definition for Matrix APS-4000A 350VA
#metadef
#idString Matrix, APS-4000A
#name Matrix APS-4000A
#handle APS4000A
; -----  Check instrument model  ------
#verifyDevice "350.00" maxpow?
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5945 on: March 13, 2026, 09:30:25 pm »
Generally you need a bunch of #replaceText #removeLine and #remove to change the boundaries of all #cmdSetup menu items.

You can use preview mode to watch the effect.
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5946 on: March 13, 2026, 09:31:36 pm »
My definition for the Matrix APS-7100 is working.   :clap:
For so far i am happy with it, i have to test it some more.

I used #metadef to add al the models.
But there is no way to test for anything but only for a seral number. So I think the #metadefs are useless?.
Last week i tested a definition in ASCII for the APS7100. And when a change the definition to simulate another model it always showed APS7100 for the connected device it found. Or is this change only inside the definition like replace some text?

In this definition with block there is no way to test voor device model identification so i am confused what to do with it.
For me it is working but for other model they have to change manually?
Or do make 8 definition file for the 8 models?

To make 8 definition is not that mutch work it is more changing some text for each definition while only the max current wil change

Congratulations on your first definition, I look forward to include it when you post it.

You are misunderstanding the #metadef  directives.
Their purpose is to modify the definition to match different devices that are very similar.
To do that you can modify/delete entries in the definition, enable/disable sections of the definition and replace text in the definition.
To test it you can put it a debug order and TC will write the actual definition to disk (You can only do that to one #metadef at a time).

Technically TC handles separate definitions or one definition with #metadef the same: it is all processed as single device definitions (I.e. a file with #metadef is processed multiple times). But the #metadef makes it faster to load and usually easier to maintain.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5947 on: March 13, 2026, 09:36:05 pm »
My device is non SCPI and dont have ?IDN. The only way i can check is with the maxpow? query.
In the metadef the maxpow? match with a string
example

You can not select a device with a maxpow? query, but you can use it in the device check definition to reject the device for not matching the selected type.
I.e. let #verifyDevice check the power and if it do not match, it is not this device. It is not the perfect method, but it is a mostly valid method.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4777
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5948 on: March 13, 2026, 09:38:31 pm »
A example:

Instead of:
#verifyDevice "350.00" maxpow?

You write:

#verifyDevice MaxPower maxpow?

and then in each #metadef put in a line with:

#replaceText MaxPower "350"

or whatever the max power is for that device.
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #5949 on: March 13, 2026, 09:49:08 pm »
I will test that tomorrow for the Ascii driver definition. Thanks

Sorry for the confusion.
I made 2 different definitions one in Ascii and one 1 block.
In ascii the settings are limited, because of the limitations i made a new definition with #driver block.
Now i have al the source of the power supply and can read en reset status and alarm. And it works more native because i can use status information for update other settings.
But there is only a serial nummer what i can read and are not able to test for the different models.

Should a make 8 definition files for each model
« Last Edit: March 13, 2026, 09:51:18 pm by Benleentje »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf