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

0 Members and 634 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6100 on: March 22, 2026, 04:53:55 pm »
The Circutor and matrix has updates,

Updated, thanks.

I wonder if adding a mode setting to disable/enable some measurements would be a good idea. I was thinking like disable/enable all harmonic.

You do it with
#cmdModeCheck
I have used it in GossenMetraHitEnergy definition

 

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 #6101 on: March 22, 2026, 05:11:30 pm »
Is this not possible #scpiCmd writeDigit1 holding 0x00 (int(bytes(value)))

holding 0x00 (int(bytes("A"))) works
 holding 0x00 65
;; DM18C04: Tx <holding 0x00 65>
;; COM10: Tx: 01 06 00 00 00 41 49 FA
;; COM10: Rx: 01 86 02 C3 A1

writeDigit1 A does not work, writeDigit1 "A" gets an Java exception.


« Last Edit: March 22, 2026, 05:15:29 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6102 on: March 22, 2026, 05:47:19 pm »
Is this not possible #scpiCmd writeDigit1 holding 0x00 (int(bytes(value)))

holding 0x00 (int(bytes("A"))) works
 holding 0x00 65
;; DM18C04: Tx <holding 0x00 65>
;; COM10: Tx: 01 06 00 00 00 41 49 FA
;; COM10: Rx: 01 86 02 C3 A1

writeDigit1 A does not work, writeDigit1 "A" gets an Java exception.

That is a issue with TC's parser, try writing: (int(bytes( value ))) i.e. add a few spaces.
The parser for handling () on the command lines are very simple, because I want it to be fast and it can be fooled. More precise the issues is (value) is directly replaced with the contents of value, this is a fast way to handle the most common usage, but it obvious failed in your case.

 

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 #6103 on: March 22, 2026, 06:08:03 pm »
I would never have guessed this, but you know how it works! It is working now, thanx.
« Last Edit: March 22, 2026, 06:12:30 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6104 on: March 22, 2026, 06:11:11 pm »
I would never have guessed this, but you know how it works! It is working now, thanx.

I know it is a nasty way to code, but you are the first one have a issues with it.
I did not remember it, before I tried it and saw the error message with bytesA, then I remembered that I had some shortcuts in the code.
 

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 #6105 on: March 22, 2026, 06:13:38 pm »
Well I have spotted already some little bugs, that you all fixed, before in the past.

I also improved speed on my NT28, NT48 and N4DBA definitions. My NT48A08 is incredible fast now. NT17 was already improved. I will re-release all when I have fully confidence that it works 100%.

Bear in mind, I am not a programmer as profession.
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6106 on: March 22, 2026, 06:21:47 pm »
Well I have spotted already some little bugs, that you all fixed, before in the past.

I was talking about this case, generally I am against doing "smart shortcuts" in code, I want it easy readable (The amount of code do spoil it some, but I can generally easy see what I do in a specific piece of code).


I also improved speed on my NT28, NT48 and N4DBA definitions. My NT48A08 is incredible fast now. NT17 was already improved. I will re-release all when I have fully confidence that it works 100%.

I look forward to get them.

Bear in mind, I am not a programmer as profession.

I have worked both as software developer and as hardware developer, with hardware it has mostly been microprocessor based hardware. Once upon a time I did write code in assembler for microprocessors.
 

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 #6107 on: March 22, 2026, 06:37:44 pm »
I was referring to the "first one have a issues", I did not interpret it as a bug.

It gets easier to write definitions an I have used SCPI, SCPIx, ascii and modbus so I learn a little every time.
They say attention is a shovel. It's time to dig 'em out.
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #6108 on: March 22, 2026, 07:01:05 pm »
The Circutor and matrix has updates,

Updated, thanks.

I wonder if adding a mode setting to disable/enable some measurements would be a good idea. I was thinking like disable/enable all harmonic.

You do it with
#cmdModeCheck
I have used it in GossenMetraHitEnergy definition
I will look into that.


 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6109 on: March 22, 2026, 08:40:35 pm »
It gets easier to write definitions an I have used SCPI, SCPIx, ascii and modbus so I learn a little every time.

That basically means you are only missing Block to have learned all the main drivers in TC.
AsciiBin and AsciiBlock are not used very often and I do not see them as main drivers.
SingleValue is a very simple driver for devices that stream a single value.
Binary DMM protocol is a special purpose protocol for handhelds DMM's, it mains feature is 7 segment decoding and handling the typical multitude of flags in the kind of protocol.
 

Offline neo2000

  • Newbie
  • Posts: 8
  • Country: de
Re: Program that can log from many multimeters.
« Reply #6110 on: March 23, 2026, 08:13:17 am »
Hi, any config file here for ET5420A+?

There is a definition for ET5420A and it can probably easy be adapted for ET5420A+

Hi everyone, does someone have the definition file ready for use? I used ET5410A+ and it works for my ET5420+ but only for one channel. I tried to modify the file to match the two channel version, but I'm not into SCPI commands and structures to solve my problem. Any help appreciated.

Thank you
 

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 #6111 on: March 23, 2026, 06:17:06 pm »
Can I also output a string for an #interface ?

My scpiCmd returns a string, however the function defined after #interface tries to convert it into a number leading to NaN. I tries :string: and string( ) but no success.

I know getMode can contain a string however that is auto-generated.


O... and  my scpiCmd is a #pgm# (but that should not matter, right ?)
« Last Edit: March 23, 2026, 07:52:48 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6112 on: March 23, 2026, 07:16:04 pm »
Can I also output a string for an #interface ?

My scpiCmd returns a string, however the function defined after #interface tries to convert it into a number leading to NaN. I tries :string: and string( ) but no success.

I know getMode can contain a string however that is auto-generated.

As far as I remember TC has a list of #interface that returns strings (I have not checked).
 

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 #6113 on: March 23, 2026, 07:30:33 pm »
Output from my scpiCmd ...
;; DM18C04: Rx <UUUÀ>
;; UUUÀ

Output from Get from the #interface get...
;; DM18C04: Rx <UUUÀ>
;; DM18C04: Rx as number <NaN>

O... and  my scpiCmd is a #pgm# ending with print(outputString)                (but that should not matter, right ?)

« Last Edit: March 23, 2026, 07:55:56 pm by flash2b »
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 #6114 on: March 24, 2026, 09:18:35 am »
Another question.

Reference: https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Modbus_serial_&_network

I now know that I can read multiple registers with holding? address {{words} *factor or /factor or &mask} where {words} is the number of registers (this was not clear for me)

But now I want to write multiple registers... I need to do it with Modbus function code 16 (dec) which is 10 (hex)

Documentation states: holding address value {moreValues...} {*factor or /factor }

What is {moreValues...} ?

I want to write 2 values to register 0x06 [format] and 0x07 [data]

Option 1 use holding
#scpiCmd displayFormatData holding 0x06 2 (value value2) ... it this right ? (value and value2 are 16bit integers)
How do I call the new scpiCmd, is it :write: displayFormatData x y ? With x = 255 and y = 7, do I need to typecast these to int( ) before ?

Option 2 use holdingL
#scpiCmd displayFormatData holdingL 0x06 (value3) and shift the original value 16 to the left adding value2 before ?
:write: displayFormatData (x<<16)+y ?  With x = 255 and y = 7, do I need to typecast these to int( ) before ?
« Last Edit: March 24, 2026, 03:23:17 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6115 on: March 24, 2026, 01:20:44 pm »
Can I also output a string for an #interface ?

My scpiCmd returns a string, however the function defined after #interface tries to convert it into a number leading to NaN. I tries :string: and string( ) but no success.

I know getMode can contain a string however that is auto-generated.


O... and  my scpiCmd is a #pgm# (but that should not matter, right ?)

Looking in the code:
The names: "Mode", "Waveform", "Coupling", "MathDefinition" are valid for string, but it is only verified on the test page, not in usage.
I also have a list of standard names, they uses a different background color on the test page.

If you have names to add to the list, just say it and I will consider it.

In usage any #interface is supposed to work with string or number, but the actual usage may request a specific type.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6116 on: March 24, 2026, 01:30:52 pm »
Option 1 use holding
#scpiCmd displayFormatData holding 0x07 2 (value value2) ... it this right ? (value and value2 are 16bit integers)

Yes, and you can list many values as you wish (within limits). They do not have to be int and you can add scaling in the command.

How do I call the new scpiCmd, is it :write: displayFormatData x y ? With x = 255 and y = 7, do I need to typecast these to int( ) before ?

A single value contains all arguments from the line. If you wanted to access the individual values it would require a bit of coding with the split() function.
 

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 #6117 on: March 24, 2026, 01:45:52 pm »
1st Answer
I will let you know what I need then. I can use the read... instead to get the string value out, i guess ?
Can the parameter of a set.... also be a string ? (so a string that is inputted to a device, my device needs both input and output)

When I want to do the full programming language, making a script, I do need to use the #interface command to 'talk' to the device right ?

2nd Answer
Both methods do use multiple register read on the the Modbus level, so both holding 0x06 2 (255 7) as well as holdingL 0x06 ((255<<16)+7), right ?

In my case registers 0x07 and 0x08 need to be written using function code 10 (hex)

Can I do a split in a scpiCmd between de ( ) of after the holding command? I thought it was not allowed.

I will try some approaches and report back if I fail again...  ;D
« Last Edit: March 24, 2026, 03:23:47 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6118 on: March 24, 2026, 02:00:33 pm »
1st Answer
I will let you know what I need then. I can use the read... instead to get the string value out, i guess ?
Can the parameter of a set.... also be a string ? (so its a string that is inputted to a device)

When I want to do the full programming language, making a script, I do need to use the #interface command to 'talk' to the device right ?

Of course a set can be a string, setMode("VAC")!
And yes the #interface is for the programming language.


2nd Answer
Both methods do use multiple register read on the the Modbus level, so both holding 0x07 2 (255 7) as well as holdingL 0x07 ((255<<16)+7), right ?

In my case registers 0x07 and 0x08 need to be written using function code 10 (hex)

Can I do a split in a scpiCmd between de ( ) of after the holding command? I thought it was not allowed.

I will try some approaches and report back if I fail again...  ;D
Do not use () around the parameters, except if you want TC to do the programming mode to process them!

The split function do not care about () or anything else, TC has a parser that do and it used for command lines.
 

Offline Benleentje

  • Contributor
  • Posts: 34
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #6119 on: March 24, 2026, 05:47:55 pm »
How do is send a _ underscore in the message.
It is filtered out.
I tried also things like \0x5F en /0x5F

The actual command i need to send is like TRIG:SOUR_EXT
#cmdSetup radio Trigger
:read: TRIG:SOUR?
:write: TRIG:SOUR_(value)
:tip: Setup this voltage, turn output on
Local MAN
External EXT
Bus_command BUS


from the manual
TRIG:SOUR_<sour>
« Last Edit: March 24, 2026, 05:50:44 pm by Benleentje »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #6120 on: March 24, 2026, 05:49:43 pm »
How do is sens a _ underscore in the message.
It is filtered out.
I tried als things like \0x5F en / 0x5F

The actual command i need to send is like TRIG:SOUR_EXT
#cmdSetup radio Trigger
:read: TRIG:SOUR?
:write: TRIG:SOUR_(value)
:tip: Setup this voltage, turn output on
Local MAN
External EXT
Bus_command BUS

The _ is converted to a space, because in many situation you cannot do a space.
To add a _ use \_
 

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 #6121 on: March 25, 2026, 09:21:50 am »
Do not use () around the parameters, except if you want TC to do the programming mode to process them!

The split function do not care about () or anything else, TC has a parser that do and it used for command lines.

holding 0x06 255 7 produces:

;; $10IOA04: Tx <holding 0x06 255 7>
;; COM3: Tx: 01 10 00 06 00 02 04 00 FF 00 07 02 77
;; COM3: Rx: 01 90 02 CD C1


holdingL 0x06 ( (255<<16)+7) produces:

holdingL 0x06 16711687
;; $10IOA04: Tx <holdingL 0x06 16711687>
;; COM3: Tx: 01 10 00 06 00 02 04 00 FF 00 07 02 77
;; COM3: Rx: 01 90 02 CD C1

Its the same, YES, i can code now further. Thank you !
« Last Edit: March 25, 2026, 09:40:33 am by flash2b »
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 #6122 on: March 25, 2026, 04:10:54 pm »
void
« Last Edit: March 25, 2026, 04:24:18 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline pivous

  • Contributor
  • Posts: 10
  • Country: cz
GW INSTEK,GPD-3303S - improoved definition file
« Reply #6123 on: March 25, 2026, 04:36:04 pm »
I would like share my a little bit improved definition file for GW INSTEK,GPD-3303S. What is new:
; The status lights (indicatornum) are working correctly now
; Added missing Memory recal/save functionality
; Corrected User manual fail of output ON/OFF status. It is located in bit 5 not in bit 6
; as described.
 

Offline pivous

  • Contributor
  • Posts: 10
  • Country: cz
Re: GW INSTEK,GPD-3303S - improoved definition file
« Reply #6124 on: March 26, 2026, 08:19:31 am »
I would like share my a little bit improved definition file for GW INSTEK,GPD-3303S. What is new:
; The status lights (indicatornum) are working correctly now
; Added missing Memory recal/save functionality
; Corrected User manual fail of output ON/OFF status. It is located in bit 5 not in bit 6
; as described.

Small change because of GW INSTEK,GPD-3303S strange implementation of status? command answer logic.
« Last Edit: March 26, 2026, 08:25:21 am by pivous »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf