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

0 Members and 1 Guest are viewing this topic.

Offline Bad_Driver

  • Regular Contributor
  • *
  • Posts: 96
  • Country: de
Re: Program that can log from many multimeters.
« Reply #1250 on: October 27, 2020, 03:40:05 pm »
Thanks for your advice! I will work on it. I understood the point with the "=>"
B.D.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1251 on: October 27, 2020, 04:29:42 pm »
I am not sure my advice is correct, it will only work if the => prompt is followed by a newline and prompts are usually not.
I may have to add functions to handle a prompt.
 

Offline Bad_Driver

  • Regular Contributor
  • *
  • Posts: 96
  • Country: de
Re: Program that can log from many multimeters.
« Reply #1252 on: October 28, 2020, 09:19:07 am »
I have done a Hex-Terminal.
The prompt is always finished with 0DH 0AH (CR/LF). So I try your advice during the next days.
Thanks again!

B.D.
 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1253 on: October 28, 2020, 12:37:34 pm »
@hkj Here's a minute of data https://justpaste.it/9jk97 from the DL24 device during load testing a battery. This was taken with 115200bps. This one is taken with 9600bps  https://justpaste.it/6s5w4
« Last Edit: October 28, 2020, 12:47:48 pm by dirkwim07 »
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1254 on: October 28, 2020, 01:46:03 pm »
V1.40 is up
This is mostly extension to charting and it only works from scripts.
V1.40
   Added: #removePromptChars to SCPIx driver
   Added: ATorch USB, general support for USB protocol, may later be change to one or more model names
   Added: ATorch AT3010 AC energy meter for panel mounting
   Added: ATorch DL24P DC load
   Changed: Bar drawing on histogram, they will now be plain when more than 100 bins are used.
   Added: Values popup to histogram
   Fixed: Missing header when saving histogram, header will only be used for one histogram, not for two or tree.
   Added: #chartAnnotate add lines, arrows and text to a chart.
   Added: #chartScaleSync makes it possible to share a scale between multiple curves
   Added: #chartBackground customize colors for the different elements in the chart.
   Added: #chartColors customize a new set of curve colors
   Added: #chartScaleName change the displayed scale name on the chart



I used this script to generate the above (From already loaded data):
#chartTitle "Not file name as title"
#chartBackground aquamarine honeydew blue sandybrown red
#chartcurves VRG.Ramp VSG_1.Sine VSG_2.Sine
#chartScaleSync VRG.Ramp VSG_1.Sine VSG_2.Sine
#CHARTCOLORS (255,0,0) (240,120,0) (240,0,120)
#CHARTSCALENAME VRG.Ramp Ramp
#CHARTSCALENAME VSG_1.Sine "Fast sine"
#CHARTSCALENAME VSG_2.Sine "Slow sine"
#chartannotate line 0 0 130 0 blue 1
#chartannotate line 0 7 130 7 yellow 1 "...   "
#chartannotate line 0 -7 130 -7 yellow 1 "...   "
#chartannotate arrow "End of first ramp" 30 0 60 darkolivegreen 2
#chartannotate text "Advanced chart demonstration" lb 2 9  green 2 white
#saveChart aa.png

I was asked about a cursor in histogram mode, it is possible now with a value popup:


The Atorch functions is not really tested and according to dirkwim07 I need to change the type of serial port. When I get some more feedback on ATorch I will adjust the definition.
 
The following users thanked this post: tubularnut, dirkwim07

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1255 on: October 28, 2020, 06:42:10 pm »
I have done a Hex-Terminal.
The prompt is always finished with 0DH 0AH (CR/LF). So I try your advice during the next days.

With the SCPIx driver you can now use #removePromptChars
Using "#removePromptChars 4" will remove 4 characters, i.e. it will include CR LF.
And then you do not need to redefine anything and it will probably also work with GPIB.
 

Offline Bad_Driver

  • Regular Contributor
  • *
  • Posts: 96
  • Country: de
Re: Program that can log from many multimeters.
« Reply #1256 on: October 29, 2020, 08:03:29 am »
I have done a Hex-Terminal.
The prompt is always finished with 0DH 0AH (CR/LF). So I try your advice during the next days.

With the SCPIx driver you can now use #removePromptChars
Using "#removePromptChars 4" will remove 4 characters, i.e. it will include CR LF.
And then you do not need to redefine anything and it will probably also work with GPIB.

Hi HKJ

again thanks for the new release and your advices! Yesterday I tested your txrx2 - hint and it works!
But the new functionality "removePromptChars" looks good and I will check it, unfortunately I'm a litte bit short of time these days.

best regards B.D.
 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1257 on: October 29, 2020, 11:57:46 am »
cool that you've added the Atarch.

here you can see the data https://imgur.com/a/OygmSzl

Voltage and Current readings are fine, but the power and energy are not coming in.

What could I change in order to try to get the right values? And would I be able to change the voltage to 3 decimals and add the Capicity and Timing from the device?

Code: [Select]
#metaSection DC_DEVICE
#subDriver DC
#value Voltage V D1
#value Current A D3
#value Power W D1
#value Energy Wh D2

#askValues values?

; Format of answer: f=float, u=remove trailing letters, x=skip, *=Zero upper case values if this value is 0
#askValuesReadFormat ffffxxxx


#interfacetype Power
#interface readVoltage 0
#interface readCurrent 1
#interface readPower 2
#interface readEnergy 3


#cmdSetup buttons Reset
:write: tx
Wh 1
Ah 2
Time 3
All 5

#cmdSetup numberInt Backlight
:read: backlightTimer?
:write: tx 0x21
sec 0 255

 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1258 on: October 29, 2020, 12:10:14 pm »
#value Voltage V D1
#value Current A D3
#value Power W D1
#value Energy Wh D2

These lines control available columns and decimals, but there is no point in adding more decimals, the data I receive do not contain them.

#askValuesReadFormat ffffxxxx
This line control what to include, each f is a value and x is a ignored part. If you add more f you must also and more #value lines, they must match.


Try testing until Ah & Wh values are 1 or more and see if anything shows up.
Note: TC can calculate these values and do not really need them.

 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1259 on: October 29, 2020, 02:24:47 pm »
Ill try :)

two questions. I've posted you hex data, is that something I also could translate to figure out what data it contain? and I editied the atarch txt file but the changes are not applied. Does test-controller store it's settings in register? I already tried removing the program and installing again but no change
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1260 on: October 29, 2020, 03:18:53 pm »
two questions. I've posted you hex data, is that something I also could translate to figure out what data it contain?

Yes, somebody posted a link that shows the format: https://github.com/NiceLabs/atorch-console/blob/master/docs/protocol-design.md

and I editied the atarch txt file but the changes are not applied. Does test-controller store it's settings in register? I already tried removing the program and installing again but no change

Nothing is save in secret locations, but the definitions are only loaded on program start, i.e. you have to restart the program after doing changes.

Note: The Atorch definition is 4 definitions in one file, you have to modify the correct one.

Starting TC in debug mode will give a lot of output, but may help with understanding how it works.
 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1261 on: October 29, 2020, 06:14:30 pm »
But how does your program translate the hex data FF551103310000000001 to #askValuesReadFormat ffffxffxx
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1262 on: October 29, 2020, 06:25:00 pm »
But how does your program translate the hex data FF551103310000000001 to #askValuesReadFormat ffffxffxx

The internal driver has a table off offsets, size and division factor for the different elements, using this it will convert the hex string to a couple of numbers.
The #askValuesReadFormat is then used to pick the interesting values.
 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1263 on: October 29, 2020, 06:43:08 pm »
Sorry for so many questions :) but how could I edit the driver? I've already extracted testcontroller.jar but now the challenge is to find the file. And which program should I need for editing? I have a bit of programlanguage understanding so maybe Im able to edit some
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1264 on: October 29, 2020, 07:02:40 pm »
Sorry for so many questions :) but how could I edit the driver? I've already extracted testcontroller.jar but now the challenge is to find the file. And which program should I need for editing? I have a bit of programlanguage understanding so maybe Im able to edit some

You cannot edit the driver, only the definitions.
If the DL24P codes the bytes another way, you just have to post a list and I will add it to the next version of TC
 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1265 on: October 29, 2020, 07:32:58 pm »
I've checked the data from #metaSection DCLOAD_DEVICE in TestController.
The data which I can show in TC is Voltage, Current, Seconds and Capacity. I've tried al the ffffxxx combinations.

This page https://github.com/NiceLabs/atorch-console/blob/master/docs/protocol-design.md shows the following data.

Could it be that the definitions are a bit off? I don't know which list I should send or how to get it? Hope that it's possible to show data with more decimals.

DC Meter Report

Offset   Field   Block size   Note
03   Device Type   1 byte   01 Device Type
04   Voltage   3 byte   24 bit BE (divide by 10)
07   Amp   3 byte   24 bit BE (divide by 1000)
0A   Watt   3 byte   24 bit BE (divide by 10)
0D   W·h   4 byte   32 bit BE (divide by 100)
11   Price (per kW·h)   3 byte   24 bit BE (divide by 100)
14      4 byte   unknown value
18   Temperature   2 byte   16 bit BE
1A   Hour   2 byte   16 bit BE
1C   Minute   1 byte   
1D   Second   1 byte   
1E   Backlight   1 byte   
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1266 on: October 29, 2020, 07:39:49 pm »

This page https://github.com/NiceLabs/atorch-console/blob/master/docs/protocol-design.md shows the following data.

Could it be that the definitions are a bit off?

All the 3 lists are already implemented in TC and selected with the "#subDriver" specification, but if you select a wrong list TC will not accept it (The protocol includes a id code for the list used).

I do not know if the definitions are fully correct, I am a little bit suspicious about the Ah and Wh values. The location is probably correct, but the factors may be wrong.

I believe the DC specifications are for a DC power meter, but here it is reused for a DC load and I wonder if there are some differences.
 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1267 on: October 29, 2020, 08:07:59 pm »
Mmh, then I think I cant help any further. Can send more hex codes from this device but I think we need information from the maker of the software behind this device
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1268 on: October 29, 2020, 08:13:10 pm »
Mmh, then I think I cant help any further. Can send more hex codes from this device but I think we need information from the maker of the software behind this device

Hex codes and a photo of the display when there is above 1Ah & 1Wh on it would be a good help.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1269 on: October 29, 2020, 11:47:40 pm »
Hi HKJ,

The Tektronix scope device file I made is not working properly for some of the models (MDO3xxx, DPO3xxx).  Specifically, logging of the 5 measurements ends up as
   Measurement 1:   OK
   Measurement 2:   ends up with measurement 3 number
   Measurement 3:   always 0.0000
   Measurement 4:   always 0
   Measurement 5:   always 0
This device file works fine for multiple other Tektronix scope families and the SCPI documentation for all of them is the same.  To investigate the issue I did some dos window debug traces while connected to a working scope and to a not working one.
Code: [Select]
;; Found Tektronix MDO3024 TekScope on 192.168.1.46 sn: C021804
;; Found Tektronix DPO3034 TekScope on 192.168.1.181 sn: C013387
;; OscTek_4: Tx <MEASUREMENT:MEAS1:VALUE?>
;; OscTek_87: Tx <MEASUREMENT:MEAS1:VALUE?>
;; OscTek_4: Rx <:MEASUREMENT:MEAS1:VALUE 38.7249E-3>
;; OscTek_4: Tx <MEASUREMENT:MEAS2:VALUE?>
;; OscTek_4: Rx <:MEASUREMENT:MEAS2:VALUE -126.2936>
;; OscTek_4: Tx <MEASUREMENT:MEAS3:VALUE?>
;; OscTek_4: Rx <:MEASUREMENT:MEAS3:VALUE 165.7627>
;; OscTek_4: Tx <MEASUREMENT:MEAS4:VALUE?>
;; OscTek_4: Rx <:MEASUREMENT:MEAS4:VALUE 7.0186E-3>
;; OscTek_4: Tx <MEASURE:IMMED:VALUE?>
;; OscTek_4: Rx <:MEASUREMENT:IMMED:VALUE 5.6271E-3>
;; OscTek_4: Rx as numbers <0.0387249 -126.2936 165.7627 0.0070186 0.0056271>
;; OscTek_87: Rx <1.0204E-3
>
;; OscTek_87: Tx <MEASUREMENT:MEAS2:VALUE?>
;; OscTek_87: Rx <57.3830
>
;; OscTek_87: Tx <MEASUREMENT:MEAS3:VALUE?>
;; OscTek_87: Rx <-43.9564
>
;; OscTek_87: Tx <MEASUREMENT:MEAS4:VALUE?>
;; OscTek_87: Rx <2.0977E-3
>
;; OscTek_87: Tx <MEASURE:IMMED:VALUE?>
;; OscTek_87: Rx <1.4246E-3
>
;; OscTek_87: Rx as numbers <57.383 0.0020977>

I note three things about the above:
1.  Working OscTek_4 final log values line has correct 5 numbers while the not working OscTek_87 final log values line only reports two numbers instead of 5.
2.  Not working OscTek_87 individual queries returns all 5 log numbers correctly.  It is just the final collecting of the numbers together step that fails.
3.  Not working OscTek_87 individual queries seems to have an extra CR LF after the number but before the ">" ending delimiter.  No idea if this is a Tektronix or a TestController extra CR LF??

I did a further experiment where I changed the read format line.  The above is the result if the read format line is
   #askValuesReadFormat xFxFxFxFxF
If I change the read format to
   #askValuesReadFormat uFuFuFuFuF
the error switches around.  Now the previously working OscTek_4 does not work and the previously not working OscTek_87 does work.

Do you think there is an error in the "Tektronix MDO MSO DPO TDS.txt" device file or can you think of a simple change to accommodate the difference?

Should I change the device file to use two different #askValuesRead lines depending on scope model number?  If so, then what is the simple way to do this?

Is there a bug in TestController causing the xFxFxFxFxF read string to be assembled wrong for the not working model shown in the debug trace??
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1270 on: October 30, 2020, 07:30:55 am »
;; OscTek_87: Tx <MEASUREMENT:MEAS2:VALUE?>
;; OscTek_87: Rx <57.3830
>
;; OscTek_87: Tx <MEASUREMENT:MEAS3:VALUE?>
;; OscTek_87: Rx <-43.9564
>

You can rid of the extra CR  LF with some :readmath:
replace(replace(value,"\r",""),"\n","");

A shorter version may be enough:
replace(value,"\r\n","");


I did a further experiment where I changed the read format line.  The above is the result if the read format line is
   #askValuesReadFormat xFxFxFxFxF
If I change the read format to
   #askValuesReadFormat uFuFuFuFuF
the error switches around.  Now the previously working OscTek_4 does not work and the previously not working OscTek_87 does work.

What are you doing? x=ignore value, F=parse number, u=parse number with unit after it (like 5V)
Mostly upper and lower case works the same way, only exception is when a * is present in the line.


Should I change the device file to use two different #askValuesRead lines depending on scope model number?  If so, then what is the simple way to do this?

You can use #sections to select between two different definitions.

 

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #1271 on: October 30, 2020, 11:39:42 am »
Hereby a picture and the last minute of the log https://justpaste.it/6g9lj from the dl24p device. If you need a longer log please let me know:)
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1272 on: October 30, 2020, 01:34:21 pm »
Hereby a picture and the last minute of the log https://justpaste.it/6g9lj from the dl24p device. If you need a longer log please let me know:)

Thanks, I cannot find any W, Ah or Wh data in the message, but I wonder why there is some data after the message.
I have added my own W, Ah and Wh calculations to the driver, this means it will now list:



This will be included from next version.
It looks like time and temperature is included in the message.
« Last Edit: October 30, 2020, 01:36:03 pm by HKJ »
 
The following users thanked this post: dirkwim07

Offline gby

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1273 on: October 30, 2020, 01:49:33 pm »
You can rid of the extra CR  LF with some :readmath:
replace(replace(value,"\r",""),"\n","");

A shorter version may be enough:
replace(value,"\r\n","");

These devices are just SCPI so the logging #askValues command is just:
   #askValues MEASUREMENT:MEAS1:VALUE?;MEASUREMENT:MEAS2:VALUE?;MEASUREMENT:MEAS3:VALUE?;MEASUREMENT:MEAS4:VALUE?;MEASURE:IMMED:VALUE?
Are you saying that it is possible to have :readmath: just after this line to remove the 5 extra "\n" and "\r"?  I don't think that would work since the error happens inside the #askValues in that #askValues just returns two numbers like:
   OscTek_87: Rx as numbers <57.383 0.0020977>
and no further processing would get the missing numbers back to my mind.

I did a further experiment where I changed the read format line.  The above is the result if the read format line is
   #askValuesReadFormat xFxFxFxFxF
If I change the read format to
   #askValuesReadFormat uFuFuFuFuF
the error switches around.  Now the previously working OscTek_4 does not work and the previously not working OscTek_87 does work.

What are you doing? x=ignore value, F=parse number, u=parse number with unit after it (like 5V)
Mostly upper and lower case works the same way, only exception is when a * is present in the line.

I admit the #askValuesReadFormats I am using do not all make sense based on their intended functions/definitions.  I just tried experiments and noted results.  I am guessing that the root cause issue is that different scope families return values in different formats:
   MDO3000 (like OscTek_4 in these tests) returns an echo of command ending in the number which needs read format xfxfxfxfxf to remove command echo
   DPO3023 (like OscTek_87 in these tests) returns just the number with an extra \n \r and works with readformat fffff or ufufufufufuf

I will work on having the device file use different #askValuesReadFormat for different devices.  Thanks for the hints.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1274 on: October 30, 2020, 02:04:48 pm »
Are you saying that it is possible to have :readmath: just after this line to remove the 5 extra "\n" and "\r"?  I don't think that would work since the error happens inside the #askValues in that #askValues just returns two numbers like:

Yes, except it is not called :readmath: but #askValuesMathFormat
It will get the string before it is converted to numbers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf