Author Topic: Program that can log from many multimeters.  (Read 651703 times)

Pukker and 2 Guests are viewing this topic.

Offline fricci

  • Contributor
  • Posts: 26
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3500 on: June 07, 2024, 06:22:32 pm »

I see the problem, most lines are text lines to make it easy to type stuff, i.e. 3*5 will transmit "3*5" and not "15", but you can switch to calculation by using brackets, i.e. (3*5) will transmit "15"

This means this line:
#scpiCmd Enable holding 0x4000 Key

Will try to transmit "Key"

#scpiCmd Enable holding 0x4000 (Key)

This line will transmit the value of key.

#scpiCmd SetVars
:setvar: Key=1234

#initCmd address SlaveID;SetVars;

#scpiCmd Enable holding 0x4000 (Key)

==========================

Starting
;; jSerialComm version: 2.10.3
;; Start thread for: COM6 - GS A3_ID5
;; COM6: Set params: 19200E81
;; COM6: Tx <address 5>
;; COM6: Tx <SetVars>
;; COM6: Tx <:setvar: Key=1234>
;; Found GS A3_ID5 on USB-RS485 Cable (COM6)
Enable
;; A3_ID5: Tx <Enable>
dk.hkj.script.ProgramExceptions$UnknownException: Variable not found Key
Key____<----____

 :-//
 

Offline fricci

  • Contributor
  • Posts: 26
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3501 on: June 07, 2024, 06:31:52 pm »
It sounds like the scope of the Key variable is a local scope.......
 

Offline fricci

  • Contributor
  • Posts: 26
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3502 on: June 08, 2024, 01:18:29 pm »
I discovered the issue looking at some other definition files ..... the correct syntax is:

#scpiCmd SetVars none
:setvar: Key=1234
#initCmd address SlaveID;SetVars;
#scpiCmd Enable holding 0x4000 (Key)

Can I hide the command SetVars from the command line?
 

Offline Gertjan

  • Regular Contributor
  • *
  • Posts: 146
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #3503 on: June 08, 2024, 03:11:05 pm »
Hi HKJ,

I think I found a bug in the "Scales for Chart" tab. I can not change the number of decimals for the chart anymore:


Scales for chart-screenshot-1000pix.png

One can enter a new value, but when (after entering the new value) pressing TAB or Enter, nothing happens. Only with Escape I can leave the field, which returns to the old value (always "2")

At the moment of pressing TAB or ENTER a list of errors are appearing in the debug log:

Code: [Select]
Starting
;; jSerialComm version: 2.10.3

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
        at dk.hkj.main.ChartScales$ScalesTableModel.parseInt(ChartScales.java:861)
        at dk.hkj.main.ChartScales$ScalesTableModel.setValueAt(ChartScales.java:873)
        at javax.swing.JTable.setValueAt(Unknown Source)
        at javax.swing.JTable.editingStopped(Unknown Source)
        at javax.swing.AbstractCellEditor.fireEditingStopped(Unknown Source)
        at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(Unknown Source)
        at javax.swing.DefaultCellEditor.stopCellEditing(Unknown Source)
        at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(Unknown Source)
        at javax.swing.SwingUtilities.notifyAction(Unknown Source)
        at javax.swing.JComponent.processKeyBinding(Unknown Source)
        at javax.swing.JTable.processKeyBinding(Unknown Source)
        at javax.swing.JComponent.processKeyBindings(Unknown Source)
        at javax.swing.JComponent.processKeyEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

I tested on two systems, one is running Windows 10, the other Windows 7. On both systems the problem is the same, and the error logs are also (more or less) the same.
Both systems are running the latest version of TestController (2.44). Both systems are using Oracle Java, auto-updated to the latest version. (Version 8, Update 4.11)

Here are for your perusal both complete error logs: TC_debug_logs-change_decimals.zip

Regards, Gertjan.
« Last Edit: June 08, 2024, 03:16:44 pm by Gertjan »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3504 on: June 08, 2024, 04:08:34 pm »
Can I hide the command SetVars from the command line?

What do you mean by that?
There is no filter to exclude some commands from usage on the command line.
« Last Edit: June 08, 2024, 04:13:09 pm by HKJ »
 
The following users thanked this post: fricci

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3505 on: June 08, 2024, 04:12:52 pm »
I think I found a bug in the "Scales for Chart" tab. I can not change the number of decimals for the chart anymore:

Thanks for the error report, I have found and fixed the bug now.
For a fast workaround, you can stop TC, edit Settings\settingsScales.txt, then start TC again.
 

Offline Gertjan

  • Regular Contributor
  • *
  • Posts: 146
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #3506 on: June 08, 2024, 04:32:34 pm »
Hi HKJ,

That was quick. :-+  Thanks!   The workaround works for me.  :)

Regards, Gertjan.
 

Offline fricci

  • Contributor
  • Posts: 26
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3507 on: June 09, 2024, 05:09:26 pm »
Hi HJK,
I apologize for so many questions...... but I don't find any examples for what I am trying to do.
I need to manipulate a modbus bitmap register (flags), I found a working mode to read a bit status, but I didn't find a way to set a bit in a register. I can do it easily in a standard programming language but I am a bit lost in TC programming.
This what I wrote and it seems to work correctly for retrieving a flag status, but I don't understand how to set it.
Can you help me?

#scpiCmd ConfRegister? holding? 0x400B
#scpiCmd ConfRegister holding 0x400B (value)

#cmdSetup checkbox Linearize Configuration
:read: ConfRegister?
:readmath: matchBits("xxxxxxxxxxxxxx1x",value)
;  :readmath: (binConvBit(value,1,1)==1)?1:0 - a working alternative
:write: ....................?
:update:
on 0 1
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3508 on: June 09, 2024, 05:47:44 pm »
Hi HJK,
I apologize for so many questions...... but I don't find any examples for what I am trying to do.
I need to manipulate a modbus bitmap register (flags), I found a working mode to read a bit status, but I didn't find a way to set a bit in a register. I can do it easily in a standard programming language but I am a bit lost in TC programming.
This what I wrote and it seems to work correctly for retrieving a flag status, but I don't understand how to set it.
Can you help me?


You save the original value from the register and then you do bit operations to isolate and add the bit in, the variable handling must be in the #scpiCmds part of the definition.

#scpiCmd ConfRegister? holding? 0x400B
:setvar: lastConf=value;
#scpiCmd ConfRegisterLin holding 0x400B (lastConf&~0b0010+value?0b0010:0)

#cmdSetup checkbox Linearize Configuration
:read: ConfRegister?
:readmath: value&0b0000010
:write: ConfRegister value
on 0 1

Code is not tested!!

 

Offline jmurray

  • Contributor
  • Posts: 38
  • Country: au
Re: Program that can log from many multimeters.
« Reply #3509 on: June 10, 2024, 03:29:13 am »
   Added: Block driver will support socket interface.

Block driver on socket does not appear to be reading response packets into Test Controller.

Code: (Tx/Rx via serial) [Select]
;; COM14: Tx: 40 30 31 32 35 34 36 2A 0D
;; COM14: Rx: 40 30 31 32 35 30 30 43 38 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 2A 0D 0A

Code: (Tx/Rx via socket) [Select]
;; 192.168.0.80: Tx: 40 30 31 32 35 34 36 2A 0D
;; 192.168.0.80: Rx timeout 1000ms   In buffer:
dk.hkj.script.ProgramExceptions$UnknownException: No digits in number <>

Monitoring the lines with a terminal window I can see the responses to Test Controller's commands.
When using socket, the response does not appear to be read into Test Controller so it keeps sending the same command.

I will have to look closer at this.

...
Monitoring the lines with a terminal window I can see the responses to Test Controller's commands.
When using socket, the response does not appear to be read into Test Controller so it keeps sending the same command.
@jmurray, FYI, it works for me. Something is incorrect on your side.


I've finally had a chance to look at this further, and I'm still not having any luck.
Hopefully I've missed something simple.

I've confirmed operation with a USB to RS485 adaptor.
It did not work with an ethernet to RS485 adaptor. I purchased a different ethernet to RS485 adaptor to eliminate that potential source of error, and am experiencing the same issue.

With both the USB and ethernet adaptors connected to the same bus, I can verify that a command sent by either adaptor (@012546*) is seen by either adaptor, and that the response from the instrument is also seen by both adaptors.
2286949-0
With Test Controller using the USB adaptor, I can observe the comms with the ethernet adaptor and see that there is no unexpected behaviour, while Test Controller successfully receives the response from the instrument.
2286953-1

This time, with Test Controller using the ethernet adaptor and monitoring the bus with the USB adaptor, it can be seen that the comms are still working as normal, but Test Controller is no longer reading in the response from the instrument.
2286957-2


This should be all the relevant info from the definition file:
(Note: I'm aware #rxEol has no effect on Block driver - I left it there from testing and as a reminder because the commands sent to the instrument are *\r, but the received responses are *\r\n )
Code: [Select]

#metadef
#idString GTH-225-20-CP
#name Giant Force GTH-225-20-CP
#handle GTH225
#replaceText MinTemperature -20
#replaceText MaxTemperature 100

;---

#meta
#author jmurray@jmaudio.com.au
#idString GTH
#name Giant Force GTH-xxx-xx-CP
#handle GTH
#port 23 comfixedbaud
#baudrate 9600
#driver Block

;---

#eol *\r
;#rxEol *\r\n
#checksum xor8 hexhl 0 0 0 0

;---

#scpiCmd READ:FIX? txrxn? 37 "@0125" / 5h4 9h4 13h4 17h4 21h4 25h2 27h1 28h1 29h1 30h1 31h1
 

Offline fricci

  • Contributor
  • Posts: 26
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3510 on: June 10, 2024, 12:45:26 pm »
You save the original value from the register and then you do bit operations to isolate and add the bit in, the variable handling must be in the #scpiCmds part of the definition.

#scpiCmd ConfRegister? holding? 0x400B
:setvar: lastConf=value;
#scpiCmd ConfRegisterLin holding 0x400B (lastConf&~0b0010+value?0b0010:0)

#cmdSetup checkbox Linearize Configuration
:read: ConfRegister?
:readmath: value&0b0000010
:write: ConfRegister value
on 0 1

Code is not tested!!

Thank you very much for your invaluable help.
In the effort to minimize the #scpiCmd (I have several 16 bit flags registers to manage), I would like to make a single function using the full programming language (#pgm#)  to set/reset any bit of any register.

How works a function's parameter passing / retrieving in TC?

I did some test about parameter passing and I successfully passed / retrieved a  single parameter, but what if I have to pass more than one?
Can I directly retrieve a command line parameter using something like params[0] or they are retrieved all in single bunch using "value" and I have to do the parsing of parameters to extract them once retrieved by "value"?
 

Offline rivedino

  • Newbie
  • Posts: 5
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3511 on: June 11, 2024, 08:17:00 am »
Good morning everyone.

I wanted to ask you for help if possible, I am trying to connect via TestController to a Siglent SDS2104X Plus oscilloscope in the devices present there is only SDS2104X without the Plus and therefore TestController gives me an error I tried to add Plus in the configuration file now TestController sees the oscilloscope but sends it partially haywire, all four channels are activated and it doesn't work properly.
The interface is ethernet.
Can anyone help me?


A thousand thanks.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3512 on: June 12, 2024, 10:23:32 am »
I've finally had a chance to look at this further, and I'm still not having any luck.
Hopefully I've missed something simple.

Try this test version of TC http://lygte-info.dk/pic/Projects/TestController/TestController.jar
 
The following users thanked this post: jmurray

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3513 on: June 12, 2024, 10:26:00 am »
I did some test about parameter passing and I successfully passed / retrieved a  single parameter, but what if I have to pass more than one?
Can I directly retrieve a command line parameter using something like params[0] or they are retrieved all in single bunch using "value" and I have to do the parsing of parameters to extract them once retrieved by "value"?

There is no special code for parameter passing, all parameters are passed in a single line, you can split it and isolate the different parameters.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3514 on: June 12, 2024, 10:31:09 am »
Good morning everyone.

I wanted to ask you for help if possible, I am trying to connect via TestController to a Siglent SDS2104X Plus oscilloscope in the devices present there is only SDS2104X without the Plus and therefore TestController gives me an error I tried to add Plus in the configuration file now TestController sees the oscilloscope but sends it partially haywire, all four channels are activated and it doesn't work properly.
The interface is ethernet.
Can anyone help me?

I do not have a Siglent scope and do not know exactly how the definition is supposed to work.
TC can use the oscilloscope as a voltmeter, it do usually not support other functions. But I cannot say if the definition work as it is supposed to or if the scope has a slightly different protocol.
 

Offline pieter155

  • Newbie
  • Posts: 4
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #3515 on: June 12, 2024, 11:12:36 am »
Hi, I have a somewhat similar question for my Siglent SDS2202X-E (see page 137 in this post).
What do you see when you start the program in debug mode?

@HKJ, you are refering to a 'voltmetermode' in TC. How do you enable this mode?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3042
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #3516 on: June 12, 2024, 12:12:00 pm »
Hi, I have a somewhat similar question for my Siglent SDS2202X-E (see page 137 in this post).

Please use post number (It is above every post) as reference, page number varies with configuration

What do you see when you start the program in debug mode?

Typically something like this:
;; 6937689.36ms jSerialComm version: 2.10.3
;; 6937718.72ms Start thread for: COM15 - BENNING MM12
;; 6937719.03ms Start thread for: localhost - HKJ Tester
;; 6937719.26ms Start thread for: 10.0.0.60 - Keithley DMM7510
;; 6937895.45ms COM15: Tx: 55 55 00 00 AA
;; 6937895.45ms COM15: Set params: 9600
;; Found HKJ Tester on localhost
;; 6938854.98ms Stopping thread for: 10.0.0.60 - Keithley DMM7510
;; USB-Serial Controller (COM15) Device "BENNING,MM12," do not match answer: "No valid answer"
;; 6939671.56ms COM15: Close
;; 6939671.66ms Stopping thread for: COM15 - BENNING MM12
;; 6939671.71ms COM15: Close

The timestamp is optional, jSerialComm is shown when any serial ports are requested and each device will have a Start line and a found or not found (Stopping thread) line. There will usually also be a number of data lines starting with TX and RX

@HKJ, you are refering to a 'voltmetermode' in TC. How do you enable this mode?

There is no special voltmeter mode in TC (Some of the popup could maybe be called that), but in connection with oscilloscopes TC cannot read the full data, only the voltmeter values from the scope.
TC is designed to log data at up to about 100 samples/sec, with many devices the maximum rate will be between 1 and 10 samples/second due to the device.
 

Offline pieter155

  • Newbie
  • Posts: 4
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #3517 on: June 12, 2024, 12:47:21 pm »
Hi HKJ,

You are right, the post numbers are 3451 and 3453.
My post 3515 was actually a reply to rivedino's post, but something went wrong I see now.

@Rivedino, could you post a screenshot of your test controller in debug mode? I'm curious to see the output on your Siglent device.
As mentioned before I'm trying to get my Siglent DSO working with TC as well.
« Last Edit: June 12, 2024, 12:51:27 pm by pieter155 »
 

Offline rivedino

  • Newbie
  • Posts: 5
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3518 on: June 12, 2024, 01:22:15 pm »
Good morning everyone.

Thanks for the reply, I'm trying the new version of TC but I continue to have problems TC doesn't see the siglent sds2104x plus for me to see it I have to modify the configuration file and add Plus, I attach the screenshot in debug mode.

Thank you all.
 

Offline rivedino

  • Newbie
  • Posts: 5
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3519 on: June 12, 2024, 01:35:02 pm »
Hi everyone.
I'll explain:
The lines of the configuration file that I have to modify so that TC can see the siglent for me are these three that I am attaching if it is correct to do so, I have tried but TC is still giving me problems.

Thank you all for the great work you do.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 2843
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #3520 on: June 12, 2024, 02:06:50 pm »
Hi everyone.
I'll explain:
The lines of the configuration file that I have to modify so that TC can see the siglent for me are these three that I am attaching if it is correct to do so, I have tried but TC is still giving me problems.

Thank you all for the great work you do.

You can modify, or copy and paste to create your own definition for a new instrument. I just copypastad it to create new definitions for it.

For my scope I copied/modified this definition:
Code: [Select]
#metadef
#author MikeLud
#idString Siglent Technologies,SDS2504X Plus,
#name Siglent SDS2504X Plus
#handle SDS2504X Plus
#replaceText AV C1:PAVA? RMS;C2:PAVA? RMS;C3:PAVA? RMS;C4:PAVA? RMS;C1:PAVA? PKPK;C2:PAVA? PKPK;C3:PAVA? PKPK;C4:PAVA? PKPK

Then I added the scope on the Load devices screen, and restarted TC and it recognized it fine.

You need to make sure the definition reflects the active bandwidth of your scope, not just what the sticker on the front says.


UPDATE: Disregard using LXI mode. I don't know why it didn't work the first time with the device set as "Socket" but after switching it back to Socket, and restarting TC, it works correctly. Vpp and Vrms show correctly now also.


Update 2: The definition needs more to it. For example, it activates all channels when connected, that should be optional. This happens anytime readings are read, even from single popup windows for a specific channel. I can close 3 channels, then make popups for CH1, and it will automatically activate 2 - 4.
« Last Edit: June 12, 2024, 11:51:12 pm by KungFuJosh »
"Right now I’m having amnesia and déjà vu at the same time. I think I’ve forgotten this before." - Steven Wright
 
The following users thanked this post: tautech

Offline rivedino

  • Newbie
  • Posts: 5
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3521 on: June 12, 2024, 02:11:09 pm »
Thanks a lot I'll try.
 

Offline rivedino

  • Newbie
  • Posts: 5
  • Country: it
Re: Program that can log from many multimeters.
« Reply #3522 on: June 12, 2024, 02:47:03 pm »
It works now thanks KungFuJosh.
« Last Edit: June 12, 2024, 02:49:31 pm by rivedino »
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 2843
  • Country: us
  • TEAS is real.
Re: Program that can log from many multimeters.
« Reply #3523 on: June 12, 2024, 11:41:02 pm »
It works now thanks KungFuJosh.

Disregard what I said about LXI. Switch it back to Socket and restart TC, and it should work correctly (for Vpp and Vrms).

Thanks,
Josh
« Last Edit: June 12, 2024, 11:51:40 pm by KungFuJosh »
"Right now I’m having amnesia and déjà vu at the same time. I think I’ve forgotten this before." - Steven Wright
 

Offline jmurray

  • Contributor
  • Posts: 38
  • Country: au
Re: Program that can log from many multimeters.
« Reply #3524 on: June 13, 2024, 03:39:01 am »
I've finally had a chance to look at this further, and I'm still not having any luck.
Hopefully I've missed something simple.

Try this test version of TC http://lygte-info.dk/pic/Projects/TestController/TestController.jar

Hi HKJ,

That addresses the issue. Thank you very much for your efforts!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf