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

0 Members and 1 Guest are viewing this topic.

Offline fenugrec

  • Regular Contributor
  • *
  • Posts: 216
  • Country: ca
Re: Program that can log from many multimeters.
« Reply #2900 on: January 20, 2023, 04:39:15 pm »
To get columns you need something like:
#value VoltageDC V D6

If you add a parameter more it will only be shown when TC knows the device is in that mode and for that the #askMode command must work and return a string with the mode name.

Understood. I already had a few lines like "#value VoltageSet V si V_generate"  , but I have no "#askMode" because there is no way to query the current mode with this instrument... Unless maybe parsing the display string and look for the units character. But it's impossible to guess if it's Measure vs Generate.

Quote
I will recommend that you start TC in debug mode

I tried, but the tc.log file only contains "Starting" and nothing else, no matter what I do. Even running without the stderr redirect ">tc.log 2>&1" , I get nothing after that "Starting" entry.

Quote
The simple method is to use a # for the value, but to get SI prefix you need to use scripting:
("command"+formatSI(value)+"unit")

Thanks, I got it working with " #scpiCmd SET:V tx ("K00"+formatSI((value))+"VS") " , for some reason it needed the double (( )) around value.

I also realized that defining a #scpiCmd needs to be in "XX:YY" format ?
Code: [Select]
; this works :
#scpiCmd SET:TCtype tx ....

; this doesn't work :
#scpiCmd set_tctype tx ...
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2901 on: January 20, 2023, 05:17:52 pm »
Understood. I already had a few lines like "#value VoltageSet V si V_generate"  , but I have no "#askMode" because there is no way to query the current mode with this instrument... Unless maybe parsing the display string and look for the units character. But it's impossible to guess if it's Measure vs Generate.

You can remove the 4 parameter for test, then add it again later.
When using #scpiCmd you can store your own mode depending on the commands you send. There is something about it here: https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Defining_commands (It is for another protocol, but works the same for all protocols).

Quote
I will recommend that you start TC in debug mode

I tried, but the tc.log file only contains "Starting" and nothing else, no matter what I do. Even running without the stderr redirect ">tc.log 2>&1" , I get nothing after that "Starting" entry.

Most of the debug info is shown in the log window, all debug info is output to the dos/console screen, but note that some bat files starts TC in another thread.

Quote
The simple method is to use a # for the value, but to get SI prefix you need to use scripting:
("command"+formatSI(value)+"unit")

Thanks, I got it working with " #scpiCmd SET:V tx ("K00"+formatSI((value))+"VS") " , for some reason it needed the double (( )) around value.

I wonder about the double ((, I will do some testing.

I also realized that defining a #scpiCmd needs to be in "XX:YY" format ?
Code: [Select]
; this works :
#scpiCmd SET:TCtype tx ....

; this doesn't work :
#scpiCmd set_tctype tx ...

Underscore has special meaning, it is replaced with a space.
 
The following users thanked this post: fenugrec

Offline fenugrec

  • Regular Contributor
  • *
  • Posts: 216
  • Country: ca
Re: Program that can log from many multimeters.
« Reply #2902 on: January 20, 2023, 08:36:21 pm »
Underscore has special meaning, it is replaced with a space.

Aaah, it was mentioned somewhere in the docs but I didn't think it applied to command names too.

With your pointers I've been able to cobble up a functional implemention, published here :
https://github.com/fenugrec/xitron_tools/blob/master/hkj_testcontroller/Xitron2000.txt

Have you considered maintaining a git repo just for device files, to make it easier to track changes / contribute ?

E.g. the file I made could be included as-is in your distribution, but I will change some minor things as I begin using it... and others may want to add features I haven't needed yet, etc.

Other topic : I just learned indirectly that you can do conditionals like
Code: [Select]
:readmath: countMatch(value, "STBY")==1? "S":"O"
I had previously looked for such a thing in the docs but couldn't find anything, is it documented somewhere?

Thanks again for your assistance !

[edit : typo]
« Last Edit: January 21, 2023, 02:07:46 pm by fenugrec »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2903 on: January 21, 2023, 11:12:31 am »
With your pointers I've been able to cobble up a functional implemention, published here :
https://github.com/fenugrec/xitron_tools/blob/master/hkj_testcontroller/Xitron2000.txt

Have you considered maintaining a git repo just for device files, to make it easier to track changes / contribute ?

E.g. the file I made could be included as-is in your distribution, but I will change some minor things as I being using it... and others may want to add features I haven't needed yet, etc.

Attach the file to a post in this thread and I will include it in the next release and if you post an update I will update the included version.

Other topic : I just learned indirectly that you can do conditionals like
Code: [Select]
:readmath: countMatch(value, "STBY")==1? "S":"O"
I had previously looked for such a thing in the docs but couldn't find anything, is it documented somewhere?

The main document for calculations is this: https://lygte-info.dk/project/TestControllerFunctions%20UK.html, I do not really get into details about expression syntax, but it is similar to Java and C.


The actual code used for calculation is a separate project/library, that can considerable more than included in the TC documentation, I have started on a more comprehensive documentation here: http://lygte-info.dk/project/Calculator%20UK.html
It is made so that any project that uses it can easily add its own functions and variables, in additions to the ones included in the library.



Looking in your definition I found this comment:
Quote
we would like something like a regex [ ]?(.*)[ um][VACF].*

If you use #askValuesMathFormat you have access to functions that uses regex.
The driver AsciiBlock uses regex directly https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Ascii_variable_length_communication_blocks,_can_be_multi_line_ascii_(AsciiBlock)

 

Offline Hydron

  • Frequent Contributor
  • **
  • Posts: 985
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #2904 on: January 23, 2023, 07:35:44 pm »
If it is related to the 100NPLC setting then other users may not have seen it often (you'd have to set the meter to 100NPLC before trying to connect, though that is a totally valid setting with a stock meter!).

Note that TestController also gets confused when it asks a 34401A what mode it's in and gets "TEMP" as a reply :P
Might need to make some additions to the definition for the "enhanced" 34401A, maybe call it 34401A+ or something?
(for those who didn't see the thread, later 34401A FW revisions support a few hidden features such as settings-recall on boot and temperature measurement, with razvan784 finally finding the magic incantations for closed-case unlock here: https://www.eevblog.com/forum/testgear/hp-agilent-34401a-hidden-menu/msg4559242/#msg4559242 - ONLY try these on FW 07-xx-yy and later though, at least until you have an EEPROM backup or read the rest of the thread!)

You are welcome to extend the definition and add a enhanced meter to it, please post the result here.

To add temperature you need to add these two lines to the definition:

#value Temperature C d1 Temperature
#cmdMode Temperature TEMP
CONF:TEMP;[500]

And
#remove #cmdMode Temperature
to the two existing #metadef sections, to avoid a temperature selection in the current meters.

and make a copy if one of the current #metadef section and change the name to the enhanced model.


I do not know if CONF:TEMP; if correct.


Note: Two people has worked on this definition and neither has said anything about connect problems due to meter outputting data.
See attached updated definition, I've called it "HP/Agilent 34401A Enhanced", added some notes (for that option only) and a lot of stuff into the Temperature setup page.
Missing is the option to use custom NPLC settings via the custom aperture time option - this is doable via SCPI but a bit tricky (see note here: https://www.eevblog.com/forum/testgear/hp-agilent-34401a-hidden-menu/msg4657129/#msg4657129) and would have made things pretty complicated given that custom NPLC settings don't work directly, so would have to be done via (line frequency dependant) explicit aperture time settings. I figure if someone really needs this they can add it themselves or just use the command entry box.

Finally I'm having problems with text rendering, both in general (very poor text quality on graph axes - note this is with 125% hidpi mode in windows which might not help) and specifically when using "special" characters like the Omega for Ohms and the degrees symbol for Celcius. Weirdly it seems to work for the DMM6500 device but not the 34401A, and I can't see any reason for the difference. See attached screenshot of the Chart showing both problems (the "°C" thing happens also in the current values section and popup dialogues).
« Last Edit: January 23, 2023, 07:37:16 pm by Hydron »
 

Offline jmurray

  • Contributor
  • Posts: 32
  • Country: au
Re: Program that can log from many multimeters.
« Reply #2905 on: January 26, 2023, 01:32:33 am »
The "Out of memory error" is probably the reason for it running slow. My best guess is that you call some scripts recursively.
Try using #runscript without parameters, this is possible as long as you run your main script in background (#RUNSCRIPTASYNC).

None of my scripts are called recursively, but your suggestion did give me the idea to investigate potential variable scoping issues.  Sure enough, a couple of my "child" scripts implicitly used a parent script's iterator variable instead of defining their own locally scoped iterator variable.  It looks something like this:

Code: [Select]
#scriptScript MyParentScript

=var i = 0;
; iterate through an array using i...
#runScript MyChildScript1
; do some other things...
#runScript MyChildScript2
#return

;-------------------------------------------------------------
#scriptScript MyChildScript1
=i = 0;
; iterate through some other array using i...

; note that I failed to actually declare "i" here using "=var i = 0;" and TC doesn't complain about it,
; so MyChildScript must be using the "i" declared in MyParentScript above and, consequently,
; this script merely redefines "i" here.
#return

;-------------------------------------------------------------
#scriptScript MyChildScript2
=i = 0;
; iterate through yet another array using i...

; note the same issue with variable scoping as in MyChildScript1
#return

Once I corrected my variable scoping mistakes in a couple scripts, everything suddenly behaves properly and the whole script runs flawlessly.  Cheers!


@HKJ
Is there a way to declare and call subroutines within a script, or is saving them as external scripts the best method?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2906 on: January 26, 2023, 08:01:40 am »
See attached updated definition, I've called it "HP/Agilent 34401A Enhanced", added some notes (for that option only) and a lot of stuff into the Temperature setup page.

Thanks, it will be included in the next release.


Finally I'm having problems with text rendering, both in general (very poor text quality on graph axes - note this is with 125% hidpi mode in windows which might not help) and specifically when using "special" characters like the Omega for Ohms and the degrees symbol for Celcius. Weirdly it seems to work for the DMM6500 device but not the 34401A, and I can't see any reason for the difference. See attached screenshot of the Chart showing both problems (the "°C" thing happens also in the current values section and popup dialogues).

TestController requires a BOM on UTF files to handle the characters correctly, I have added it.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2907 on: January 26, 2023, 08:21:05 am »
@HKJ
Is there a way to declare and call subroutines within a script, or is saving them as external scripts the best method?

The short answer is that the script do not support declaring subroutines.
But there are many other ways to do it:
In the menu scripts you can use the heading #scriptScript header to make a hidden callable script. Check ...\Documents\TestController\Settings\ScriptLibrary.dat for examples.

You can store a script in a string and use executeEmbeddedString().
Or you can create a user defined function addFuncEmbedded() or addFuncEmbeddedGlobal()
There is a little bit of documentation here: http://lygte-info.dk/project/Calculator%20UK.html#List_vars_&_functions
Newest version of TC support triple quotes to make this easier, i.e. """ multiline text """;

Generally local variables from the calling script will be available, but it is more controlled to use parameters.
 

Offline jmurray

  • Contributor
  • Posts: 32
  • Country: au
Re: Program that can log from many multimeters.
« Reply #2908 on: February 01, 2023, 08:03:16 am »
FYI I found a bug in the date() function.

When providing a date to be encoded, it adds two months to the date.

Code: [Select]
=date(2023,02,01,16,05,00)
;; 20230401160500
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2909 on: February 02, 2023, 08:19:34 am »
FYI I found a bug in the date() function.

When providing a date to be encoded, it adds two months to the date.

Code: [Select]
=date(2023,02,01,16,05,00)
;; 20230401160500

Thanks, it will be fixed in the next version.
As a temporary solution you can subtract 2 from the month until then.
 

Offline Hydron

  • Frequent Contributor
  • **
  • Posts: 985
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #2910 on: February 07, 2023, 10:35:38 pm »
Quick question about the Tenma 72-13210 (aka Korad KEL103) UDP network connection option - it doesn't seem to work on my Windows 10 machine (gives up connecting immediately, says "starting thread" and then "stopping thread" in the debug console), but does on a Linux laptop I tried. I tried running wireshark and nothing seems to be sent to the device at all by TestController when I tell it to try and connect. Is there anything I need to do to get it going on Windows? Cheers!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2911 on: February 08, 2023, 12:48:53 pm »
Quick question about the Tenma 72-13210 (aka Korad KEL103) UDP network connection option - it doesn't seem to work on my Windows 10 machine (gives up connecting immediately, says "starting thread" and then "stopping thread" in the debug console), but does on a Linux laptop I tried. I tried running wireshark and nothing seems to be sent to the device at all by TestController when I tell it to try and connect. Is there anything I need to do to get it going on Windows? Cheers!

I found the problem and it will be fixed in next release.
If you have a version from before v1.31 you can use that version until then.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2912 on: February 10, 2023, 09:48:28 am »
V2.34 is up
Only small fixes and additions
   Fixed: Some interfaces failed due to the PortType variable added.
   Added: HP34401A enhanced mode (A crack that can be applied to some firmware versions) (Thanks Hydron)
   Fixed: Log Event could fail to open with some devices.
   Added: Marking of devices on "Current Values" and "Range" page can be configured.
   Added: control indicator & indicatorInt now support the :update: tag, this will be used when the status is changed.
   Modified: Variable for control indicator & indicatorInt to include 4 fields.
   Updated: ET5410A+ (Thanks PL)
   Modified: New definitions for East Tester LCR meter (They have Alt in their name) for never firmware versions (Thanks Steve)

There is one new configuration setting that can be interesting, it is based on a question from Messtechniker, not exactly what he asked for, but I hope it is close to what he wanted.




It works for both "Current Values" and "Range" pages.

 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Program that can log from many multimeters.
« Reply #2913 on: February 10, 2023, 06:15:57 pm »
Great! Thanks.




Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter
 
The following users thanked this post: Oleksii

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2914 on: February 10, 2023, 07:15:31 pm »
Great! Thanks.

You may want to use a UTF BOM to mark the codepage for the definition file.

I generally try to do what people want, not what they ask for.
A rant:
This is not restricted to TC, but is generally what I do in my work. I know that in most places you have to follow a specification, but the (small) companies I have worked for I could do it my way, only issue was to kick the sales person out of the loop and talk directly with the customer and understand what they want. In some cases it means spending a day at the customer site to observe and understanding the procedures.
For TC it is fairly easy, because I try to match what I perceive as the best solution for my needs, mostly (That is my conclusion based on this thread) this align perfectly with the needs of other engineers.
 

Offline Hexley

  • Regular Contributor
  • *
  • Posts: 197
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2915 on: February 14, 2023, 06:53:37 pm »
A revised device file for the GW Instek GPP-4323 is available.
This is compatible with the response to "*idn?", which changed in the latest firmware for the GPP-4323 (1.19).
 

Offline Hydron

  • Frequent Contributor
  • **
  • Posts: 985
  • Country: gb
Re: Program that can log from many multimeters.
« Reply #2916 on: February 14, 2023, 10:49:34 pm »
A revised device file for the GW Instek GPP-4323 is available.
This is compatible with the response to "*idn?", which changed in the latest firmware for the GPP-4323 (1.19).
Anything worthwhile changed in the new FW? Looks like you need a login to download it >:(.
 

Offline Hexley

  • Regular Contributor
  • *
  • Posts: 197
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2917 on: February 15, 2023, 01:53:34 am »
A revised device file for the GW Instek GPP-4323 is available.
This is compatible with the response to "*idn?", which changed in the latest firmware for the GPP-4323 (1.19).
Anything worthwhile changed in the new FW? Looks like you need a login to download it >:(.
No visible difference that I could see. For some reason Instek does not provide release notes, so there is no way to know what the changes were.
 

Offline mvanocht

  • Contributor
  • Posts: 10
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2918 on: February 24, 2023, 03:24:57 pm »
Do you plan to add support for the HP 82357A USB to GPIB Converter?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2919 on: March 07, 2023, 09:05:46 am »
Do you plan to add support for the HP 82357A USB to GPIB Converter?

Sorry, I missed this question.
No, I do not plan on adding that converter, TC mostly works with serial and network connected equipment.
For a cheap GPIB converter look for the AR488, it is a small Arduino and a GPIB connector.
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3244
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2920 on: March 13, 2023, 02:51:30 pm »
We've finally got our Tonghui TH2830 to respond to serial RS-232 and return measurement readings (was returning all zeros) after numerous email exchanges with CS, turns out the NULL FIXTURE in the TOOLS menu needs to be OFF.

Now the task ahead is to try and include this LCR meter within so we can generate Impedance vs Frequency Plots for various components. Has anyone been successful getting the TH2830 or other Tonghui product working, or maybe other LCR meters?

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline motato

  • Newbie
  • Posts: 2
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2921 on: March 13, 2023, 05:16:31 pm »
First off, thank you HKJ for making TC available to the community.

I am new to the forum and to this generation of logging multimeters. Still wrapping my head around TC scripting and configuration options.

macOS 12.6, x86_64. Brymen 869s, 869-PA firmware, USB.

Anyone having success getting TC to work with this combination? TC appears to recognize the meter, but cannot seem to record data. Tried Java 1.8 (Oracle) and 11.0 (Temurin OpenJDK).

Code: [Select]
;; Found Brymen BM869s on HIDv0820p0001
;; BM869: Rx as numbers <No data (timeout?)>
;; BM869: Rx as numbers <No data (timeout?)>
;; BM869: Rx as numbers <No data (timeout?)>

Table has timestamps, but no data.

Is "Mode not found" relevant?
Code: [Select]
tom% java -jar TestController.jar
Starting
Mode not found

Browsing to certain parts the app consistently triggers SIGABRT or SIGILL, so far all from the hid4java/JNI layer. For what it's worth, sigrok-cli does return data.

Any suggestions or hints? I'm happy to help with debugging (have EE background and several years *NIX development, less so Windows and Mac).
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2922 on: March 13, 2023, 06:08:30 pm »
First off, thank you HKJ for making TC available to the community.

I am new to the forum and to this generation of logging multimeters. Still wrapping my head around TC scripting and configuration options.

macOS 12.6, x86_64. Brymen 869s, 869-PA firmware, USB.

That meter uses USB HID interface and I only have some support for that on Windows, if you run TC from a Windows emulator you might be able to connect.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2923 on: March 13, 2023, 06:12:47 pm »
We've finally got our Tonghui TH2830 to respond to serial RS-232 and return measurement readings (was returning all zeros) after numerous email exchanges with CS, turns out the NULL FIXTURE in the TOOLS menu needs to be OFF.

Now the task ahead is to try and include this LCR meter within so we can generate Impedance vs Frequency Plots for various components. Has anyone been successful getting the TH2830 or other Tonghui product working, or maybe other LCR meters?

Check the files "Ruoshui VC409xx + East Tester ET4xxx (Alt).txt" and "East Tester ET4xxx.txt" they have definitions for LCR meters.
 

Offline motato

  • Newbie
  • Posts: 2
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2924 on: March 15, 2023, 05:10:55 pm »
Thank you. Unfortunate to need the resources of an entire OS or VM for one app, but I also completely understand.

I see in the About section "Uses hid4Jave to scan for HID devices (Could not get reading to work)," so sounds like the "can't read" behavior is not entirely unexpected. If I can find/make time, maybe I can dig into why hid4java won't work, or maybe look into http://usb4java.org/

Anyone have luck attempting to run TC on Mac using Wine? I made a quick effort to run the Brymen app in Wine, but it didn't even get to the point of recognizing the device.

Thanks again.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf