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

Hawaka, homico and 39 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4775 on: October 01, 2025, 04:19:53 pm »
It's not a bad idea, but probably not worth the time it would take to update it. It's already very fast, and there's a little more to each of the commands. Maybe if I want to procrastinate something else I'll spend the time. ;)

It is up to you, here is a bit more info:

You need a #scpiCmd to define the functions before you can use them, then you can use them as any other function:

You use addFunc(name,program) to add then function, you can also use addFuncGlobal(name,program) while testing, because then you can call the function from the command line.

addFunc("functionName","""  <- that is 3 double quotes in a row, anything (including extra spaces and line changes) until the next """ is put into a string.

code for function

""")

Params can be acces from the array  params[index], usually it is nice to move them to local variables:
var xyz= params[0];

Return value can be generated two ways:
Either by using print(), all print will be combined.
Or by having something that returns a value as the last statement, it can be a variable.

The function will have its own variables, that no other code can see, but do also have access (read and write) to all variables from the calling code (Except if it defines its own var with the same name). It works the same way as globalvar, except a extra layer is added between globalvar and local vars with the calling functions var.


 
The following users thanked this post: KungFuJosh

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log/control many multimeters and other devices.
« Reply #4776 on: October 02, 2025, 05:48:28 am »
Hi HKJ,

I have attached a definition file for the Giant Force GTH series thermal chambers.

 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4777 on: October 02, 2025, 08:08:32 am »
V2.77 is up
There is a significant number of additions to TC (Much of it with ideas from KungFuJosh) and a couple of new devices.
   Added: Giant Force GTH-xxx-00-CP (Model 00, 20, 40, 60, 70) Thermal chamber (Thanks jmurray@jmaudio.com.au)
   Added: text field to the multi control.
   Added: #modeFromVar for definitions that uses #scpiCmd and variables to handle some modes.
   Added: A "Log sync" option to paramSweeper, that will synchronize logging to stepping.
   Fixed: #clearTable brought TC into a undefined state if used when logging, now it will stop logging before clearing the table
   Added: Updated the B&K Precision 9115, 9116 and 9117 (Thanks jmurray)
   Added: :noGrid: tag for alternate layout, supported by: checkBox, ToggleButton, radio, buttons, buttonsOn
   Added: Control ToggleButton, a button with up to six commands and it can be grouped.
   Added: Rek RK8510 electronic load (Thanks dfgregr)
   Added: Siglent SDG1022X Plus, Siglent SDG1032X Plus, Siglent SDG1062X Plus Arb (Thanks Gertjan)
   Update: jSerialComm updated to V2.11.2, due to bug in last version

jSerialComm prevented TC from reconnecting devices in some cases.

:noGrid: is a alternate layout for the setup popups that makes everything in a line have equal width, it looks nice for some stuff.



Togglebutton is a new button control that can be grouped, each button can have up to six states/commands associated with it. A two state toggleButton is basically the same as a checkbox.

ParamSweeper LogSync makes it possible to log in clearly defined steps matching the param stepping, instead of a independently.
 
The following users thanked this post: tautech, KungFuJosh

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4778 on: October 02, 2025, 08:11:06 am »
I have attached a definition file for the Giant Force GTH series thermal chambers.

It is included in the above update (Thanks).
 

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log/control many multimeters and other devices.
« Reply #4779 on: October 02, 2025, 08:19:58 am »
This is probably yet another strange question - is there any way we can define our own virtual device in a definition? Purely as something that can execute some scripts as needed.
I have an idea I'm hoping to try with embedding things into a device definition file, but not necessarily with the device connected/identified.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4780 on: October 02, 2025, 08:52:26 am »
This is probably yet another strange question - is there any way we can define our own virtual device in a definition? Purely as something that can execute some scripts as needed.
I have an idea I'm hoping to try with embedding things into a device definition file, but not necessarily with the device connected/identified.

No, but there are a ways to work without the actual device:

You can use another device to answer the *idn? request and simply leave out the :read: and :write: tags on commands.

Or you can try to use one of my virtual devices, they have internal code for the data, but the setup menu are in the definition file.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4781 on: October 02, 2025, 02:25:08 pm »
This is probably yet another strange question - is there any way we can define our own virtual device in a definition? Purely as something that can execute some scripts as needed.
I have an idea I'm hoping to try with embedding things into a device definition file, but not necessarily with the device connected/identified.

I sort of like you idea and has started on it, for now I have a dummy com driver.
I.e. specify:
port Dummy
And you get the device. The address field is ignored, it can be empty or you can anything you like in it.

For now it is an SCPI/SCPIx/ascii device that knows the following commands:
*idn?   answer is Dummy,Dummy,0,0
test?  answer is output from seconds() function
test   No answer and anything you put after it will be ignored
Any other command will also be ignored, but later on there will be a difference between defined and undefined commands.


I am sort of planning on a popup where you can define commands and answers, but I have not started on that part yet.

http://lygte-info.dk/pic/Projects/TestController/TestController.jar
« Last Edit: October 02, 2025, 02:26:48 pm by HKJ »
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #4782 on: October 02, 2025, 02:48:16 pm »
How can I send an ESC character (ASCII:27 or hex:1b) to a device with txrx?

I can use txbin \x1b but that does not work for getDeviceSN? and getDeviceSW? since those only accept txrx?

So: #scpiCmd getDeviceSN? txbin \x1b txrx? S does not work.

Code: [Select]
;; YOKO7562: Tx <txbin \x1b txrx? S
;; COM5: TxBin: <. txrx? S> 1B 20 74 78 72 78 3F 20 53
« Last Edit: October 02, 2025, 03:04:16 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4783 on: October 02, 2025, 02:55:23 pm »
How can I send an ESC character (ASCII:27 or hex:1b) to a device with txrx?

I can use txbin \x1b but that does not work for getDeviceSN? and getDeviceSW? since those only accept txrx?

So: #scpiCmd getDeviceSN? txbin \x1b txrx? S does not work.

Code: [Select]
;; YOKO7562: Tx <txbin \x1b txrx? S
;; COM5: TxBin: <. txrx? S> 1B 20 74 78 72 78 3F 20 53

Try ("\x1b") I do not remember if it works there, but it works in a lot of places.
You cannot just put two commands on a line and if TC knows there are two commands they will be send separately.

 
The following users thanked this post: flash2b

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #4784 on: October 02, 2025, 03:03:56 pm »
That does not work.

Those two commands are executed before TC assigns a handle to it. It take literally the characters and sent it to the COM port.

;; : Tx <txrx? "\x1b"S
;; COM5: Tx: <"\x1b"S.> 22 5C 78 31 62 22 53 0A
;; COM5: Rx: timeout

How do I get ASCII=27 transmitted?

I got it working !!

#scpiCmd getDeviceSN? txbin \x1b
txrx? S

That worked.... ! :-+
« Last Edit: October 02, 2025, 03:16:58 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4785 on: October 02, 2025, 03:26:12 pm »
I got it working !!

#scpiCmd getDeviceSN? txbin \x1b
txrx? S

That worked.... ! :-+

Nice.
 

Offline internauta2000

  • Newbie
  • Posts: 1
  • Country: ve
Re: Program that can log/control many multimeters and other devices.
« Reply #4786 on: October 03, 2025, 04:30:28 am »
Greetings to the developer of this excellent app. Their work is truly appreciated.

After having some fun familiarizing myself with it, I thought I'd make some aesthetic suggestions. But first, I want to clarify that I haven't read the entire 192 pages of the Tread, so I don't know if they were made by others at some point. So, let's get to the point...

1. Currently, almost all apps offer light and night modes, so it would be great to have that feature, and without asking too much, the option to create custom styles for the interface is especially appreciated when we spend a lot of time in front of a screen... My eyes get tired quickly, they are already 61 years old.  :palm:
2. After configuring all the parameters to my liking and needs, after closing and reopening the app, I noticed that several minor settings were lost. But the one that mattered most to me was the colors (layout) for the CHART and HISTOGRAM windows. They don't save the set preferences, as is the case with "settingsReadouts," something that logically should be done... Please correct me if I missed any steps to save the settings.  :-//
3- Finally, and in my opinion most important, is the impossibility of changing the language, or at least of creating an editable text file that allows you to translate the interface content. Trying to do so would mean unzipping the .jar, etc., and losing all your work when a future update is released, I have employees who don't even speak their own language well :-DD ...  Besides seeming unethical to me.

I'm really pleased with this, and the least I can do is express my gratitude with some ideas. I hope the developer will consider its feasibility at some point to further improve this excellent initiative.  :-+
« Last Edit: October 03, 2025, 04:55:55 am by internauta2000 »
 

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log/control many multimeters and other devices.
« Reply #4787 on: October 03, 2025, 06:29:43 am »
This is probably yet another strange question - is there any way we can define our own virtual device in a definition? Purely as something that can execute some scripts as needed.
I have an idea I'm hoping to try with embedding things into a device definition file, but not necessarily with the device connected/identified.

I sort of like you idea and has started on it, for now I have a dummy com driver.
I.e. specify:
port Dummy
And you get the device. The address field is ignored, it can be empty or you can anything you like in it.

For now it is an SCPI/SCPIx/ascii device that knows the following commands:
*idn?   answer is Dummy,Dummy,0,0
test?  answer is output from seconds() function
test   No answer and anything you put after it will be ignored
Any other command will also be ignored, but later on there will be a difference between defined and undefined commands.


I am sort of planning on a popup where you can define commands and answers, but I have not started on that part yet.

http://lygte-info.dk/pic/Projects/TestController/TestController.jar

I started playing with my idea a bit by just using a #metadef that changed the SCPIx driver to Block driver, but realised I probably can't do what I was hoping to.
As far as I can tell, it's not possible to have #metadef in the main definition file and a separate file with additional metadefinitions that refer to the original definition by name - please correct me if I'm wrong.

Also, I realise the limits in the #cmdSetup number are likely treated purely as text tags, but it would be pretty neat to be able to specify an expression instead of a constant/hard-coded text.

« Last Edit: October 03, 2025, 06:31:25 am by jmurray »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4788 on: October 03, 2025, 06:53:51 am »
1. Currently, almost all apps offer light and night modes, so it would be great to have that feature, and without asking too much, the option to create custom styles for the interface is especially appreciated when we spend a lot of time in front of a screen... My eyes get tired quickly, they are already 61 years old.  :palm:

I do not really like to use time on this.

2. After configuring all the parameters to my liking and needs, after closing and reopening the app, I noticed that several minor settings were lost. But the one that mattered most to me was the colors (layout) for the CHART and HISTOGRAM windows. They don't save the set preferences, as is the case with "settingsReadouts," something that logically should be done... Please correct me if I missed any steps to save the settings.  :-//

The default save is limited, this is to secure that TC always is ready to use when started. You cannot really save a setting that would prevent it from working.

But there is another (manual) save, that saves a lot more stuff. Right click in the log window and select "Generate scripts, Layout, Save as menu", you can then save a configuration as a selection for the same right click menu.


3- Finally, and in my opinion most important, is the impossibility of changing the language, or at least of creating an editable text file that allows you to translate the interface content. Trying to do so would mean unzipping the .jar, etc., and losing all your work when a future update is released, I have employees who don't even speak their own language well :-DD ...  Besides seeming unethical to me.

It would be nice, but it way to much work for me.
 
The following users thanked this post: internauta2000

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4789 on: October 03, 2025, 07:00:31 am »
I started playing with my idea a bit by just using a #metadef that changed the SCPIx driver to Block driver, but realised I probably can't do what I was hoping to.
As far as I can tell, it's not possible to have #metadef in the main definition file and a separate file with additional metadefinitions that refer to the original definition by name - please correct me if I'm wrong.

A metadef can refer to another file or rather another device, but I prefer when placing meta and metadef in the same file.

Also, I realise the limits in the #cmdSetup number are likely treated purely as text tags, but it would be pretty neat to be able to specify an expression instead of a constant/hard-coded text.

There are a couple of issues with make them dynamic.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5959
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4790 on: October 03, 2025, 06:46:37 pm »
ETA: Issue resolved (for now) see next reply.

When I tried to run TC in debug mode I get this:
Code: [Select]
Starting
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by com.fazecast.jSerialComm.SerialPort in an unnamed module (file:/C:/Users/USERNAME/Desktop/Bench%20Meters/TestController/TestController.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

java.io.FileNotFoundException: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\.jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\.jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\.jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
java.io.FileNotFoundException: C:\Users\USERNAME\.jSerialComm\2.11.2\jSerialComm.dll (Access is denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:255)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:210)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:244)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
Exception in thread "Scan ports" java.lang.UnsatisfiedLinkError: Cannot load native library. Errors as follows:
[1]: no jSerialComm in java.library.path: C:\Program Files\Java\jdk-25\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;;.
[2]: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll: Can't load ARM 64-bit .dll on a AMD 64-bit platform
[3]: C:\Users\USERNAME\.jSerialComm\2.11.2\jSerialComm.dll: Can't load ARM 64-bit .dll on a AMD 64-bit platform

        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:273)
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)


Clicking Reconnect Devices causes the following:

Code: [Select]
Exception in thread "Scan ports" java.lang.NoClassDefFoundError: Could not initialize class com.fazecast.jSerialComm.SerialPort
        at dk.hkj.comm.SerialInterface.getSerialPorts(SerialInterface.java:295)
        at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: Cannot load native library. Errors as follows:
[1]: no jSerialComm in java.library.path: C:\Program Files\Java\jdk-25\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;;.
[2]: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll: Can't load ARM 64-bit .dll on a AMD 64-bit platform
[3]: C:\Users\USERNAME\.jSerialComm\2.11.2\jSerialComm.dll: Can't load ARM 64-bit .dll on a AMD 64-bit platform
 [in thread "Scan ports"]
        at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:273)
        ... 2 more

I checked and the file is present here: C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\2.11.2\jSerialComm.dll

I didn't see any restrictions on it.

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

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5959
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4791 on: October 03, 2025, 11:01:36 pm »
Apparently, I had two issues (or, TC does).

First:
I previously had an older version of the SDK before the "WARNING: A restricted method in java.lang.System has been called" started showing up. Apparently, that's a feature of JDK 24+, and TC may need to work around that in future releases.

In the meantime, the workaround for now is to change the line in the debug (or the batch file for non debug):
Code: [Select]
java --enable-native-access=ALL-UNNAMED -jar TestController.jar debug %1 %2 %3 %4 %5 %6 %7 %8 %9
The --enable-native-access=ALL-UNNAMED allows it to work, but it's not ideal.


Second:
I guess the error told the truth. TC was loading the ARM 64 bit DLL when I needed the AMD 64bit version. I downloaded jSerialComm-2.11.2.jar, extracted the AMD 64bit DLL, and overwrote the ARM versions and I'm back in business.

ETA: the file occurs in both of these places:
C:\Users\USERNAME\AppData\Local\Temp\jSerialComm\
C:\Users\USERNAME\.jSerialComm\

Thanks,
Josh
« Last Edit: October 04, 2025, 03:04:37 am by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5959
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4792 on: October 04, 2025, 02:22:55 am »
So, I figured out your fancy command, and trimmed down another 21KB. Nice.

I made the function with a scpiCmd, and it works for all 8 channels:
Code: [Select]
#scpiCmd EnablegetMeasUnit #pgm#
addFuncGlobal("getMeasUnit","""
  var measNum=params[0];
  var type=params[1];
  var channel=params[2];
  var unitCommand=channel + ":UNIT?";
  var unitResult=deviceRead(handle, unitCommand);
  var measUnit;
blah blah blah

One problem though. I tried executing EnablegetMeasUnit in the #initCmd, and it appears to run in the log...but it doesn't actually define the command (unknown function error). However, manually running EnablegetMeasUnit in the Commands tab input does work, and then everything functions as it should.

Here's the startup log with the initCmds:
Code: [Select]
;; IP: Tx <MeasDefault>
;; IP: Tx <none>
;; IP: Tx <EnablegetMeasUnit>
;; IP: Script start
;; IP: Script end <>
;; Found Batronix Magnova on IP sn: ####
;; Magnova: Tx <getallModes?>
;; Magnova: Tx <none?>
;; Magnova: Rx <HFReq1,None,None,None,None,None,None,None>
processModeString input: HFReq1,None,None,None,None,None,None,None

Here's the error when trying to change modes:
Code: [Select]
;; Magnova: Tx <MeasType1 VNAPArea>
;; Magnova: Script start
dk.hkj.script.ProgramExceptions$UnknownException: Function not found getMeasUnit
var type=value;
var meas1Type=value;
var meas1Unit=getMeasUnit(1, meas1Type, meas1Chan);____<----____
var allModes=meas1Unit+","+meas2Unit+","+meas3Unit+","+meas4Unit+","+meas5Unit+","+meas6Unit+","+meas7Unit+","+meas8Uni
        at dk.hkj.script.Script.getFunc(Script.java:97)
        at dk.hkj.script.Script.parseValue(Script.java:272)
        at dk.hkj.script.Script.parseBitOp(Script.java:320)
        at dk.hkj.script.Script.parseProduct(Script.java:392)
        at dk.hkj.script.Script.parseSum(Script.java:474)
        at dk.hkj.script.Script.parseCompare(Script.java:529)
        at dk.hkj.script.Script.parseLogical(Script.java:565)
        at dk.hkj.script.Script.parseQuestionMark(Script.java:591)
        at dk.hkj.script.Script.parseExpression(Script.java:616)
        at dk.hkj.script.Script.statementVar(Script.java:941)
        at dk.hkj.script.Script.statement(Script.java:1065)
        at dk.hkj.script.Script.doExecute(Script.java:1254)
        at dk.hkj.script.Script.execute(Script.java:1276)
        at dk.hkj.script.Script.execute(Script.java:1282)
        at dk.hkj.devices.DeviceSCPIx$TranslatingCommInterface.write(DeviceSCPIx.java:145)
        at dk.hkj.main.SCPICommand.writeReadInternal(SCPICommand.java:381)
        at dk.hkj.main.SCPICommand.writeRead(SCPICommand.java:430)
        at dk.hkj.main.SCPICommand.write(SCPICommand.java:478)
        at dk.hkj.devices.SetupFormats$ComboboxHotField.actionPerformed(SetupFormats.java:4112)
        at java.desktop/javax.swing.JComboBox.fireActionEvent(JComboBox.java:1294)
        at java.desktop/javax.swing.JComboBox.setSelectedItem(JComboBox.java:619)
        at java.desktop/javax.swing.JComboBox.setSelectedIndex(JComboBox.java:654)
        at java.desktop/javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:946)
        at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:300)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6576)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3404)
        at java.desktop/javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:551)
        at java.desktop/java.awt.Component.processEvent(Component.java:6341)
        at java.desktop/java.awt.Container.processEvent(Container.java:2260)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4958)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4790)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4917)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4560)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4501)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2304)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2671)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4790)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:725)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:702)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


I send it manually (and it still looks the same):
Code: [Select]
EnablegetMeasUnit
;; Magnova: Tx <EnablegetMeasUnit>
;; Magnova: Script start
;; Magnova: Script end <>

Then it works fine:
Code: [Select]
;; Magnova: Tx <MeasType1 HLDuty>
;; Magnova: Script start
;; Magnova: Tx <CHAN1:UNIT?>
;; 192.168.0.40: Tx: <CHAN1:UNIT?.> 43 48 41 4E 31 3A 55 4E 49 54 3F 0A
;; 192.168.0.40: Rx: <V> 56 0A
;; Magnova: Rx <V>
;; Magnova: Script end <>
;; Magnova: Tx <getMeasType1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <HLDuty>
;; Magnova: Tx <:MEAS:STAT?>
;; 192.168.0.40: Tx: <:MEAS:STAT?.> 3A 4D 45 41 53 3A 53 54 41 54 3F 0A
;; 192.168.0.40: Rx: <ON> 4F 4E 0A
;; Magnova: Rx <ON>
;; Magnova: Tx <DynamicM1?>
;; Magnova: Script start
;; Magnova: Tx <:MEAS:HLDuty:CURR? CHAN1>
;; 192.168.0.40: Tx: <:MEAS:HLDuty:CURR? CHAN1.> 3A 4D 45 41 53 3A 48 4C 44 75 74 79 3A 43 55 52 52 3F 20 43 48 41 4E 31 0A
;; 192.168.0.40: Rx: <0.501702610403> 30 2E 35 30 31 37 30 32 36 31 30 34 30 33 0A
;; Magnova: Rx <0.501702610403>
;; Magnova: Script end <0.501702610403>
;; Magnova: Rx <0.501702610403>
;; Magnova: Rx as numbers <0.501702610403>
processModeString input: HLDuty1,None,None,None,None,None,None,None


Does the #cmdSetup dialog need to be open before the func is defined? If so, how can I do that? If not that, what do you think is going on there?

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

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #4793 on: October 04, 2025, 07:35:52 am »
What are these new messages in the debug mode of TC v2.77?

Code: [Select]
processModeString input: 1
processModeString output: 1
They say attention is a shovel. It's time to dig 'em out.
 

Offline dems

  • Contributor
  • Posts: 16
  • Country: fr
Re: Program that can log/control many multimeters and other devices.
« Reply #4794 on: October 04, 2025, 09:42:42 pm »
According to the huge number of devices supported by your application, I would have a question.
Is there a standard for the communication protocol? Or are these proprietary protocols? Regardless of the physical layer.
« Last Edit: October 04, 2025, 09:45:36 pm by dems »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4795 on: October 05, 2025, 08:15:25 am »
First:
I previously had an older version of the SDK before the "WARNING: A restricted method in java.lang.System has been called" started showing up. Apparently, that's a feature of JDK 24+, and TC may need to work around that in future releases.

In the meantime, the workaround for now is to change the line in the debug (or the batch file for non debug):
Code: [Select]
java --enable-native-access=ALL-UNNAMED -jar TestController.jar debug %1 %2 %3 %4 %5 %6 %7 %8 %9
The --enable-native-access=ALL-UNNAMED allows it to work, but it's not ideal.

It may be part of increased java security and I will have to include that option.


I guess the error told the truth. TC was loading the ARM 64 bit DLL when I needed the AMD 64bit version. I downloaded jSerialComm-2.11.2.jar, extracted the AMD 64bit DLL, and overwrote the ARM versions and I'm back in business.

jSerialComm includes native code for lot of processor and OS combination, that is the way it handles serial ports without you have to do any installing.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4796 on: October 05, 2025, 08:25:57 am »
Does the #cmdSetup dialog need to be open before the func is defined? If so, how can I do that? If not that, what do you think is going on there?

I have not gone through your stuff yet, but the function definition is stored in the parser that is associated with scpiCmd and global is always valid.
One issue: Never call another #pgm# scpiCmd from one, they use the same instance of the parser, i.e. it will give some serious issues.
Functions create their own temporary instance of the parser and do not affect anything else.
« Last Edit: October 05, 2025, 08:38:18 am by HKJ »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4797 on: October 05, 2025, 08:26:32 am »
What are these new messages in the debug mode of TC v2.77?

Code: [Select]
processModeString input: 1
processModeString output: 1

Look like some temporary debugging I forgot to remove.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3909
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4798 on: October 05, 2025, 08:30:19 am »
According to the huge number of devices supported by your application, I would have a question.
Is there a standard for the communication protocol? Or are these proprietary protocols? Regardless of the physical layer.

There is two "standards": scpi and modbus, but they only defines the lowest level. All devices has their own commands and not all use the "standards".
TC handles it by having a couple of protocols build in and some of the protocols can be adapter with parameters,
Each device has its own definition file in plain ascii that list what protocol to use and has definition for adjustments to the protocol and commands to communicate with the device.
 

Offline Kurt_!

  • Regular Contributor
  • *
  • Posts: 208
  • Country: at
Re: Program that can log/control many multimeters and other devices.
« Reply #4799 on: October 05, 2025, 11:37:11 am »
I have the Fa-3/6G frequency counter.
Is there a way to use the software?
I haven't gotten it to work yet!
Could someone help me?
...or is it not possible?

The timelapse is running well, but test controller would also be interesting....


Oh...my English...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf