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

0 Members and 5 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1975 on: October 17, 2021, 09:39:24 pm »
Is there a way of passing through a raw string with the #askValuesReadFormat function? I'm currently using uuuu, I am trying to grab all 4 fields to see both of the modes as a row value (can it even do that?)

I am able to now at least see MOST of the returned values, but anything with a symbol is failing, IE values with Ω (or some mangled up version of it) are failing.

You can get raw data with some of the functions in the SCPIx driver. In the last version I posted (V1.88) the s format works (In the example above I used the answer string you showed and it worked nicely). The #getValues can only handle numeric data.
If you do not find a matching charset, you can use the replace() function to replace the strange characters (Mostly the micro symbol) with something more sensible.

If you can start TestController from the command line you can add a debug option to it (Check the .bat file), then it will show all received data in hex and also how it process them.

Can you add (or does it already have an undocumented) a regex filter to #askValuesReadFormat so it will only return [0-9], commas, and the decimal place (and maybe any SI units)?, so it can remove any other junk chars and fix the formatting.

Something like getMatch(value,"[0-9.+-]+") qualifies for that.
« Last Edit: October 17, 2021, 09:43:11 pm by HKJ »
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1976 on: October 17, 2021, 10:01:43 pm »
progress...

using
Code: [Select]
#value data SI
#askValuesReadFormat s
#askModeMathFormat getMatch(getElement(value,0),"[0-9.+-]+")

is at least giving me value for all modes now, hopefully I can now get the rest done now LOL.
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1977 on: October 17, 2021, 10:14:44 pm »
is at least giving me value for all modes now, hopefully I can now get the rest done now LOL.

The example I posted a few posts back gave both values and selected columns with the correct units. I programmed some of you strings into a Arduino for testing it.
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1978 on: October 18, 2021, 12:39:54 am »
Well, for whatever reason the selectors on the values are not working (it was like this the entire time, so it didn't break), I rewrote my code to use the ones you gave in your example Cs, Cp,Zs etc. but the values do not appear in the current values list unless I remove the selector from it, which obviously means the units/modes are not correctly shown, and likely means I am missing something and doing something dumb.

Code: [Select]
#cmdMode Ls Ls
FUNC:IMP:A L;FUNC:IMP:EQU SERial;

#cmdMode Lp Lp
FUNC:IMP:A L;FUNC:IMP:EQU PALlel;

#cmdMode Cs Cs
FUNC:IMP:A C;FUNC:IMP:EQU SERial;

#cmdMode Cp Cp
FUNC:IMP:A C;FUNC:IMP:EQU PALlel;

#cmdMode ECs ECs
FUNC:IMP:A ECAP;FUNC:IMP:EQU SERial;



#cmdMode Rs Rs
FUNC:IMP:A R;FUNC:IMP:EQU SERial;

#cmdMode Rp Rp
FUNC:IMP:A R;FUNC:IMP:EQU PALlel;

#cmdMode Zs Zs
FUNC:IMP:A Z;FUNC:IMP:EQU SERial;

#cmdMode Zp Zp
FUNC:IMP:A Z;FUNC:IMP:EQU PALlel;

#cmdMode DCR DCR
FUNC:IMP:A DCR



#cmdMode ESR ESR
FUNC:IMP:B ESR;[400];

#cmdMode D D
FUNC:IMP:B D;[400];

#cmdMode X X
FUNC:IMP:B X;[400];

#cmdMode Q Q
FUNC:IMP:B Q;[400];

; this one might need the handle changing, as the meter returns this: ¦È for the phase symbol
#cmdMode Angle Deg
FUNC:IMP:B THR;[400];

This is what else I am using:
Code: [Select]
#value Capacity_P F SI Cp
#value Capacity_S F SI Cs,ECs
#value Inductance H SI Ls,Lp
#value Impedance ohm SI Zs,Zp,Rs,Rp
#value ESR ohm SI ESR
#value Impedance ohm SI X


#askValuesReadFormat xsxs

#askModeMathFormat getMatch(getElement(value,1),"[0-9.+-FH]+")+getMatch(getElement(value,3),"[0-9.+-FH]+")


I tried using #modeFromValue getElement(value,0)+";"+getElement(value,2) but for whatever reason on a couple of mode it resulted in the returned readings flickering on/off a few times a second, as thought it was only seeing every other reading, I have commented that back out for the time being, as my current issue is the selector for #value not working.

Another interesting issue is that despite sending two commands at once to set the mode and series/parallel modes, the second command is being ignored by the meter, I tried using various [400] delays between the commands etc. but that didn't work, I went from [1] up to [2000] without any change, BUT if I send two commands together from the tc window instead it works, responding to the first command, then the second command shows up and the second response shows up.

I am also seeing an odd behavour with this meter where sometimes it ignores commands completely, so I have to push the button again, sometimes more than once.

This is connected via USB, in case that is of consequence.
« Last Edit: October 18, 2021, 05:56:52 am by TheDefpom »
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1979 on: October 18, 2021, 06:02:19 am »
Well, for whatever reason the selectors on the values are not working (it was like this the entire time, so it didn't break)

If you are using this line:

Code: [Select]
#askModeMathFormat getMatch(getElement(value,1),"[0-9.+-FH]+")+getMatch(getElement(value,3),"[0-9.+-FH]+")

I am not surprised. It uses the values instead of the range as selectors.

I tried using #modeFromValue getElement(value,0)+";"+getElement(value,2) but for whatever reason on a couple of mode it resulted in the returned readings flickering on/off a few times a second, as thought it was only seeing every other reading, I have commented that back out for the time being, as my current issue is the selector for #value not working.

For #modeFromValue to work it must have exactly the same parameters as #askModeMathFormat or you will get the flickering.
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1980 on: October 18, 2021, 08:47:05 am »
Attached is my current version for the ET4401/ET4402/ET4410, so far I cannot get the modes to select the #value, I have been trying lots of different things, some of the code attempts are still in the file.

Maybe take a look and try to work out what stupid thing I am doing wrong! This file is returning values in the current format, although I'm not sure they are exactly correct as things like the F of uF and H in uH in the values is missing, so they just show as u or m.

Maybe anyone with an East Tester ET4401 or ET4402 or ET4410 could try this file out and see how it works for them, it should work on all three models, once I have this file working properly I will also do a modified version to allow for the ET4501, ET4502 and ET4510 variants which are very similar.
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1981 on: October 18, 2021, 09:05:12 am »

Code: [Select]
; THIS ONE WORKS
#askModeMathFormat getMatch(getElement(value,1),"[a-zA-Z0-9.+-]")+getMatch(getElement(value,3),"[a-zA-Z0-9.+-]")

No, it do not, it is a check of mode, but it read the numeric values, you have to use (The ; makes it two simultaneous modes):
#askModeMathFormat getElement(value,0)+";"+getElement(value,2)
#modeFromValue getElement(value,0)+";"+getElement(value,2)

You cannot get any mode change to work before this is correct.
Use:
=deviceMode("ET4401")
On the command line to see your actual mode string that TC uses.

Getting the values from the answer is done nicely by:
#askValuesReadFormat xsxs

It do not need any help from a
#askValuesMathFormat    <-- Note this starts with askValue, not askMode

 
The following users thanked this post: TheDefpom

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1982 on: October 18, 2021, 09:24:05 am »
Maybe take a look and try to work out what stupid thing I am doing wrong! This file is returning values in the current format, although I'm not sure they are exactly correct as things like the F of uF and H in uH in the values is missing, so they just show as u or m.

I forgot to comment on this.

Only the SI prefix is included in the value, the unit (F/H/ohm) is the unit and is supposed to be part of the column information.
 
The following users thanked this post: TheDefpom

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1983 on: October 18, 2021, 09:53:45 am »
When you get the columns working, you will hit another snag with the different readouts: They do not track.

To fix this I am working on a dual readout for GridPanel that will track the two first channels on a device:


 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1984 on: October 18, 2021, 09:03:44 pm »
I am pretty sure I am battling poor behaviour of this meters communication system, (you cant send it two commands one directly after the other as the second is ignored)

I cant get rid of the flickering readings in the current values display, and I cant get that to display the 2nd value with a selector, if I put an empty selector at the end of the values list then I will get a reading from that one.

I am getting "C,X" from the command line check for example, and yet only the C will be selected, the X is not, but even then it is with flickering readings, if I comment out the #modefromvalues the flickering goes away but the selector breaks.

This meter is driving me nuts.

If I give up on trying to read the modes at all I can get both readings out of it, it just doesn't know what they are referenced to.

Interestingly commenting out the #askmodemathformat has absolutely no effect on any of this, I can try it with and without it, and it makes no difference.

I am really at the point of giving up with this thing and just accepting that the current values won't have a mode.
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1985 on: October 19, 2021, 01:05:50 am »
Attached is my initial release for the ET4401, ET4402, ET4410, ET4501, ET4502 and ET4510, it has only been tested on the ET4401 but should work on all the others too.

It isn't perfect, but it is 99% there.

It shows the primary function OK, but the 2nd function "Angle" is not being linked to a mode, it is readable however.

File is named: East Tester ET4xxx to reflect that it should work on the entire series.
« Last Edit: October 19, 2021, 06:30:52 am by TheDefpom »
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1986 on: October 19, 2021, 04:47:17 am »
Attached is my initial release for the ET4401, ET4402, ET4410, ET4501, ET4502 and ET4510, it has only been tested on the ET4401 but should work on all the others too.

It isn't perfect, but it is 99% there.

It shows the primary function OK, but the 2nd function is not being linked to a mode, it is readable however, it just isn't flagged as to what it is doing, IE ESR,D,Q,X,Angle.

File is named: East Tester ET4xxx to reflect that it should work on the entire series.

Change #askMode :FUNC:IMP:A?;
To:
Code: [Select]
#askMode :FETC?
#askModeMathFormat getElement(value,0)+";"+getElement(value,2)
#modeFromValue getElement(value,0)+";"+getElement(value,2)
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1987 on: October 19, 2021, 05:08:06 am »
It is replacing the first mode name with the 2nd function name (but still showing the first functions readings), commenting out #modefromvalue (leaving #askmodemathformat on) has no effect on how this is working, in case that is s clue.

If I comment out the fallback #value 2nd I don't get a 2nd reading at all, so its not that causing a clash.

This meter is rather frustrating to deal with... when I first starting writing the definition for it, it was going really well, within a couple of hours I was controlling everything... reading it was another story!
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1988 on: October 19, 2021, 05:24:45 am »
It is replacing the first mode name with the 2nd function name (but still showing the first functions readings), commenting out #modefromvalue (leaving #askmodemathformat on) has no effect on how this is working, in case that is s clue.

If I comment out the fallback #value 2nd I don't get a 2nd reading at all, so its not that causing a clash.

I programmed these into a Arduino:
Cs,-8pF,ESR,-539.8M¦¸
Ls,-5.369MH,ESR,--OL--
Zs,--OL--,ESR,--OL--
Cp,0pF,X,58.64M¦¸
Cs,102nF,X,0.87¦¸
And they works with the above specification (Reply #1972)

You could try making a simple test definition (You will have to move your real definition out of the directory):
Code: [Select]
#idString ZC,ET4401
#name Zc ET4401
#handle ET4401
#port comfixedbaud
#baudrate 115200

#value Capacity_P F SI Cp
#value Capacity_S F SI Cs
#value Inductance H SI Ls,Lp
#value ESR ohm SI ESR
#value Impedance ohm SI X
#value Impedance ohm SI Zs

#askValues :FETC?
#askValuesReadFormat xsxs

#askMode :FETC?
#askModeMathFormat getElement(value,0)+";"+getElement(value,2)
#modeFromValue getElement(value,0)+";"+getElement(value,2)

With this you will have to change mode from the command line, but if it works you can put it into your real definition.
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1989 on: October 19, 2021, 05:51:54 am »
OK, your code did work, I forgot to change the modes to include the series/parallel flag, it is now FINALLY working !

Almost.

When in the phase/angle 2nd mode the symbol is not being handled, I think the vertical bar is a representation of a shift/alt keybress, followed by the special E char, I haven't been able to figure out how to detect that.

That (I think) would be the last problem to solve.

Code: [Select]
fetc?
;; Ls,-816.80uH,¦È,-81.61deg
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1990 on: October 19, 2021, 06:03:44 am »
When in the phase/angle 2nd mode the symbol is not being handled, I think the vertical bar is a representation of a shift/alt keybress, followed by the special E char, I haven't been able to figure out how to detect that.

That (I think) would be the last problem to solve.

Code: [Select]
fetc?
;; Ls,-816.80uH,¦È,-81.61deg

Use the replace function:

Code: [Select]
getElement(value,0)+";"+replace(getElement(value,2),"¦È","phi");

You will probably also have to do one for u on the #askValues


When using special characters in the file, it is best if you have a way to secure the file includes a BOM mark. This is something your editor must do. If you cannot do it, I need to now exactly what character it is (Just now is see an E with a forward mark and one with a backward mark) and I can add the BOM mark to the file.
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1991 on: October 19, 2021, 06:23:57 am »
I don't know what the char actually is, I have tried copying and pasting it from the command window after doing a fetc? but that didn't help.

I have this set as the last selector (apart from the fallback one), none of those are matching (THR is the 2nd mode selection flag)

#value Angle Deg D2 phi THR ¦È È

I pasted the letter into google, heres the wiki page: https://en.wikipedia.org/wiki/È
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1992 on: October 19, 2021, 06:40:21 am »
I don't know what the char actually is, I have tried copying and pasting it from the command window after doing a fetc? but that didn't help.

I have this set as the last selector (apart from the fallback one), none of those are matching (THR is the 2nd mode selection flag)

#value Angle Deg D2 phi THR ¦È È

I pasted the letter into google, heres the wiki page: https://en.wikipedia.org/wiki/È

That is not a valid specification, you have to use:
#value Angle Deg D2 phi,THR,¦È,È

But it is best to not keep the È by using the replace function to change it. The definition is more readable that way.

i.e.
#value Angle Deg D2 phi,THR

and then use the replace() on #askModeMathFormat and #modeFromValue

 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1993 on: October 19, 2021, 06:56:15 am »
I updated to last file I uploaded a few posts ago, that is the latest version with everything apart from the angle working (I kept the same Rev number)
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1994 on: October 19, 2021, 07:08:09 am »
I updated to last file I uploaded a few posts ago, that is the latest version with everything apart from the angle working (I kept the same Rev number)

#value is still missing a comma

Try measuring a uF or uH component, I will expect that it will show wrong values, because the µ will not be returned as a µ symbol.
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1995 on: October 19, 2021, 07:16:36 am »
The meter outputs a u not a mu symbol, so that is working ok.
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1996 on: October 19, 2021, 09:48:35 am »
The ¦È is a bit tricky, the easiest way is to use debug mode and pick the hex codes from there. Playing a bit around with the Arduino, I got this:

I tried to look at some charset table and got this (Using hex codes also removes the requirement for a BOM):

#askModeMathFormat getElement(value,0)+";"+replace(getElement(value,2),"\xa6\xc8","PHI");
#modeFromValue getElement(value,0)+";"+replace(getElement(value,2),"\xa6\xc8","PHI");

And changed the #value to

#value Angle Deg D2 PHI,THR

In debug mode (Command: java -jar TestController debugtime=2) TestController shows this for #askMode:
;; 1664.44ms ET4401: Tx <:FETC?>
;; 1665.68ms COM19: Tx: <:FETC?.> 3A 46 45 54 43 3F 0A
;; 1665.74ms COM19: Rx: <Cs,111nF,¦È,0.10¦¸> 43 73 2C 31 31 31 6E 46 2C A6 C8 2C 30 2E 31 30 C2 A6 C2 B8
;; 1665.78ms ET4401: Rx <Cs,111nF,¦È,0.10¦¸>
;; 1673.26ms ET4401: Rx after :readmath: getElement(value,0)+";"+replace(getElement(value,2),"\xa6\xc8","PHI"); <Cs;PHI>


 
The following users thanked this post: TheDefpom

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1997 on: October 19, 2021, 07:55:50 pm »
Nice one, that worked.

Everything is now working correctly.

Final version for the East Tester ET4401, ET4402, ET4410, ET4501, ET4502, ET4510 is attached.
« Last Edit: October 19, 2021, 08:16:54 pm by TheDefpom »
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1998 on: October 19, 2021, 08:10:04 pm »
Nice one, that worked.

Everything is now working correctly.

Final version for the East Tester ET4401, ET4402, ET4410, ET4501, ET4502, ET4510 is attached.

Just one detail: You have used Zc as name, not east tester? I suppose I can change that to East Tester (And leave the id string as Zc)?
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 707
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #1999 on: October 19, 2021, 08:17:54 pm »
Good point.

I have just fixed the file, download the file from the last post again.
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf