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

TylerPeppy, virage and 224 Guests are viewing this topic.

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5025 on: October 19, 2025, 04:08:16 pm »
I setup the advCombobox with the inlist, but the variable isn't working with it. I'm using TC V2.85.

I have a command in my initCmd to set the variable, and it works. I also have a command to test the variable:
Code: [Select]
#scpiCmd getActiveChans? none?
:readmath: CHsOn

Result of that command:
Code: [Select]
getActiveChans?
;; Magnova: Tx <getActiveChans?>
;; Magnova: Tx <none?>
;; Magnova: Rx <YNNN>
;; YNNN

We can see CHsOn exists and works, but TC still doesn't like it when I try to load Setup:
Code: [Select]
Exception in thread "AWT-EventQueue-0" dk.hkj.script.ProgramExceptions$UnknownException: Variable not found CHsOn
inList(CHsOn,____<----____"YNNN")
        at dk.hkj.script.Script.getVar(Script.java:83)
        at dk.hkj.script.Script.parseValue(Script.java:291)
        at dk.hkj.script.Script.parseBitOp(Script.java:326)
        at dk.hkj.script.Script.parseProduct(Script.java:398)
        at dk.hkj.script.Script.parseSum(Script.java:480)
        at dk.hkj.script.Script.parseCompare(Script.java:535)
        at dk.hkj.script.Script.parseLogical(Script.java:571)
        at dk.hkj.script.Script.parseQuestionMark(Script.java:597)
        at dk.hkj.script.Script.parseExpression(Script.java:622)
        at dk.hkj.script.Script.parseParamList(Script.java:133)
        at dk.hkj.script.Script.parseValue(Script.java:277)
        at dk.hkj.script.Script.parseBitOp(Script.java:326)
        at dk.hkj.script.Script.parseProduct(Script.java:398)
        at dk.hkj.script.Script.parseSum(Script.java:480)
        at dk.hkj.script.Script.parseCompare(Script.java:535)
        at dk.hkj.script.Script.parseLogical(Script.java:571)
        at dk.hkj.script.Script.parseQuestionMark(Script.java:597)
        at dk.hkj.script.Script.parseExpression(Script.java:622)
        at dk.hkj.script.Script.expression(Script.java:1230)
        at dk.hkj.devices.SetupFormats$AdvComboboxField.enableItems(SetupFormats.java:4386)
        at dk.hkj.devices.SetupFormats$AdvComboboxField.addGridBag(SetupFormats.java:4422)
        at dk.hkj.main.PopupSetupSelection.makePanel(PopupSetupSelection.java:246)
        at dk.hkj.main.PopupSetupSelection.makeMainPanel(PopupSetupSelection.java:163)
        at dk.hkj.main.PopupSetupSelection.<init>(PopupSetupSelection.java:95)
        at dk.hkj.main.DeviceInterface.showSetupPopup(DeviceInterface.java:802)
        at dk.hkj.main.PaneCommand.showSetupSelectionPopup(PaneCommand.java:1993)
        at dk.hkj.main.PaneCommand$38.actionPerformed(PaneCommand.java:1048)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2314)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:407)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
        at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
        at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:299)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6576)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3404)
        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)

Here's a piece of the advCombobox:
Code: [Select]
#cmdSetup advCombobox Memory_Depth Main
:read: :ACQ:MDEP?
:write: :ACQ:MDEP
:update: Memory_Depth
:string:
Auto blue - - - AUTo
Auto_Fast blue - - - AFASt
5k gray - inList(CHsOn,"YYYN YYYY NYYY NNYY") - 5000
10k - - inList(CHsOn,"YYNN NNNY NNYN NYNN") - 10000
12.5k gray - inList(CHsOn,"YYYN YYYY NYYY NNYY") - 12500

Thanks,
Josh
« Last Edit: October 19, 2025, 04:32:08 pm 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: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5026 on: October 19, 2025, 04:08:55 pm »
I know and that is nasty coding, a device is not supposed to do stuff to other devices popups!

A little nastiness is okay sometimes. ;) ;)

ETA: I gueeeess you could add a 2nd version of the SyncPopups command that would be device specific if you want. But, realistically, if I go and physically modify 3 devices on my workbench, it doesn't make me sad that I only need to click one button to sync them all (is that from Lord of the Rings?).
« Last Edit: October 19, 2025, 04:12:35 pm by KungFuJosh »
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5027 on: October 19, 2025, 04:15:53 pm »
I know and that is nasty coding, a device is not supposed to do stuff to other devices popups!

A little nastiness is okay sometimes. ;) ;)

ETA: I gueeeess you could add a 2nd version of the SyncPopups command that would be device specific if you want. But, realistically, if I go and physically modify 3 devices on my workbench, it doesn't make me sad that I only need to click one button to sync them all (is that from Lord of the Rings?).

I could, but I do not see a need for it. You may not even know the correct handle for the your device (TC can change them).

Put adding a extra # statement in the definition to always update all control on mode change is fairly simple (I hope) and can be useful for some devices.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5028 on: October 19, 2025, 04:23:25 pm »
I could, but I do not see a need for it. You may not even know the correct handle for the your device (TC can change them).

Put adding a extra # statement in the definition to always update all control on mode change is fairly simple (I hope) and can be useful for some devices.

I don't really see a need for it either; I'm fine with the version I posted. I don't know if the button will be used that much, and it doesn't bother me that it updates all open popups. Hell, what if I forgot to update a different device, and the popup was outdated? ;)

This device doesn't currently have any mode buttons either.

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5029 on: October 19, 2025, 04:28:26 pm »
I could, but I do not see a need for it. You may not even know the correct handle for the your device (TC can change them).

Put adding a extra # statement in the definition to always update all control on mode change is fairly simple (I hope) and can be useful for some devices.

I don't really see a need for it either; I'm fine with the version I posted. I don't know if the button will be used that much, and it doesn't bother me that it updates all open popups. Hell, what if I forgot to update a different device, and the popup was outdated? ;)

This device doesn't currently have any mode buttons either.

The command is used when TC generates a script to change settings in a device, that will not change a open popup.
TC collect all commands you send from menus and it has a option to turn them into a script.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5030 on: October 19, 2025, 04:31:41 pm »
Fair enough.

Did you see the issue in reply #5025? The variable isn't working with the advCombobox yet.

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: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5031 on: October 19, 2025, 05:09:38 pm »
Could you explain how a :updatemodechange: is related to logging ?

Is this because logging performs an askMode before logging starts?

And is this maybe the reason that logging does not start since all the updates take to much time? Maybe in v2.77 this was more relaxed and no more strict?

« Last Edit: October 19, 2025, 07:10:03 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5032 on: October 19, 2025, 05:10:12 pm »
Fair enough.

Did you see the issue in reply #5025? The variable isn't working with the advCombobox yet.

Strange, it did in my test.
Try adding the getVarList(2)
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5033 on: October 19, 2025, 05:11:55 pm »
Could you explain how a :updatemodechange: is related to logging ?

It is not supposed to be.

Is this because logging performs an askMode before logging starts?

And is this maybe the reason that logging does not start since all the updates take to much time? Maybe in v2.74 this was more relaxed and no more strict?

I wonder if the problem is one update, triggers another update and it takes a lot of time, due to all the updates.
 

Offline flash2b

  • Frequent Contributor
  • **
  • Posts: 938
  • Country: nl
  • Everything I like about myself is better with you.
Re: Program that can log/control many multimeters and other devices.
« Reply #5034 on: October 19, 2025, 05:27:02 pm »
If there is a full refresh on mode change option, I will update my definitions so they can be part of a next release.

My setup menu renders in less than a second and I do not have an advanced laptop.

I wonder if the problem is one update, triggers another update and it takes a lot of time, due to all the updates.

It is nothing special, just a "Active Mode: Volt DC" and a radio button "200 V"  (assuming Volt DC mode)
« Last Edit: October 19, 2025, 06:25:08 pm by flash2b »
They say attention is a shovel. It's time to dig 'em out.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5035 on: October 19, 2025, 05:47:33 pm »
Fair enough.

Did you see the issue in reply #5025? The variable isn't working with the advCombobox yet.

Strange, it did in my test.
Try adding the getVarList(2)

I added that. It also wouldn't allow the cmdSetup dialog to pop up. Here's the error:
Code: [Select]
Exception in thread "AWT-EventQueue-0" dk.hkj.vars.VarExceptions$ConversionException:  could not be converted to boolean
        at dk.hkj.vars.Support.stringToBoolean(Support.java:104)
        at dk.hkj.vars.VarValueString.asBoolean(VarValueString.java:39)
        at dk.hkj.vars.Var.asBoolean(Var.java:205)
        at dk.hkj.devices.SetupFormats$AdvComboboxField.enableItems(SetupFormats.java:4386)
        at dk.hkj.devices.SetupFormats$AdvComboboxField.addGridBag(SetupFormats.java:4422)
        at dk.hkj.main.PopupSetupSelection.makePanel(PopupSetupSelection.java:246)
        at dk.hkj.main.PopupSetupSelection.makeMainPanel(PopupSetupSelection.java:163)
        at dk.hkj.main.PopupSetupSelection.<init>(PopupSetupSelection.java:95)
        at dk.hkj.main.DeviceInterface.showSetupPopup(DeviceInterface.java:802)
        at dk.hkj.main.PaneCommand.showSetupSelectionPopup(PaneCommand.java:1993)
        at dk.hkj.main.PaneCommand$38.actionPerformed(PaneCommand.java:1048)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2314)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:407)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
        at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
        at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:299)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6576)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3404)
        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)
;; Magnova: Tx <:SYST:THER:STAT?>
Tx input: :SYST:THER:STAT?
;; IP: Tx: <:SYST:THER:STAT?.> 3A 53 59 53 54 3A 54 48 45 52 3A 53 54 41 54 3F 0A
;; IP: Rx: <STABle> 53 54 41 42 6C 65 0A
Rx after processing: STABle
;; Magnova: Rx <STABle>
;; Magnova: Rx after :readmath: replace(replace(replace(value,"COLD","Cold"),"WUP","Warming Up"),"STABle","Stable") <Stable>
;; Magnova: Tx <:ACQ:RCL?>
Tx input: :ACQ:RCL?
;; IP: Tx: <:ACQ:RCL?.> 3A 41 43 51 3A 52 43 4C 3F 0A
;; IP: Rx: <EXTernal> 45 58 54 65 72 6E 61 6C 0A
Rx after processing: EXTernal
;; Magnova: Rx <EXTernal>
;; Magnova: Rx after :readmath: replace(replace(value,"INT","Int"),"EXT","Ext") <External>
;; Magnova: Tx <:ACQ:HRES?>
Tx input: :ACQ:HRES?
;; IP: Tx: <:ACQ:HRES?.> 3A 41 43 51 3A 48 52 45 53 3F 0A
;; IP: Rx: <12> 31 32 0A
Rx after processing: 12
;; Magnova: Rx <12>
;; Magnova: Tx <:ACQ:MDEP?>
Tx input: :ACQ:MDEP?
;; IP: Tx: <:ACQ:MDEP?.> 3A 41 43 51 3A 4D 44 45 50 3F 0A
;; IP: Rx: <327151616> 33 32 37 31 35 31 36 31 36 0A
Rx after processing: 327151616
;; Magnova: Rx <327151616>
;; Magnova: Rx after :readmath: replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(value,"AUTo","Auto"),"AFASt","Auto Fast"),"327151616","327.2M"),"327200000","327.2M"),"200000000","200M"),"163575808","164M"),"100000000","100M"),"81787904","82M"),"50000000","50M"),"25000000","25M"),"20000000","20M"),"12500000","12.5M"),"10000000","10M"),"5000000","5M"),"2500000","2.5M"),"2000000","2M"),"1250000","1.25M"),"1000000","1M"),"500000","500k"),"250000","250k"),"200000","200k"),"125000","125k"),"100000","100k"),"50000","50k"),"25000","25k"),"20000","20k"),"12500","12.5k"),"10000","10k"),"5000","5k")); <327.2M>
;; Magnova: Tx <:ACQ:BAND?>
Tx input: :ACQ:BAND?
;; IP: Tx: <:ACQ:BAND?.> 3A 41 43 51 3A 42 41 4E 44 3F 0A
;; IP: Rx: <350000000> 33 35 30 30 30 30 30 30 30 0A
Rx after processing: 350000000
;; Magnova: Rx <350000000>
;; Magnova: Tx <:ACQ:SRAT?>
Tx input: :ACQ:SRAT?
;; IP: Tx: <:ACQ:SRAT?.> 3A 41 43 51 3A 53 52 41 54 3F 0A
;; IP: Rx: <1600000000> 31 36 30 30 30 30 30 30 30 30 0A
Rx after processing: 1600000000
;; Magnova: Rx <1600000000>
;; Magnova: Tx <*IDN?>
Tx input: *IDN?
;; IP: Tx: <*IDN?.> 2A 49 44 4E 3F 0A
;; IP: Rx: <Batronix,Magnova,serial,1.6.6> 42 61 74 72 6F 6E 69 78 2C 4D 61 67 6E 6F 76 61 2C 30 30 31 32 31 36 2C 31 2E 36 2E 36 0A
Rx after processing: Batronix,Magnova,serial,1.6.6
;; Magnova: Rx <Batronix,Magnova,serial,1.6.6>
;; Magnova: Rx after :readmath: ""+getElement(value,3, ",")"; <1.6.6>
;; Magnova: Cache Tx: <:ACQ:HRES?> Rx: <12>
;; Magnova: Tx <:ACQ:MODE?>
Tx input: :ACQ:MODE?
;; IP: Tx: <:ACQ:MODE?.> 3A 41 43 51 3A 4D 4F 44 45 3F 0A
;; IP: Rx: <SAMPle> 53 41 4D 50 6C 65 0A
Rx after processing: SAMPle
;; Magnova: Rx <SAMPle>
;; Magnova: Rx after :readmath: getElement("SAMP,PDET,AVER",listIndex(value,"Sample,Peak_Detect,Average")); <SAMP>
Exception in thread "AWT-EventQueue-0" dk.hkj.vars.VarExceptions$ConversionException:  could not be converted to boolean
        at dk.hkj.vars.Support.stringToBoolean(Support.java:104)
        at dk.hkj.vars.VarValueString.asBoolean(VarValueString.java:39)
        at dk.hkj.vars.Var.asBoolean(Var.java:205)
        at dk.hkj.devices.SetupFormats$AdvComboboxField.enableItems(SetupFormats.java:4386)
        at dk.hkj.devices.SetupFormats$AdvComboboxField.syncValue(SetupFormats.java:4489)
        at dk.hkj.devices.SetupFormats.syncAll(SetupFormats.java:374)
        at dk.hkj.main.PopupSetupSelection.initialSync(PopupSetupSelection.java:124)
        at dk.hkj.main.PopupSetupSelection.timerUpdate(PopupSetupSelection.java:131)
        at dk.hkj.main.PopupSetupSelection.access$3(PopupSetupSelection.java:129)
        at dk.hkj.main.PopupSetupSelection$3.actionPerformed(PopupSetupSelection.java:88)
        at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:289)
        at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:221)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:323)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
        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)

getVarList(0) and getVarList(1) also stop cmdSetup from running now, but they do give a list of their respective variables in the debug log.

For this test I reduced the command to just this:
Code: [Select]
#cmdSetup advCombobox Memory_Depth Main
:read: :ACQ:MDEP?
:write: :ACQ:MDEP
:update: Memory_Depth
:string:
Auto blue - getVarList(2) - AUTo
Auto_Fast blue - - - AFASt
:tip: Enter desired memory depth. Note: values are restricted to active channel configurations.

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5036 on: October 19, 2025, 06:22:06 pm »
I added that. It also wouldn't allow the cmdSetup dialog to pop up. Here's the error:

You have to pack it into:
return0(printLog(getVarList(2)))
to avoid the error and get a printout on the log.
 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5037 on: October 19, 2025, 06:51:11 pm »
I added that. It also wouldn't allow the cmdSetup dialog to pop up. Here's the error:

You have to pack it into:
return0(printLog(getVarList(2)))
to avoid the error and get a printout on the log.

Oops. Mindless copy/paste struck again. ;)

That got rid of the error, and setup works, but no variables show at all for VarList 2. Switching to return0(printLog(getVarList(1))) does show the expected variables for VarList 1, also correct if I change it to 0.

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5038 on: October 19, 2025, 07:13:49 pm »
That got rid of the error, and setup works, but no variables show at all for VarList 2. Switching to return0(printLog(getVarList(1))) does show the expected variables for VarList 1, also correct if I change it to 0.

But it works, I have tested it.

Wait a minute.....It works in the hot version, not in the regular version, oops!

Please try the hot. I have fixed it in the regular, but not uploaded anything yet.

 
The following users thanked this post: KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5039 on: October 19, 2025, 07:36:22 pm »
Wait a minute.....It works in the hot version, not in the regular version, oops!

Please try the hot. I have fixed it in the regular, but not uploaded anything yet.

It works!

Only thing is the inList requires commas, not spaces: inList(CHsOn,"YYNN,NNNY,NNYN,NYNN")

Now to finish adding the options I forgot.  ::)

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5040 on: October 19, 2025, 07:49:00 pm »
Only thing is the inList requires commas, not spaces: inList(CHsOn,"YYNN,NNNY,NNYN,NYNN")

Inlist accept space comma semicolon and vertical bar as delimiter according to documentation and code.
In the code it directly specifies: String deli = "[|,; ]+";
If there is a 3. parameter it will override this default value.
It ignores upper/lower case differences.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5041 on: October 19, 2025, 07:52:58 pm »
I had it with spaces instead of commas, and it ignored everything after the first option. I changed it to commas, and now it works 100%. 🤷

Here's what's probably complete for the options:
Code: [Select]
5k gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 5000
10k - - inList(CHsOn,"YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 10000
12.5k gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 12500
20k - - inList(CHsOn,"YNNN") - 20000
25k gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 25000
50k - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 50000
100k - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 100000
125k gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 125000
200k - - inList(CHsOn,"YNNN") - 200000
250k gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 250000
500k - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 500000
1M - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 1000000
1.2M gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 1250000
2M - - inList(CHsOn,"YNNN") - 2000000
2.5M gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 2500000
5M - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 5000000
10M - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 10000000
12.5M gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 12500000
20M - - inList(CHsOn,"YNNN") - 20000000
25M gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 25000000
50M - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 50000000
82M gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 81787904
100M - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 100000000
164M gray - inList(CHsOn,"YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 163575808
200M - - inList(CHsOn,"YNNN") - 200000000
327.2M - - inList(CHsOn,"YNNN") - 327151616

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5042 on: October 19, 2025, 08:01:46 pm »
I had it with spaces instead of commas, and it ignored everything after the first option. I changed it to commas, and now it works 100%. 🤷

I tried this on the command line:
=inList("YNYN","YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY")
and it worked.

My best guess is that you have som TAB characters instead of spaces. I have added that to the code now
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5043 on: October 19, 2025, 08:04:57 pm »
I had it with spaces instead of commas, and it ignored everything after the first option. I changed it to commas, and now it works 100%. 🤷

I tried this on the command line:
=inList("YNYN","YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY")
and it worked.

My best guess is that you have som TAB characters instead of spaces. I have added that to the code now

No, just regular old spaces. ;) But I did notice one difference: you have the list name in quotes, whereas I have it without quotes as:
inList(CHsOn,"variables,variables")

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5044 on: October 19, 2025, 08:10:59 pm »
I tried this on the command line:
=inList("YNYN","YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY")
and it worked.

My best guess is that you have som TAB characters instead of spaces. I have added that to the code now

No, just regular old spaces. ;) But I did notice one difference: you have the list name in quotes, whereas I have it without quotes as:
inList(CHsOn,"variables,variables")

I am using the string directly, not a var, that is the reason for the quotes.
I could have used:
=var value="YNYN";
=inList(value,"YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY")
it would be the same result.

Some editors will automatically optimize lines with TAB characters, personally I do not like that, because tab do not have a fixed column definition, it can vary with settings and programs.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5045 on: October 19, 2025, 08:18:18 pm »
I am using the string directly, not a var, that is the reason for the quotes.
I could have used:
=var value="YNYN";
=inList(value,"YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY")
it would be the same result.

Some editors will automatically optimize lines with TAB characters, personally I do not like that, because tab do not have a fixed column definition, it can vary with settings and programs.

I edit in Notepad++. It doesn't mess with me. ;)

What you posted works, but it doesn't seem like the command line is too useful for testing this. If it can't read the real predefined variable (CHsOn), it's not really telling us enough. See attached.

Anyway, it doesn't really matter in this case as it works fine with commas.

Thanks,
Josh
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5046 on: October 19, 2025, 08:27:27 pm »
I edit in Notepad++. It doesn't mess with me. ;)

I know about that editor, I uses EditPadPro, but have not updated in a long time.

What you posted works, but it doesn't seem like the command line is too useful for testing this. If it can't read the real predefined variable (CHsOn), it's not really telling us enough. See attached.

The command line is fine for testing on, but it cannot access any device related vars and there is also a few device related functions it cannot see.
You can invoke the script language two ways from the command line:
1) Start a line with =
2) Type #calc and hit enter, then the command line will switch to calculator/programming script mode, until it sees a # at the start of the line (It is still only working line based, i.e. a multi line statement is not possible).

Anyway, it doesn't really matter in this case as it works fine with commas.
That is correct, but I do not believe your statement about it not working. Something else must be wrong.
 

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5047 on: October 19, 2025, 08:51:17 pm »
That is correct, but I do not believe your statement about it not working. Something else must be wrong.

Here it is with commas:
Code: [Select]
#cmdSetup advComboboxHot Memory_Depth Main
:read: :ACQ:MDEP?
:write: :ACQ:MDEP
:update: Memory_Depth
:string:
Auto blue - - - AUTo
Auto_Fast blue - - - AFASt
5k gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 5000
10k - - inList(CHsOn,"YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 10000
12.5k gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 12500
20k - - inList(CHsOn,"YNNN") - 20000
25k gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 25000
50k - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 50000
100k - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 100000
125k gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 125000
200k - - inList(CHsOn,"YNNN") - 200000
250k gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 250000
500k - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 500000
1M - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 1000000
1.2M gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 1250000
2M - - inList(CHsOn,"YNNN") - 2000000
2.5M gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 2500000
5M - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 5000000
10M - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 10000000
12.5M gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 12500000
20M - - inList(CHsOn,"YNNN") - 20000000
25M gray - inList(CHsOn,"YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 25000000
50M - - inList(CHsOn,"YNNN,YYNN,YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY,NNNY,NNYN,NYNN,YNYN,YNNY") - 50000000
82M gray - inList(CHsOn,"YYYN,YYYY,NYYY,NYYN,NYNY,YYNY,YNYY,NNYY") - 81787904
100M - - inList(CHsOn,"YNNN,YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 100000000
164M gray - inList(CHsOn,"YYNN,NNNY,NNYN,NYNN,YNYN,YNNY") - 163575808
200M - - inList(CHsOn,"YNNN") - 200000000
327.2M - - inList(CHsOn,"YNNN") - 327151616
:tip: Enter desired memory depth. Note: values are restricted to active channel configurations.

Here it is with spaces:
Code: [Select]
#cmdSetup advComboboxHot Memory_Depth Main
:read: :ACQ:MDEP?
:write: :ACQ:MDEP
:update: Memory_Depth
:string:
Auto blue - - - AUTo
Auto_Fast blue - - - AFASt
5k gray - inList(CHsOn,"YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY") - 5000
10k - - inList(CHsOn,"YYNN NNNY NNYN NYNN YNYN YNNY") - 10000
12.5k gray - inList(CHsOn,"YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY") - 12500
20k - - inList(CHsOn,"YNNN") - 20000
25k gray - inList(CHsOn,"YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 25000
50k - - inList(CHsOn,"YNNN YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 50000
100k - - inList(CHsOn,"YNNN YYNN NNNY NNYN NYNN YNYN YNNY") - 100000
125k gray - inList(CHsOn,"YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY") - 125000
200k - - inList(CHsOn,"YNNN") - 200000
250k gray - inList(CHsOn,"YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 250000
500k - - inList(CHsOn,"YNNN YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 500000
1M - - inList(CHsOn,"YNNN YYNN NNNY NNYN NYNN YNYN YNNY") - 1000000
1.2M gray - inList(CHsOn,"YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY") - 1250000
2M - - inList(CHsOn,"YNNN") - 2000000
2.5M gray - inList(CHsOn,"YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 2500000
5M - - inList(CHsOn,"YNNN YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 5000000
10M - - inList(CHsOn,"YNNN YYNN NNNY NNYN NYNN YNYN YNNY") - 10000000
12.5M gray - inList(CHsOn,"YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY") - 12500000
20M - - inList(CHsOn,"YNNN") - 20000000
25M gray - inList(CHsOn,"YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 25000000
50M - - inList(CHsOn,"YNNN YYNN YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY NNNY NNYN NYNN YNYN YNNY") - 50000000
82M gray - inList(CHsOn,"YYYN YYYY NYYY NYYN NYNY YYNY YNYY NNYY") - 81787904
100M - - inList(CHsOn,"YNNN YYNN NNNY NNYN NYNN YNYN YNNY") - 100000000
164M gray - inList(CHsOn,"YYNN NNNY NNYN NYNN YNYN YNNY") - 163575808
200M - - inList(CHsOn,"YNNN") - 200000000
327.2M - - inList(CHsOn,"YNNN") - 327151616
:tip: Enter desired memory depth. Note: values are restricted to active channel configurations.

It appears that it only likes the solo YNNN (in the instances where it has no other options) when using spaces for this command. None of the options work here when spaces are included. Maybe there's something in the advComboboxHot code that's stopping it from working with spaces?

Thanks,
Josh
« Last Edit: October 20, 2025, 08:15:16 pm by KungFuJosh »
"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: 4776
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5048 on: October 20, 2025, 10:04:05 am »
A new test version is up.
Both adv comboboxes now works with all vars.

To get a full varlist (Excluding global), this expression can be used:
return1(printLog("VarList:\n",getVarList(1),"\n",getVarList(2)))
It can be used anywhere in the definition where a expression is required to see what vars are accessible.

I added a #updateModeChange tag to the definitions, it will override all :updateModeChange: and do a full initialization of the popup instead.
 
The following users thanked this post: flash2b, KungFuJosh

Online KungFuJosh

  • Super Contributor
  • ***
  • Posts: 8194
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5049 on: October 20, 2025, 03:02:08 pm »
The advanced combo boxes both work great for me with commas. Thanks!
« Last Edit: October 20, 2025, 05:09:53 pm by KungFuJosh »
"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