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

wim.de.jong.59, Gertjan, homico and 26 Guests are viewing this topic.

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4625 on: September 18, 2025, 02:49:22 pm »
I've never tied your program or downloaded it.  I was wondering if you were planning to add support for the new Brymen BM788BT.   Looking at your list of supported meters, I don't see the 121GW, Gossen Ultra, UNI-T UT181A.   With the protocol for the 121GW being open, I am thinking that the only reason you don't support it due to it using BLE.   Which would explain why the others are not listed as well.   

Any plans to support BLE in the future?

Do they show up as COM ports over Bluetooth?
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4626 on: September 18, 2025, 03:13:31 pm »
I've never tied your program or downloaded it.  I was wondering if you were planning to add support for the new Brymen BM788BT.   Looking at your list of supported meters, I don't see the 121GW, Gossen Ultra, UNI-T UT181A.   With the protocol for the 121GW being open, I am thinking that the only reason you don't support it due to it using BLE.   Which would explain why the others are not listed as well.   

Any plans to support BLE in the future?

Not really, Java do not support it and I do  not have a universal library that does.
One way to support them is to program a ESP32 (or similar processor) to convert the protocol to serial, then it is easy to support. I have a website where I can publish that kind of project: https://lygte-info.dk/project/TestControllerUserProjects1%20UK.html
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 13831
  • Country: us
Re: Program that can log/control many multimeters and other devices.
« Reply #4627 on: September 18, 2025, 03:43:38 pm »
Was not expecting to read that Java has no support. 

There is that bluegiga that has the BLE stack built in and simulates a com port over USB.  They do not support the large MTU sizes the new Brymen meter requires.  See attached Wireshark.

Reason I brought it up is eventually Dave will be selling that new Brymen meter and as far as I know, there is no software available for a PC yet.  I was thinking your program may fill that void. 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4628 on: September 18, 2025, 04:03:38 pm »
Was not expecting to read that Java has no support. 

Jave did once support serial ports, but it was removed, as far as I know it do not support any other peripheral interfaces (Except network)
Now a independent developer makes a serial library for Java that support a lot of processors and OS's

There is that bluegiga that has the BLE stack built in and simulates a com port over USB.  They do not support the large MTU sizes the new Brymen meter requires.  See attached Wireshark.

I do not know anything about that.

Reason I brought it up is eventually Dave will be selling that new Brymen meter and as far as I know, there is no software available for a PC yet.  I was thinking your program may fill that void.

It would be nice, but as I wrote above it probably requires a external processor. With the Arduino platform it is fairly easy to make and also for other to replicate it from a published project (No hardware has to be made, only software loaded into the processor).
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4629 on: September 18, 2025, 04:13:00 pm »
inputValue can be accessed in the script (It is called value here, because there is no answer to call value) and you have direct access to all variables in script.

Code: [Select]
#scpiCmd MyFunc #pgm#
var myVar=value;

endif;


I need something along the lines of this to work:
Code: [Select]
#scpiCmd MeasType1 #pgm#
var type=value;
:setvar: meas1Type=type;

So, what about :setvar:? That doesn't seem to work with or without the colons; either way causes an error in the debug log.

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4630 on: September 18, 2025, 04:22:52 pm »
I need something along the lines of this to work:
Code: [Select]
#scpiCmd MeasType1 #pgm#
var type=value;
:setvar: meas1Type=type;

So, what about :setvar:? That doesn't seem to work with or without the colons; either way causes an error in the debug log.

:setvar: is very simple, it runs a program with "var "+anything_after_it

This mean in your code you can just type:
var meas1Type=type;


 
The following users thanked this post: KungFuJosh

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 13831
  • Country: us
Re: Program that can log/control many multimeters and other devices.
« Reply #4631 on: September 18, 2025, 04:25:10 pm »
Attached datasheet for the bluegiga.  BLE 4.0 only. Sounds like back then, it was hit and miss if vendor's supported the larger MTU.   I think 4.2 required it.  Something like this with 5.0+ seems like would suit your needs if you were wanting to try and add support.

While the meters I mentioned all use BLE, the protocols that ride on top of that are anything but a standard.  Even if you had a USB comm port radio with a built in stack, you would still have to write all the software to support it. 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 13831
  • Country: us
Re: Program that can log/control many multimeters and other devices.
« Reply #4632 on: September 18, 2025, 04:40:25 pm »
Maybe something like this could be used.   

https://www.electronics-lab.com/bleuio-ble-5-0-usb-adapter/

https://www.tindie.com/products/axelh/bluetooth-50-usb-adapter-ble/

I'm surprised you can't just call the OS's built-in libs with JAVA.  No real need for an added radio if your tablet ... already has support.

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4633 on: September 18, 2025, 05:17:53 pm »
I'm surprised you can't just call the OS's built-in libs with JAVA.  No real need for an added radio if your tablet ... already has support.

You sort of can, but that is platform depend. I.e. I would have to make code for a lot of processor/OS combinations.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4634 on: September 18, 2025, 05:39:17 pm »
This is super simplified for testing, but still doesn't work:
Code: [Select]
#value M1_V V SI V
#value M1_Hz Hz SI Hz

#askMode getMeasUnit1?
#askValues DynamicM1?

This is the result of getMeasUnit1?:
Code: [Select]
getMeasUnit1?
;; Magnova: Tx <getMeasUnit1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <Hz>
;; Hz

This is the debug log from it failing:
Code: [Select]
;; Magnova: Tx <MeasType1 HFReq>
;; Magnova: Script start
;; Magnova: Script end <>
;; Magnova: Tx <getMeasType1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <HFReq>
getMeasUnit1?
;; Magnova: Tx <getMeasUnit1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <Hz>
;; Hz
;; Magnova: Tx <DynamicM1?>
;; Magnova: Script start
;; Magnova: Tx <:MEAS:HFReq:CURR? CHAN1>
;; XXX.XXX.XXX.XXX: Tx: <:MEAS:HFReq:CURR? CHAN1.> 3A 4D 45 41 53 3A 48 46 52 65 71 3A 43 55 52 52 3F 20 43 48 41 4E 31 0A
;; XXX.XXX.XXX.XXX: Rx: <1000093.75878989> 31 30 30 30 30 39 33 2E 37 35 38 37 38 39 38 39 0A
;; Magnova: Rx <1000093.75878989>
;; Magnova: Script end <1000093.75878989>
;; Magnova: Rx <1000093.75878989>
;; Magnova: Rx as numbers <1000093.75878989>
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot read field "modes" because "this.form" is null
        at dk.hkj.devices.SetupFormats.syncModeChange(SetupFormats.java:428)
        at dk.hkj.main.PopupSetupSelection.syncModeChange(PopupSetupSelection.java:189)
        at dk.hkj.main.DeviceInterface$4.run(DeviceInterface.java:487)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
        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:400)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        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)
;; Magnova: Tx <DynamicM1?>
;; Magnova: Script start
;; Magnova: Tx <:MEAS:HFReq:CURR? CHAN1>
;; XXX.XXX.XXX.XXX: Tx: <:MEAS:HFReq:CURR? CHAN1.> 3A 4D 45 41 53 3A 48 46 52 65 71 3A 43 55 52 52 3F 20 43 48 41 4E 31 0A
;; XXX.XXX.XXX.XXX: Rx: <999625.140572285> 39 39 39 36 32 35 2E 31 34 30 35 37 32 32 38 35 0A
;; Magnova: Rx <999625.140572285>
;; Magnova: Script end <999625.140572285>
;; Magnova: Rx <999625.140572285>
;; Magnova: Rx as numbers <999625.140572285>
;; Magnova: Tx <DynamicM1?>
;; Magnova: Script start
;; Magnova: Tx <:MEAS:HFReq:CURR? CHAN1>
;; XXX.XXX.XXX.XXX: Tx: <:MEAS:HFReq:CURR? CHAN1.> 3A 4D 45 41 53 3A 48 46 52 65 71 3A 43 55 52 52 3F 20 43 48 41 4E 31 0A
;; XXX.XXX.XXX.XXX: Rx: <999781.297841097> 39 39 39 37 38 31 2E 32 39 37 38 34 31 30 39 37 0A
;; Magnova: Rx <999781.297841097>
;; Magnova: Script end <999781.297841097>
;; Magnova: Rx <999781.297841097>
;; Magnova: Rx as numbers <999781.297841097>

I also find this line in that log pretty weird:
Code: [Select]
;; Magnova: Tx <:MEAS:HFReq:CURR? CHAN1>
;; XXX.XXX.XXX.XXX: Tx: <:MEAS:HFReq:CURR? CHAN1.>
Why did it add the period?

Anyway, it's working great to select the channel and type of measurement, but it fails for the unit selection as above, despite the unit read command working.

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4635 on: September 18, 2025, 05:47:02 pm »
This is super simplified for testing, but still doesn't work:


Anyway, it's working great to select the channel and type of measurement, but it fails for the unit selection as above, despite the unit read command working.

Tyr playing with:
=deviceMode("Magnova");

It will show what mode TC believes it is on.

I also find this line in that log pretty weird:
Code: [Select]
;; Magnova: Tx <:MEAS:HFReq:CURR? CHAN1>
;; XXX.XXX.XXX.XXX: Tx: <:MEAS:HFReq:CURR? CHAN1.>
Why did it add the period?

It is a CR or LF code, they do not print well in text mode.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4636 on: September 18, 2025, 06:00:44 pm »
Tyr playing with:
=deviceMode("Magnova");

It will show what mode TC believes it is on.

Code: [Select]
getMeasUnit1?
;; V
=deviceMode("Magnova");
;; V
getMeasUnit1?
;; Hz
=deviceMode("Magnova");
;; V

Shouldn't #askMode getMeasUnit1? change the response of =deviceMode("Magnova");?

ETA: Or does that only work when actively updated from #cmdMode?

Thanks,
Josh
« Last Edit: September 18, 2025, 06:22:59 pm by KungFuJosh »
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4637 on: September 18, 2025, 06:38:33 pm »
To test that out, I added this:
Code: [Select]
#cmdModeLayout 1 5
#cmdMode Update_M1 getMeasUnit1?
getMeasUnit1?

That worked to update the mode.

Is there any way I can bypass that step and have TC update the Mode without manually clicking the button?

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4638 on: September 18, 2025, 06:50:45 pm »
That worked to update the mode.

Is there any way I can bypass that step and have TC update the Mode without manually clicking the button?

Yes: #modeFromValue
It requires a expression that takes the answer from #askValue and process it into a mode.
I.e. you must ask your mode (and the value) in #askValue and then you can process the result in:
#askValuesReadFormat/#askModeMathFormat and #modeFromValue
to isolate value and mode again.
 
The following users thanked this post: KungFuJosh

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4639 on: September 18, 2025, 08:26:48 pm »
Yes: #modeFromValue
It requires a expression that takes the answer from #askValue and process it into a mode.
I.e. you must ask your mode (and the value) in #askValue and then you can process the result in:
#askValuesReadFormat/#askModeMathFormat and #modeFromValue
to isolate value and mode again.

I've tried this a couple different ways, and it sort of worked and then didn't.  :palm:

All the code for setting the variables and changing the measurement work, but changing the unit still does not update the Current Values page.

Here's where I'm currently at with it (unit change not updating CV page):
Code: [Select]
#scpiCmd DynamicM1? #pgm#
var fullCommand=":MEAS:" + meas1Type + ":CURR? ";
var result=deviceRead(handle, fullCommand + meas1Chan);
print(result);

#scpiCmd MeasType1 #pgm#
var type=value;
var meas1Type=value;
var meas1Unit="";
var fullunit1Command=meas1Chan + ":UNIT?";
var unit1result=deviceRead(handle, fullunit1Command);
if (type=="VMIN" || type=="VMAX" || type=="VPP" || type=="VBASe" || type=="VTOP" ||
    type=="VAMP" || type=="VLOWer" || type=="VUPPer" || type=="VMID" || type=="VAVG" ||
    type=="VRMS" || type=="VSDeviation" || type=="VPPReshoot" || type=="VNPReshoot" ||
    type=="VPOVershoot" || type=="VNOVershoot")
    if (unit1result=="V")
    var meas1Unit="V";
    elseif (unit1result=="A")
    var meas1Unit="A";
endif
elseif (type=="VPARea" || type=="VNARea" || type=="VAARea" || type=="VNAArea" ||
           type=="VPPArea" || type=="VNPArea" || type=="VAPArea" || type=="VNAPArea")
    var meas1Unit="Vs";
elseif (type=="HRTime" || type=="HFTime" || type=="HPERiod" || type=="HHWidth" ||
           type=="HLWidth")
    var meas1Unit="s";
elseif (type=="HFReq")
    var meas1Unit="Hz";
elseif (type=="HHDuty" || type=="HLDuty")
    var meas1Unit="Percent";
elseif (type=="RECount" || type=="FECount" || type=="PPCount" || type=="NPCount" || type=="")
    var meas1Unit="";
endif
#scpiCmd getMeasType1? none?
:readmath: meas1Type
#scpiCmd getMeasUnit1? none?
:readmath: meas1Unit

#value M1_Volts V SI V
#value M1_Amps A SI A
#value M1_Vs V SI Vs
#value M1_Seconds s SI s
#value M1_Hertz Hz SI Hz
#value M1_Percent Percent SI Percent
#value M1_ _ SI _

#askMode getMeasUnit1?
#askModeMathFormat getElement(value,0)
#askValues DynamicM1?

#readingDelay 1
#modeChangeDelay 2

That code is mostly complete, and only showing 1 of 5 available measurements for the Current Values page.
If possible, I would prefer it like to look like this where only the units change:
Code: [Select]
#value M1 V SI V
#value M1 A SI A
#value M1 V SI Vs
#value M1 s SI s
#value M1 Hz SI Hz
#value M1 Percent SI Percent
#value M1 _ SI _
But that doesn't seem to work at all.

Adding #modeFromValue getElement(value,0) didn't make it work. I need to use the cmdMode button still.

The Unit type is entirely based on a set variable, so the device has nothing to say about it in this regard, and only states the current measurement without any unit info.

So what would be the correct way to make that update automatically when the Set button is pressed with the measurement mode?

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4640 on: September 19, 2025, 09:32:44 am »
When the answer from: #askValues DynamicM1?
is passed to #modeFromValue
how do it get the mode?

And where is your #modeFromValue

#askMode will change mode when the "Mode" commands are used, this sends it own command to get the mode.
#modeFromValue will change mode at any time (Except when logging is in progress), this derivatives its mode #askValues and you must supply the expression to do that.
 

Online Gertjan

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: nl
Re: Program that can log/control many multimeters and other devices.
« Reply #4641 on: September 19, 2025, 09:49:05 am »
Please correct me if I am wrong, but isn't the param sweeper controlling the logging with "Log interval" and "Step time"?
Could you expand a bit on the relation between param sweeper and log system to make this more clear?

Yes the sweeper sends orders to the log system, any popup in TC can theoretical start/stop the log system and a couple do it.
Anything you can control with a script command, can also be controlled from any popup in TC, if there is a reason to do it (Mostly there is not) .
https://lygte-info.dk/project/TestControllerScriptCommands%20UK.html

Hi HKJ,

The problem remains that some devices controlled by the param sweeper need some time after a step before their output is stable.

So it should be possible for the param sweeper to send the command to the device it is controlling for the next step, then wait a bit, and then send the command to the log system for the next measurement.

A feature request: :)
- Could you make an extra field for measurement delay in the param sweeper? (with default setting of zero) The best and most versatile option :).
- Or add a standard, built in, delay between the next sweep step, and the command to the log system for the measurement. Something like 10% of the log interval would work most of the time. (after all, with slower devices to control one would choose a longer log interval)

Cases I encountered in the recent past were it would have been helpful to have a delay, to wait until the controlled device was stable:
- Low frequency generator (needed some time for amplitude stabilisation)
- Characterising small solar panels (U, I & P curves vs amount of light, some panels were a bit slow)
- Characterising vactrols (the photo resistors are having a slow response time)
- Measuring  PDVS2 mini linearity curve with a 3458A :) (requires ppm level stability)

regards, Gertjan.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4642 on: September 19, 2025, 12:51:52 pm »
A feature request: :)
- Could you make an extra field for measurement delay in the param sweeper? (with default setting of zero) The best and most versatile option :).
- Or add a standard, built in, delay between the next sweep step, and the command to the log system for the measurement. Something like 10% of the log interval would work most of the time. (after all, with slower devices to control one would choose a longer log interval)

It would be a option to synchronize the logging to param sweeper and then I could re-purpose the log timing field when that is checked.
I will take a look at it.

Cases I encountered in the recent past were it would have been helpful to have a delay, to wait until the controlled device was stable:
- Low frequency generator (needed some time for amplitude stabilisation)
- Characterising small solar panels (U, I & P curves vs amount of light, some panels were a bit slow)
- Characterising vactrols (the photo resistors are having a slow response time)
- Measuring  PDVS2 mini linearity curve with a 3458A :) (requires ppm level stability)

I guess that using smaller step size could solve a lot of this.
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4643 on: September 19, 2025, 02:39:26 pm »
When the answer from: #askValues DynamicM1?
is passed to #modeFromValue
how do it get the mode?

And where is your #modeFromValue
I don't know what those should look like. I tried copying #modeFromValue getElement(value,0), but that screws up the value and bounces back and forth between 0 and the actual read value.

The mode is a variable set by a combobox. It's read with:
Code: [Select]
#scpiCmd getMeasUnit1? none?
:readmath: meas1Unit

This is the combobox that sets that:
Code: [Select]
#cmdSetup combobox M1_Type Measure
:read: getMeasType1?
:write: MeasType1
:update: M1_Type
:string:
V_Min VMIN
V_Max VMAX
V_PP VPP
V_Base VBASe
V_Top VTOP
V_AMP VAMP
V_Lower VLOWer
V_Upper VUPPer
V_MID VMID
V_AVG VAVG
V_RMS VRMS
V_SD VSDeviation
Pos_Preshoot VPPReshoot
Neg_Preshoot VNPReshoot
Pos_Overshoot VPOVershoot
Neg_Overshoot VNOVershoot
Pos+ VPARea
Neg_Area VNARea
|Area| VAARea
Area VNAArea
Pos_Period_Area VPPArea
Neg_Period_Area VNPArea
|Period_Area| VAPArea
Period_Area VNAPArea
Time_Rise HRTime
Time_Fall HFTime
Period HPERiod
Frequency HFReq
Pos_Width HHWidth
Neg_Width HLWidth
Pos_Duty HHDuty
Neg_Duty HLDuty
Pos_Edge_Count RECount
Neg_Edge_Count FECount
Pos_Pulse_Count PPCount
Neg_Pulse_Count NPCount
:tip: Select measurement type


Quote
#askMode will change mode when the "Mode" commands are used, this sends it own command to get the mode.
#modeFromValue will change mode at any time (Except when logging is in progress), this derivatives its mode #askValues and you must supply the expression to do that.
I have no idea how to do this. I tried different ways.

It seems that I need to combine the set mode variable with a deviceRead of the scope response, but this seems like extra processing? The scope response is only a number value, no other information.

Is it possible to read a variable from #modeFromValue directly? Maybe we need a #modFromVariable option? ;)

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4644 on: September 19, 2025, 03:03:35 pm »
I have no idea how to do this. I tried different ways.

You can do this:
#askValues DynamicM1?;getMeasUnit1?

Then you can use
#askValuesReadFormat  or #askModeMathFormat to only read the values with #askValues

In #modeFromValue you need an expression to isolate the mode from the answer.


 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4645 on: September 19, 2025, 03:18:47 pm »
I have no idea how to do this. I tried different ways.

You can do this:
#askValues DynamicM1?;getMeasUnit1?

Then you can use
#askValuesReadFormat  or #askModeMathFormat to only read the values with #askValues

In #modeFromValue you need an expression to isolate the mode from the answer.
I'll try and figure that out. Will it be a problem that there are 5 combos?

Code: [Select]
#askValues DynamicM1?;getMeasUnit1?;DynamicM2?;getMeasUnit2?;DynamicM3?;getMeasUnit3?;DynamicM4?;getMeasUnit4?;DynamicM5?;getMeasUnit5?;

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4646 on: September 19, 2025, 03:25:29 pm »
I'll try and figure that out. Will it be a problem that there are 5 combos?

Code: [Select]
#askValues DynamicM1?;getMeasUnit1?;DynamicM2?;getMeasUnit2?;DynamicM3?;getMeasUnit3?;DynamicM4?;getMeasUnit4?;DynamicM5?;getMeasUnit5?;

No and you can do either as above, or you can get all measurement first and then all units, which way is only relevant for your filtering them.

A
#askValuesReadFormat f x f x f x f x f x
or
#askValuesReadFormat f f f f f x x x x x
If probably all the filtering you need for #askValues


 
The following users thanked this post: KungFuJosh

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4647 on: September 19, 2025, 04:37:48 pm »
No and you can do either as above, or you can get all measurement first and then all units, which way is only relevant for your filtering them.

A
#askValuesReadFormat f x f x f x f x f x
or
#askValuesReadFormat f f f f f x x x x x
If probably all the filtering you need for #askValues

Thank you, that part makes sense now. For testing, I've now limited it to 1 measurement combo.

In #modeFromValue you need an expression to isolate the mode from the answer.

I'm still having trouble isolating the mode though. Here's the log:
Code: [Select]
;; Magnova: Tx <DynamicM1?>
;; Magnova: Script start
;; Magnova: Tx <:MEAS:HFReq:CURR? CHAN1>
;; IP: Tx: <:MEAS:HFReq:CURR? CHAN1.> 3A 4D 45 41 53 3A 48 46 52 65 71 3A 43 55 52 52 3F 20 43 48 41 4E 31 0A
;; IP: Rx: <1000.0130079817> 31 30 30 30 2E 30 31 33 30 30 37 39 38 31 37 0A
;; Magnova: Rx <1000.0130079817>
;; Magnova: Script end <1000.0130079817>
;; Magnova: Rx <1000.0130079817>
;; Magnova: Tx <getMeasUnit1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <Hz>
;; Magnova: Rx as numbers <1000.0130079817>

Here's the code:
Code: [Select]
#askMode getMeasUnit1?
#askValues DynamicM1?;getMeasUnit1?
#askValuesReadFormat fx
#modeFromValue getElement(value,0);

I've tried different values there, and it doesn't work. I assume I'm using the wrong expression to get the mode. Anything besides value,0 there makes the current value line disappear completely.

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

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3904
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #4648 on: September 19, 2025, 05:55:27 pm »
#askMode getMeasUnit1?
#modeFromValue getElement(value,0);

I've tried different values there, and it doesn't work. I assume I'm using the wrong expression to get the mode. Anything besides value,0 there makes the current value line disappear completely.

getElement(value,0) will return the first value, i.e. the measurement, try getElement(value,1);
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #4649 on: September 19, 2025, 06:18:09 pm »
#askMode getMeasUnit1?
#modeFromValue getElement(value,0);

I've tried different values there, and it doesn't work. I assume I'm using the wrong expression to get the mode. Anything besides value,0 there makes the current value line disappear completely.

getElement(value,0) will return the first value, i.e. the measurement, try getElement(value,1);

I tried, but anything besides value,0 breaks it.
Code:
Code: [Select]
#askMode getMeasUnit1?
#askValues DynamicM1?;getMeasUnit1?
#askValuesReadFormat fx
#askModeMathFormat getElement(value,1);
#modeFromValue getElement(value,1);

Here's an example log:
Code: [Select]
;; Magnova: Tx <getMeasUnit1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <V>
;; Magnova: Rx after :readmath: getElement(value,1); <>
;; Magnova: Tx <DynamicM1?>
;; Magnova: Script start
;; Magnova: Tx <:MEAS:VPP:CURR? CHAN1>
;; IP: Tx: <:MEAS:VPP:CURR? CHAN1.> 3A 4D 45 41 53 3A 56 50 50 3A 43 55 52 52 3F 20 43 48 41 4E 31 0A
;; IP: Rx: <0.6193875> 30 2E 36 31 39 33 38 37 35 0A
;; Magnova: Rx <0.6193875>
;; Magnova: Script end <0.6193875>
;; Magnova: Rx <0.6193875>
;; Magnova: Tx <getMeasUnit1?>
;; Magnova: Tx <none?>
;; Magnova: Rx <V>
;; Magnova: Rx as numbers <0.6193875>
Thread for Magnova
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "this.lastModeAnswer" is null
        at dk.hkj.main.DeviceInterface.getValuesFromDevices(DeviceInterface.java:408)
        at dk.hkj.devices.DeviceSCPI.getValuesFromDevices(DeviceSCPI.java:99)
        at dk.hkj.main.InterfaceThreads$DeviceThread.run(InterfaceThreads.java:1632)

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf