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

0 Members and 2 Guests are viewing this topic.

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1025 on: August 17, 2020, 04:28:19 pm »
My definitions for the HMO1022 scope (USB-virtual comport/RS232 i.e HO720 interface plug-in module) and (USB-virtual com port/LAN i.e. HO732 interface plug-in module) are quite rudimentary and need a bit of polishing and testing at the moment. :palm:
The definitions currently only cover Level and Frequency on channel 1. No popups yet.  :scared: If still interested, I would provide the definitions in a couple of days or so. :phew:

Messtechniker,

You can try using the device file I created for the Siglent scope as a template.

 
The following users thanked this post: Messtechniker

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1026 on: August 17, 2020, 08:08:36 pm »
HKJ,

I have been experimenting using #math as extra log channels and found a couple of difficulties.  I am using the following lines at the beginning of my script:
Code: [Select]
#math
#math RDSineOff - FormulaNU 0 getMatch(deviceRead("AKD1G","FB1.REGRDSineOffset?"),"[-.0-9]+")
#math FtLow - Formula 0 FtLow
#math FB1MPos - FormulaNU 0 getMatch(deviceRead("AKD1G","FB1.MECHPOS?"),"[-.0-9]+")

FtLow is defined in the script as an =globalvar variable before the above.

While running this test script I have to regularly clear a fault in the device.  Unfortunately clearing faults take a long time and blocks communications until the fault clear is done.  For normal #askValues log channels missed points are marked with a ? and keeps on logging.  Unfortunately this short time blocked communications turns the #math extra logging channels off.  Specifically, looking at the Math tab while the script runs the two FormulaNU channels have the enable un-checked and the Source formula turns red.  At that point those channels enter just 0 for the rest of the log.  Having the FormulaNU channels stop means I can't use them.  Can TestController treat the interrupted communications like normal logging channels and enter ? into the log for missed points but continue working? 

After the above happens with the #math channels un-checked and formula turned red if I run the script again, which runs the definitions in the script snippet again, TestController does not re-enable the turned off #math channels.  They still have a red indication in the Source Formula column.  If I just click inside the Source Formula and hit return manually they work.  Why doesn't the script #math re-defining them fix and re-enable them?

Lastly, I noticed a minor bug in deleting math channels.  If you have multiple math channels in the Math tab and select the first/top one, then when you click the delete button the first one disappears.  You can then click delete to remove the second one and so on.  Unfortunately the last one never disappears.  If you start logging it does not log any math channels but the Math tab shows shows the last one that did not delete.  If you close TestController and re-open the Math tab would be empty.  Seems to be an index issue in the display of the math channels after deleting them.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1027 on: August 18, 2020, 05:13:27 am »
While running this test script I have to regularly clear a fault in the device.  Unfortunately clearing faults take a long time and blocks communications until the fault clear is done.  For normal #askValues log channels missed points are marked with a ? and keeps on logging.  Unfortunately this short time blocked communications turns the #math extra logging channels off.  Specifically, looking at the Math tab while the script runs the two FormulaNU channels have the enable un-checked and the Source formula turns red.  At that point those channels enter just 0 for the rest of the log.  Having the FormulaNU channels stop means I can't use them.  Can TestController treat the interrupted communications like normal logging channels and enter ? into the log for missed points but continue working? 

I can add a something to handle this, but the sample rate will probably be reduced when an error occurs (and stay reduced) and I cannot prevent that.


After the above happens with the #math channels un-checked and formula turned red if I run the script again, which runs the definitions in the script snippet again, TestController does not re-enable the turned off #math channels.  They still have a red indication in the Source Formula column.  If I just click inside the Source Formula and hit return manually they work.  Why doesn't the script #math re-defining them fix and re-enable them?

The general assumption is that you need to edit the math to fix the error.


Lastly, I noticed a minor bug in deleting math channels.  If you have multiple math channels in the Math tab and select the first/top one, then when you click the delete button the first one disappears.  You can then click delete to remove the second one and so on.  Unfortunately the last one never disappears.  If you start logging it does not log any math channels but the Math tab shows shows the last one that did not delete.  If you close TestController and re-open the Math tab would be empty.  Seems to be an index issue in the display of the math channels after deleting them.

It is a screen update problem, I will look at it.
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 514
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Program that can log from many multimeters.
« Reply #1028 on: August 18, 2020, 06:53:56 am »
Here we go again with a problem right from the start :palm:
Trying to create a single device file (R&SHMO1022.txt) where both HMO1022 connection types (COM and LAN) will appear as instruments in the search socket list. The ID strings are identical, this probably being the main problem in my case. So that the #metadef and #meta thing will not work.

#idString HAMEG,HMO1022,
#name R&S HMO1022 COM
#handle HMO1022
#port com
#baudrate 9600

and

#idString HAMEG,HMO1022,
#name R&S HMO1022 LAN
#handle HMO1022
#port 5025

work individually in separate definition files but not together. |O

Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Voltcraft VC 940 M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1029 on: August 18, 2020, 07:11:23 am »
Here we go again with a problem right from the start :palm:

Don't bother with metadef, use:

#port 5025 com
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 514
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Program that can log from many multimeters.
« Reply #1030 on: August 18, 2020, 01:00:13 pm »
Works. :-+ But only after having accidentally discovered that there is a dropdown box under "Type" resp. under "Baudrate" :palm:
Small annoyance: When changing the type from Serial to Socket the Baudrate should automatically change to -.

Now off to that popup stuff. See how much I can pilfer from that SiglentSDSxxxxxx.txt definition file. :)

A few hours later: chugging away nicely with this popup stuff. Except for the Offset SCPI command which seems to be wrong in the SCPI command manual for the HMO1022. Will probably have to ask R&S for assistance. :palm:
« Last Edit: August 18, 2020, 05:35:08 pm by Messtechniker »
Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Voltcraft VC 940 M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1031 on: August 18, 2020, 01:31:52 pm »


After the above happens with the #math channels un-checked and formula turned red if I run the script again, which runs the definitions in the script snippet again, TestController does not re-enable the turned off #math channels.  They still have a red indication in the Source Formula column.  If I just click inside the Source Formula and hit return manually they work.  Why doesn't the script #math re-defining them fix and re-enable them?

The general assumption is that you need to edit the math to fix the error.


I understand the points.  But, I would think that executing a #math command to define a math channel would count as editing the math.  For example, I would expect the below sequence to work but it doesn't.
1. Start TestController fresh with no #math channels defined and no device connected.
2. Execute script to define one #math channel.  For example:
        #math RDSineOff - FormulaNU 0 getMatch(deviceRead("AKD1G","FB1.REGRDSineOffset?"),"[-.0-9]+")
3. Click the Current_values tab and see only 0 for the #math channel values.
4. Click the Math tab and see that the Math channel formula is red (because no device is connected.)
5. Click the Load devices tab, select device, click reconnect.
6. Run the script to define the #math channel again.
7. Click Math tab and see it is still red.
8. Click inside formula, make no changes, and hit return.  Now the red on the formula is gone.
9. Click Current_values and see values come back.

TestController in the above sequence makes perfect sense to me except at step 6.  I would have thought that step 6 would count as editing the #math channel and would clear the red.  It does not.  You have to manually enter the formula make no changes in step 8 to get it to work again.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1032 on: August 18, 2020, 02:26:55 pm »
6. Run the script to define the #math channel again.
7. Click Math tab and see it is still red.

TestController in the above sequence makes perfect sense to me except at step 6.  I would have thought that step 6 would count as editing the #math channel and would clear the red.  It does not.

You have a very good point, luckily is is easy fixed in the software.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1033 on: August 18, 2020, 03:58:05 pm »
V1.13 is up
It adds the sound card input and fixes a couple of bugs.
   Fixed: A #math statement will clear any errors for that entry
   Added: Fault handling to expressions: isNan(), isInfinite(), noFault(), invalidValue()
   Added: Sound card input
   Fixed: Optimized code in sound card output, it uses less processor power now.
   Added: Single sweep to sound card output
   Fixed: #SaveChart did not update chart to included the latest data before saving.
   Fixed: #SaveChart and a few other commands combined multiple commands, this is fixed.



Sound card input do not have many settings, except selecting the input and sampling parameters.



But I found out it was very useful to be able so the the sampled data.



The result is 3 values, calculated from the data.

I also believe this release fixes all issues and current wishes from gby.
 
The following users thanked this post: coromonadalix, gby, tubularnut, Marco1971, MikeLud

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1034 on: August 18, 2020, 07:58:28 pm »
HKJ,

Thanks for V1.13.  I really do appreciate you helping me.  I just downloaded it and started working with it.  Thanks for making #math script command re-set a failed/errored math channel.  Works great now.

I am trying to work with the #saveTable command and I can't seem to get the output format as desired.

#saveTable foo ,;
#saveTable foo .,
Both generate the exact same output file as checked using a file compare utility.  Below is an example first data line:
0;0,001;0,0000166667;1597775263,874;0;55;35;10
The above seems to use "," as the decimal indication and ";" as the separator between numbers.

#saveTable foo tab
#saveTable foo ,
Both generate the exact same output file as checked by a file compare utility.  Below is an example first data line:
0   0.001   0.0000166667   1597775263.874   0   55   35   10
The above seems to use "." as decimal indication and "tab" as the separator.  For a US machine with "." decimal default this makes sense.

My question is how to use #saveTable to save a file with "." as decimal and "," as separator?

When using the Table tab Save button and having the format radio button set to "., format" in the file dialog box the saved file correctly uses "." as decimal and "," as separator.  If you execute #saveTable foo ., and then go to the Table tab, click the Save button the format selected in the radio button in the file dialog is set to ",: format".

Also, Ver 1.13 seems to work differently in the Table tab Save dialog box.  In the file save dialog box I select an existing file test.csv and then click the Save button.  In previous versions TestController just overwrites the existing file with new data.  In Ver 1.13 it creates a new file with name test.csv.csv.  If you try to save again and select test.csv.csv you get test.csv.csv.csv.  Not a real problem but is different than before and different than convention.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1035 on: August 18, 2020, 08:12:38 pm »
I will take a look at these things tomorrow, it looks like there may be some bugs to fix.

Have you checked the noFault() function (It is documented here: https://lygte-info.dk/project/TestControllerFunctions%20UK.html#Trapping_any_error_or_fault)
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 514
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Program that can log from many multimeters.
« Reply #1036 on: August 19, 2020, 07:07:05 am »
Please find enclosed the definition file R&SHMO1022.txt (Ver. 0.2)
for the R&S HMO1022 scope equipped with Interface
HO720 (RS232 and USB via virtual COM port) or
HO732 (USB via virtual COM port) and LAN. :phew:
Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Voltcraft VC 940 M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1037 on: August 19, 2020, 07:17:45 am »
V1.14 is up
It is mostly a bug fix, but I also included the definition from Messtechniker
   Added: R&S HMO1022 Oscilloscope
   Fixed: save extension handling did not work correctly
   Fixed: #savetable xxx ., did not work
   Fixed: Missing updates on Math and Load devices page

The HMO was a very very late addition, the zip was first uploaded without it.
I added a #notes to the HMO saying it needs an optional interface.
 
The following users thanked this post: PushUp

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1038 on: August 19, 2020, 07:20:06 am »
#saveTable foo ,;
#saveTable foo .,

This is fixed now.

#saveTable foo tab
#saveTable foo ,

The tab sets the format to tab and the , is ignored, i.e. the format will not be change from the previous selected tab format.

 

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1039 on: August 19, 2020, 01:40:28 pm »
HKJ,

I just downloaded Test Controller from the web page like normal and in Configuration About it says Ver 1.13.  However, if I file compare this testcontroller.zip to the previous 1.13 download the .zip files are different.  The .zip file I just got has the new R&SHMO1022.txt device file.

Testing the .jar file in the new download it does not seem to have the Ver 1.14 fixes so I don't think it is 1.14 with the old version number either.

Per forum post time stamps it has been 6+ hours since your Ver 1.14 post so I would think caching should be done but I don't know???
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1040 on: August 19, 2020, 02:46:07 pm »
HKJ,

I just downloaded Test Controller from the web page like normal and in Configuration About it says Ver 1.13.  However, if I file compare this testcontroller.zip to the previous 1.13 download the .zip files are different.  The .zip file I just got has the new R&SHMO1022.txt device file.

Testing the .jar file in the new download it does not seem to have the Ver 1.14 fixes so I don't think it is 1.14 with the old version number either.

Per forum post time stamps it has been 6+ hours since your Ver 1.14 post so I would think caching should be done but I don't know???

Something has gone wrong during the build process. I have repeated the process and now I hope it is up.
I do not believe the caching delays the file more than an hour, but it can be in that range when updating files.

 
The following users thanked this post: gby

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1041 on: August 19, 2020, 03:14:57 pm »
Attached is a device file fo the Kunkin KP184. I do not have a Kunkin KP184 so it is untested. Please let me know if there are any issues and I will try to fix them.

[attach=1]

Mike, HKJ,

I finally got some time to play with my Kunkin KP184 and Mike's device file.  On my PC with a real COM1 port (not via a USB serial adapter) it connected.  The *idn? command manually typed in gives a response as expected.  Unfortunately none of the other query commands seems to give a reply.

I re-started TestController Ver1.13 in debug mode to see more about what is going on.  Unexpectedly right at the connection to the device I am getting Java errors in the debug window.  Hopefully HKJ can help us with those.

Attached is the debug window entire contents when doing the following:
1.  Start TestController Ver 1.13 with only the Kunkin KP184 device selected to connect.  Note Java errors at the beginning from connecting.
2.  Manually do *idn?.  Note no Java errors and the correct response is returned.
3.  Manually do device file scpi command CurrentM? and got Rx timeout error and a bunch of Java errors.
4.  Manually do device file scpi command current? and got Rx timeout error and a bunch of Java errors.

Device popups also do not work and yield debug window Java errors and Rx timeout errors since the underlying basic communications doesn't work.

To test if there is a basic Modbus communications problem I did connect to a different Modbus device (admittedly via IP not COM) and no Java errors, just works.  So, there might be some Modbus issue with COM communications/some setup for this device issue???

Suggestions for next steps?
 

Offline PushUp

  • Regular Contributor
  • *
  • Posts: 97
  • Country: de
Re: Program that can log from many multimeters.
« Reply #1042 on: August 19, 2020, 03:19:16 pm »
Now, 1.14 is downloadable.  :)
Due to the massive "EEVblog forum attachement bug", I am now using an external picture hoster, till it is solved...
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1043 on: August 19, 2020, 04:32:50 pm »
I finally got some time to play with my Kunkin KP184 and Mike's device file.  On my PC with a real COM1 port (not via a USB serial adapter) it connected.  The *idn? command manually typed in gives a response as expected.  Unfortunately none of the other query commands seems to give a reply.

The timeouts and the Java null pointer are related: When no answer is received the communication routine returns a null pointer.
It looks like no answer are received at the modbus level.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1044 on: August 19, 2020, 06:29:17 pm »
The Kunkin manual says it uses Modbus RTU communications.  The below is a snip from the manual.  This is an example message to set/write to the load current value.  It is writing a 32 bit unsigned integer 0x000007D0 = 2000 decimal to address 0x0116.  Doing holdingL 0x0116 2000 in TestController generates a slightly different resulting message:

TestController:   01 10 01 16 00 02 04 00 00 07 D0 7C B5
Kunkin Manual:  01 06 01 16 00 01 04 00 00 07 D0 0C 9D
 
The device file contained the below commented out so I would expect TestController to be able to use 06 on writes.
;#disableWriteSingle 1

How to get TestController to use 06 instead of 10 for 32 bit value read/write and how to get TestController to put 00 01 instead of 00 02 after the address?  I assume the last two bytes are proper CRC's in each case.

Code: [Select]
Instruction example:
The following instances suppose the communication be 01, data is hexadecimal
format.
1.Set up load current:
Send instruction: 01 06 01 16 00 01 04 00 00 07 D0 0C 9D
The meaning of each byte is:
01: equipment address.
06: instruction number written in the single register.
01 16: address written in the target register (load current register).
00 01: the number written in the target register
04: the byte number of data written in the target register. If the target register
is 4-byte register, the value is 4.
00 00 07 D0 : data, if it is 07D0, the current is set up as 2000mA.
0C 9D: check code. The high order is before the low order.
Load return data: 01 06 01 16 00 01 04 00 00 07 D0 0C 9D
When operating single register of the load, the load return data is returning the
instruction as original.
« Last Edit: August 19, 2020, 06:33:04 pm by gby »
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1045 on: August 19, 2020, 07:05:42 pm »
The Kunkin manual says it uses Modbus RTU communications.  The below is a snip from the manual.  This is an example message to set/write to the load current value.  It is writing a 32 bit unsigned integer 0x000007D0 = 2000 decimal to address 0x0116.  Doing holdingL 0x0116 2000 in TestController generates a slightly different resulting message:

TestController:   01 10 01 16 00 02 04 00 00 07 D0 7C B5
Kunkin Manual:  01 06 01 16 00 01 04 00 00 07 D0 0C 9D
 
The device file contained the below commented out so I would expect TestController to be able to use 06 on writes.
;#disableWriteSingle 1

How to get TestController to use 06 instead of 10 for 32 bit value read/write and how to get TestController to put 00 01 instead of 00 02 after the address?  I assume the last two bytes are proper CRC's in each case.

06 is single write and only works when writing 16 bit values. That means using a "holding" command with one address and one value

Default for test controller is to 06 when writing one 16 bit value and 10 when writing multiple values (including 32 bit values).
The "#disableWriteSingle 1" will simply disable using 06 and use 10 for all writes.
« Last Edit: August 19, 2020, 07:08:41 pm by HKJ »
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1046 on: August 19, 2020, 07:31:02 pm »
Looking a bit more on the format, it looks like it is not modbus, but their own variant of it.
The format of a 06 is:

Slave Address        01
Function                06
Register Address Hi     00
Register Address Lo  01
Preset Data Hi        00
Preset Data Lo     03
Error Check (LRC or CRC)––

As can be seen there is no data count included.

This mean I will have to add a variant of modbus to handle this.

 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1047 on: August 19, 2020, 09:05:55 pm »
Looking a bit more on the format, it looks like it is not modbus, but their own variant of it.
The format of a 06 is:

Slave Address        01
Function                06
Register Address Hi     00
Register Address Lo  01
Preset Data Hi        00
Preset Data Lo     03
Error Check (LRC or CRC)––

As can be seen there is no data count included.

This mean I will have to add a variant of modbus to handle this.

What also is weird it excepted a SCPI command.

Code: [Select]
;; Found Kunkin KP184 on Serial0 (COM1)
*idn?
;; KP184: Tx <*idn?>
;; KP184: Rx <Kunkin,Kunkin KP184, , >
;; Kunkin,Kunkin KP184, ,
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1048 on: August 19, 2020, 09:18:16 pm »
What also is weird it excepted a SCPI command.

Not really, all non-SCPI drivers implements a SCPI driver in the Java code, that translate to something else. Here it was the internal SCPI driver that answered and no native commands was defined to verify the device first.
If any of:
#verifyDevice
#scpiCmd getDeviceSW?
#scpiCmd getDeviceSN?
Had been present, it would have tried to communicate before answering the *idn?
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 514
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Program that can log from many multimeters.
« Reply #1049 on: August 20, 2020, 07:25:48 am »
Ver. 0.3 of the HMO1022 definition file. Now includes phase measurement.  :-+
Useful for aligning tape heads - should anybody sill be doing this. :palm:
Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Voltcraft VC 940 M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers
 
The following users thanked this post: Marco1971


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf