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

Tjuurko, homico and 14 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3875 on: February 28, 2025, 09:00:13 pm »
Are you sure about that? I ask because these are the contents of `tcrun` and `tcrundebug`:

Ok, that is a error in tcrundebug, it is supposed to read:

Code: [Select]
nohup java -jar TestController.jar debug >tc.log 2>&1 &

and will in future releases.
 
The following users thanked this post: dmenezes

Offline dmenezes

  • Contributor
  • Posts: 15
  • Country: cl
Re: Program that can log from many multimeters.
« Reply #3876 on: February 28, 2025, 09:07:59 pm »
Are you sure about that? I ask because these are the contents of `tcrun` and `tcrundebug`:

Ok, that is a error in tcrundebug, it is supposed to read:

Code: [Select]
nohup java -jar TestController.jar debug >tc.log 2>&1 &

and will in future releases.


Thank you for the confirmation, @HKJ. I was starting to think I was going blind or dumb or both :-)

Seriously, I now understand that, instead of running either `tcrun` or `tcrundebug`, what I should do is to run `java -jar TestController.jar`directly on a terminal and capture its output, correct?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3877 on: February 28, 2025, 09:19:32 pm »
Seriously, I now understand that, instead of running either `tcrun` or `tcrundebug`, what I should do is to run `java -jar TestController.jar`directly on a terminal and capture its output, correct?

That will work. Generally there is no output to console, this only happens when something goes wrong.
TC generally tries to catch any errors internally and then continue, only sign of this happening is a couple of lines to the console.
You can easily force output to the console, type:
=4/0
In the command window. It will give you a short error message in the log window and a long and very detailed (but not very useful) error message on the console output.
 
The following users thanked this post: dmenezes

Offline dmenezes

  • Contributor
  • Posts: 15
  • Country: cl
Re: Program that can log from many multimeters.
« Reply #3878 on: March 01, 2025, 05:15:38 am »
Seriously, I now understand that, instead of running either `tcrun` or `tcrundebug`, what I should do is to run `java -jar TestController.jar`directly on a terminal and capture its output, correct?

That will work. Generally there is no output to console, this only happens when something goes wrong.
TC generally tries to catch any errors internally and then continue, only sign of this happening is a couple of lines to the console.
You can easily force output to the console, type:
=4/0
In the command window. It will give you a short error message in the log window and a long and very detailed (but not very useful) error message on the console output.

Perfect. Running TC from now on as advised, and just did the test you indicated:

  • Here's what showed up on the command window:
Code: [Select]
=4/0
;; Error: / by zero
4/0____<----____

  • And on the terminal where I started TC on:
Code: [Select]
$ java -jar TestController.jar
Starting
java.lang.ArithmeticException: / by zero
        at dk.hkj.script.Script.parseProduct(Script.java:442)
        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.statement(Script.java:1103)
        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.main.CommandProcessor.processCommandLineStatement(CommandProcessor.java:2762)
        at dk.hkj.main.CommandProcessor.processCommands(CommandProcessor.java:3041)   
        at dk.hkj.main.PaneCommand.processCommand(PaneCommand.java:1595)
        at dk.hkj.main.PaneCommand.access$19(PaneCommand.java:1593)
        at dk.hkj.main.PaneCommand$32.keyTyped(PaneCommand.java:918)
        at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:
248)
        at java.desktop/java.awt.Component.processKeyEvent(Component.java:6581)
        at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2896)
        at java.desktop/java.awt.Component.processEvent(Component.java:6403)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
        at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4882)        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
        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)
dk.hkj.script.ProgramExceptions$UnknownException: / by zero
4/0____<----____
        at dk.hkj.script.Script.doExecute(Script.java:1270)
        at dk.hkj.script.Script.execute(Script.java:1276)
        at dk.hkj.script.Script.execute(Script.java:1282)
        at dk.hkj.main.CommandProcessor.processCommandLineStatement(CommandProcessor.java:2762)
        at dk.hkj.main.CommandProcessor.processCommands(CommandProcessor.java:3041)
        at dk.hkj.main.PaneCommand.processCommand(PaneCommand.java:1595)
        at dk.hkj.main.PaneCommand.access$19(PaneCommand.java:1593)
        at dk.hkj.main.PaneCommand$32.keyTyped(PaneCommand.java:918)
        at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:248)
        at java.desktop/java.awt.Component.processKeyEvent(Component.java:6581)
        at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2896)
        at java.desktop/java.awt.Component.processEvent(Component.java:6403)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
        at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020)
        at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4882)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
        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)
Caused by: java.lang.ArithmeticException: / by zero
        at dk.hkj.script.Script.parseProduct(Script.java:442)
        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.statement(Script.java:1103)
        at dk.hkj.script.Script.doExecute(Script.java:1254)
        ... 41 more

The part I liked most was the last line: "...41 more"   ;D Made me recall this:

  :-DD

Anyway, hope the next time TC locks up on me, I can at least give you some useful info to find WTF is going on (and I learned my lesson and I'm only capturing to disk now like you originally recommended).
 

Offline Odd

  • Regular Contributor
  • *
  • Posts: 95
  • Country: no
How to prevent the graph from "jumping" ?
« Reply #3879 on: March 01, 2025, 01:01:01 pm »
the issue is that the autoscaling is calculated by a certain moment's limited data set, and only a small dataset is visualised.
A given graph may switch between those two views, depending on some peaks/noise being included or not.




This makes reading some graphs very hard. (When logging at 1s interval, the graph will re scale/move at 1hz)
Please consider scaling to all data, or do some filtering, or remove.
In this case, there are obviously some corrupted data, the voltage source is a battery cell, with no inductors inline, there is no chance of such voltage spike.

Please add option to show values under mouse (a text area displays values at a given time)
« Last Edit: March 01, 2025, 01:23:26 pm by Odd »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3880 on: March 01, 2025, 01:44:31 pm »
I will check it out and see if there is a bug in the calculations.

Thank you for the effort and for the very nice software,  by the way...

I found out what is going on:
The code I wrote and checked is the code used in the Math page
I then copied that to the Advanced Readout, but forgot a final square root.
I.e. to get SD take the square root of the showed value.
Or download the updated jar file here: http://lygte-info.dk/pic/Projects/TestController/TestController.jar  It is V2.56
 
The following users thanked this post: 2N3055, KungFuJosh

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: How to prevent the graph from "jumping" ?
« Reply #3881 on: March 01, 2025, 01:56:22 pm »
the issue is that the autoscaling is calculated by a certain moment's limited data set, and only a small dataset is visualised.
A given graph may switch between those two views, depending on some peaks/noise being included or not.

This makes reading some graphs very hard. (When logging at 1s interval, the graph will re scale/move at 1hz)
Please consider scaling to all data, or do some filtering, or remove.
In this case, there are obviously some corrupted data, the voltage source is a battery cell, with no inductors inline, there is no chance of such voltage spike.

If you run into this problem switch to manual scales. Scaling on all data point is not really a option, there can be millions in a long log and TC would never be finished with scaling, before it has to start over. I know this could have been programmed different, but that is difficult due to the library I am using for graphing.

It is possible to search in the table for min/max (Right click in the column you want to search).

Also note there is some other charting options in Grid Panel, including one that shows min/max/avg curves. These are much more limited than the main chart, but can be useful for some stuff.

Please add option to show values under mouse (a text area displays values at a given time)

A single click in the chart area will open a readout of all values in the cursor column. Right clicking the mouse gives you a couple of other options.
 

Offline Odd

  • Regular Contributor
  • *
  • Posts: 95
  • Country: no
Re: Program that can log from many multimeters.
« Reply #3882 on: March 01, 2025, 09:41:39 pm »
Yep, Thank you. now everything is clearer, and by changing "scales for chart" - it can be worked around.
Is it possible to reset/drop all data from table/chart, and start over without restarting the program?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3883 on: March 01, 2025, 09:52:19 pm »
Yep, Thank you. now everything is clearer, and by changing "scales for chart" - it can be worked around.
Is it possible to reset/drop all data from table/chart, and start over without restarting the program?

Yes, stop and restart logging. The table is cleared every time you start logging.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 986
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #3884 on: March 03, 2025, 04:21:29 pm »
Where do I set the serial port for the AR488 adapter?

I am trying to connect to a HP34401A and have taken the following steps:

- set the GPIB adapter in Load Device -> GPIB to AR488, Serial with GPIB address 22 which is the address of the HP34401.
- added the HP34401A uding the Hewlett-Packard HP34401A device definition and set type to GPIB
- set port to A:22 (the error message otherwise does not make much sense and 'A:22: Hewlett-Packard HP34401A' is not accepted ?

I then hit Reconnect, but the Commands screen has everything greyed out and I can't enter commands. In the CLI I see this:

Exception in thread "Scan ports" java.lang.ClassCastException: class dk.hkj.comm.DummyInterface cannot be cast to class dk.hkj.comm.SerialInterface (dk.hkj.comm.DummyInterface and dk.hkj.comm.SerialInterface are in unnamed module of loader 'app')
   at dk.hkj.main.InterfaceThreads$ScanPorts.addDevicesShared(InterfaceThreads.java:653)
   at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
johnc@agatha:~/Test/TestController/TestController$ sudo java -jar TestController.j


Not sure whether I am setting this up correctly, but I am working on Linux and my serial port is /dev/ttyUSB0. I don't see anywhere to set that?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3885 on: March 04, 2025, 11:26:29 am »
- set the GPIB adapter in Load Device -> GPIB to AR488, Serial with GPIB address 22 which is the address of the HP34401.

The address on the GPIB popup is not the GPIB address of the device, it is the address of the GPIB adapter, i.e. the serial port.
That field do not support right-clicking to find the correct port name, you will have to do that on the "Load devices" page and then copy the serial port name to the GPIB page.
 

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log from many multimeters.
« Reply #3886 on: March 06, 2025, 04:05:52 am »
Hi HKJ,

I've tried specifying subdirectories when logging from the command line, eg:
Code: [Select]
=var logname = "dir\\test_data"
#log 1 (logname)

This works fine if the subdirectory already exists, but otherwise Test Controller appears unable to create the subdirectory. Instead it just starts logging as normal but the data does not appear to be saved anywhere.
Is there a workaround to have Test Controller create the subdirectories as needed?
(Running on Windows 10)

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3887 on: March 06, 2025, 09:29:30 am »
Is there a workaround to have Test Controller create the subdirectories as needed?
(Running on Windows 10)

Not directly, but there is a workaround: You can execute any program:

executeDos("c:\...\pgm.exe","mkdir "+path,2000)
 

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log from many multimeters.
« Reply #3888 on: March 06, 2025, 10:35:26 am »
Is there a workaround to have Test Controller create the subdirectories as needed?
(Running on Windows 10)

Not directly, but there is a workaround: You can execute any program:

executeDos("c:\...\pgm.exe","mkdir "+path,2000)
I thought that might be the case.
When working in that context, is there a way to reference a custom data directory that is specified in the batch file?
So far with file operations I've only been able to use absolute paths or operate relative to the directory that the .jar file is located in.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 986
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #3889 on: March 06, 2025, 11:15:45 am »
- set the GPIB adapter in Load Device -> GPIB to AR488, Serial with GPIB address 22 which is the address of the HP34401.

The address on the GPIB popup is not the GPIB address of the device, it is the address of the GPIB adapter, i.e. the serial port.
That field do not support right-clicking to find the correct port name, you will have to do that on the "Load devices" page and then copy the serial port name to the GPIB page.

Thank you. I have now changed the 'Address' field to /dev/ttyUSB0 but still no change. My GPIB config is set as follows:

AR488, Id=A (default), Connection=Serial, Address=/dev/ttyUSB0, Baudrate=115200, Settings=''

The device is set up as follows:

Device='Hewlett-Packard 34401A', Type=GPIB, Address=A:22, Baudrate=(cannot set), Enable=ticked

Clicking the Reconnect button takes me to the Commands tab, but everything apart from the 'Run', 'Load and Run' and 'Outputs Off' buttons is greyed out. It is no possible to enter anything into any field. I am assuming that the middle one is where to enter commands?

I am using a UNO board and have tried the capacitor trick to prevent a reset on connection to the serial port.

The username is in the dialout group and I can connect to /dev/ttyUSB0 from a PuTTY or Arduino IDE Serial Monitor session just fine, so user access to the serial port does not seem to be a problem.

Not sure what else I am missing?
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5951
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #3890 on: March 06, 2025, 12:06:50 pm »
Not sure what else I am missing?

It sounds from your description that you've connected to the USB serial to GPIB adapter fine, but it doesn't sound like you connected to the DMM at all (even through other test methods besides TC)?

Baud rate is only for serial connection, not HPIB.

Is there a reason you don't just use a USB to Serial adapter? Seems that would be easier.
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3891 on: March 06, 2025, 02:08:45 pm »
When working in that context, is there a way to reference a custom data directory that is specified in the batch file?
So far with file operations I've only been able to use absolute paths or operate relative to the directory that the .jar file is located in.

The programming language has the .jar file directory as default, for script commands you can change default on the command line (Look in the testController.bat file). You can use script command from the programming language: runScript("#log 0\n#savelog myfile");
If you are in the script environment you can access the programming environment with = as the first char in a line or with () in a line with script commands.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3892 on: March 06, 2025, 02:12:07 pm »
AR488, Id=A (default), Connection=Serial, Address=/dev/ttyUSB0, Baudrate=115200, Settings=''

If might be you have to use "ttyUSB0", you can check that by editing a address field on the "Load devices" page and then right click.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 986
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #3893 on: March 06, 2025, 07:56:41 pm »
Not sure what else I am missing?

It sounds from your description that you've connected to the USB serial to GPIB adapter fine, but it doesn't sound like you connected to the DMM at all (even through other test methods besides TC)?

Baud rate is only for serial connection, not HPIB.

Is there a reason you don't just use a USB to Serial adapter? Seems that would be easier.

Other methods reading the meter work fine. I can connect in a terminal and issue commands such as *idn? and meas? and get a reply back. Must admit that I haven't tried using a USB-to-serial adapter direct to the serial port on the 34401A. Might be worth a try just to see whether that option works. The goal was to get it working with GPIB though.
« Last Edit: March 06, 2025, 08:02:24 pm by WaveyDipole »
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 986
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #3894 on: March 06, 2025, 07:58:19 pm »
AR488, Id=A (default), Connection=Serial, Address=/dev/ttyUSB0, Baudrate=115200, Settings=''

If might be you have to use "ttyUSB0", you can check that by editing a address field on the "Load devices" page and then right click.

Unfortunately that made no difference. I tried using the log feature, but no log was generated. Is there a log that records the establishment of the initial connection?
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5951
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #3895 on: March 06, 2025, 09:36:16 pm »
Other methods reading the meter work fine. I can connect in a terminal and issue commands such as *idn? and meas? and get a reply back. Must admit that I haven't tried using a USB-to-serial adapter direct to the serial port on the 34401A. Might be worth a try just to see whether that option works. The goal was to get it working with GPIB though.

How did the other method(s) connection settings differ from TC?
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 986
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #3896 on: March 06, 2025, 09:55:17 pm »
They didn't. Same parameters:

Serial port = /dev/ttyUSB0
Baud rate: 115200

GPIB controller sequence:

AR488 GPIB controller, ver. 0.52.15, 03/03/2025
Verbose: ON
>
> ++addr 22

PRI address set to: 22
SEC address set to: unset
>
> *idn?
>
> ++read

HEWLETT-PACKARD,34401A,0,10-5-2
>


The only difference for this manual session is that I turned verbose mode on so that I could obtain the above output.



« Last Edit: March 06, 2025, 09:59:00 pm by WaveyDipole »
 
The following users thanked this post: KungFuJosh

Offline jmurray

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Program that can log from many multimeters.
« Reply #3897 on: March 08, 2025, 04:08:58 am »
When working in that context, is there a way to reference a custom data directory that is specified in the batch file?
So far with file operations I've only been able to use absolute paths or operate relative to the directory that the .jar file is located in.

The programming language has the .jar file directory as default, for script commands you can change default on the command line (Look in the testController.bat file). You can use script command from the programming language: runScript("#log 0\n#savelog myfile");
If you are in the script environment you can access the programming environment with = as the first char in a line or with () in a line with script commands.

I don't think I was very clear.
I'm already specifying custom locations for things like logged data, but I'm wondering if within scripts etc whether I can specify the path of a file as relative instead of absolute, eg:
Code: ("Relative paths, preferred") [Select]
=var program = "<ScriptLibrary>\some_subdirectory\name_of_file.ext"
=var path = "<ScriptLibrary>\some_subdirectory"
=var timeout = 1000
=executeDos(program, path, timeout)

instead of:
Code: ("Absolute paths, less portable between different computers") [Select]
=var program = "C:\Users\<username>\TestController\ScriptLibrary\some_subdirectory\name_of_file.ext"
=var path = "C:\Users\<username>\TestController\ScriptLibrary\some_subdirectory"
=var timeout = 1000
=executeDos(program, path, timeout)


Additionally: I note the #stopscript command, but is there any way to stop a specific script that is running in the background, instead of stopping all?

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3898 on: March 08, 2025, 05:27:20 pm »
I don't think I was very clear.
I'm already specifying custom locations for things like logged data, but I'm wondering if within scripts etc whether I can specify the path of a file as relative instead of absolute, eg:
Code: ("Relative paths, preferred") [Select]
=var program = "<ScriptLibrary>\some_subdirectory\name_of_file.ext"
=var path = "<ScriptLibrary>\some_subdirectory"
=var timeout = 1000
=executeDos(program, path, timeout)

It do not exist, but I like you idea and will add the following global vars in the next release:
path.devices
path.script
path.config
path.data
path.program


Additionally: I note the #stopscript command, but is there any way to stop a specific script that is running in the background, instead of stopping all?

No, I do not really see a reason for it. Generally a script knows when it is finished.
If you need to flag a script to stop, you can make a global variable that can be used to communicate with the script, i.e.
Start the script with:

=globalvar stopme=1

Then somewhere in the script test:

#if (stopme==0)
#return
#endif


This means the line:
=stopme=0
will stop the script next time is passes the test.
 
The following users thanked this post: jmurray

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 986
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #3899 on: March 11, 2025, 09:07:15 pm »
No one seems to have answered my question. Does TestController have any logging of the establishment of the connection with the serial port and GPIB controller? I can only see logging of commands/data sent by the user after the connection has already been attempted.

I tried running from tcrundebug and got this output:

Exception in thread "Scan ports" java.lang.ClassCastException: class dk.hkj.comm.DummyInterface cannot be cast to class dk.hkj.comm.SerialInterface (dk.hkj.comm.DummyInterface and dk.hkj.comm.SerialInterface are in unnamed module of loader 'app')
   at dk.hkj.main.InterfaceThreads$ScanPorts.addDevicesShared(InterfaceThreads.java:653)
   at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)
Exception in thread "Scan ports" java.lang.ClassCastException: class dk.hkj.comm.DummyInterface cannot be cast to class dk.hkj.comm.SerialInterface (dk.hkj.comm.DummyInterface and dk.hkj.comm.SerialInterface are in unnamed module of loader 'app')
   at dk.hkj.main.InterfaceThreads$ScanPorts.addDevicesShared(InterfaceThreads.java:653)
   at dk.hkj.main.InterfaceThreads$ScanPorts.run(InterfaceThreads.java:803)


But what does this mean?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf