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

PaWill68 and 3 Guests are viewing this topic.

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #925 on: July 19, 2020, 05:01:24 am »
Is there a way to write a TestController script with nested loops?  If not, would that be an easy feature to add?

For now there is not, it is a thing a am planning on adding.

For now you can get around it by doing something like:
Code: [Select]
=var n=1
=var p=1

#while (n<10)
=p=p+1

#if (p>=10)
=n=n+1
=p=1
#endif

#endwhile
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #926 on: July 19, 2020, 03:20:55 pm »
HKJ,

Using #if, #endif with the #while, #endwhile to indirectly do nested loop iteration is tricky.  I have to think further about how to use that idea to do what is needed...so far I haven't been able to get it to do what is needed.  But, I continue working on it.

I do have a couple of questions.  When I run the below test script:
Code: [Select]
=var n=1
=var p=1

=p=1

#if (p<=10)
=p=p+1
#delay 1
#endif
I get the following output from the console.  Note that even though logging is off that TestController is polling the device once to get the #askValues data values.  With longer test scripts I see this polling happening regularly.  To be clear, logging was never turned on.  Without turning on logging and just running a script why does TestController poll the device?
Code: [Select]
=var n=1
=var p=1
=p=1
#if (p<=10)
;; AKD1G: Tx <Drv.Flt?>
;; AKD1G: Tx <txrx? DRV.FAULTS>
;; 192.168.1.173: Tx: <DRV.FAULTS..> 44 52 56 2E 46 41 55 4C 54 53 0D 0A
;; 192.168.1.173: Rx: <No faults active> 4E 6F 20 66 61 75 6C 74 73 20 61 63 74 69 76 65 0D
;; AKD1G: Rx <0>
;; AKD1G: Tx <FB1.REGRDSineOffset?>
;; AKD1G: Tx <txrx? FB1.REG 2>
;; 192.168.1.173: Tx: <FB1.REG 2..> 46 42 31 2E 52 45 47 20 32 0D 0A
;; 192.168.1.173: Rx: <184> 31 38 34 0D
;; AKD1G: Rx <184>
;; AKD1G: Tx <FB1.REGFtLow?>
;; AKD1G: Tx <txrx? FB1.REG 27>
;; 192.168.1.173: Tx: <FB1.REG 27..> 46 42 31 2E 52 45 47 20 32 37 0D 0A
;; 192.168.1.173: Rx: <62> 36 32 0D
;; AKD1G: Rx <62>
;; AKD1G: Rx as numbers <0.0 184.0 62.0>
=p=p+1
#delay 1
#endif

Last question.  What are legal values for the #delay command?  When I try #delay integer values or 0.5 or 0.1 in the above test code things work.  When I try #delay 0.51 or 0.01 the script runs forever and I have to use the Abort button.  When stuck/not finishing the debug window showed no errors.  I know that 0.01 sec resolution is probably not needed but it seems like a bug for the script to freeze with no error message.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #927 on: July 19, 2020, 03:54:08 pm »
Using #if, #endif with the #while, #endwhile to indirectly do nested loop iteration is tricky.  I have to think further about how to use that idea to do what is needed...so far I haven't been able to get it to do what is needed.  But, I continue working on it.

Nested #while will be support from next version

With longer test scripts I see this polling happening regularly.  To be clear, logging was never turned on.  Without turning on logging and just running a script why does TestController poll the device?

When using the "=" statements it will poll the device to setup variables for using in the statements.

Last question.  What are legal values for the #delay command?  When I try #delay integer values or 0.5 or 0.1 in the above test code things work.  When I try #delay 0.51 or 0.01 the script runs forever and I have to use the Abort button.  When stuck/not finishing the debug window showed no errors.  I know that 0.01 sec resolution is probably not needed but it seems like a bug for the script to freeze with no error message.

The delay command is faulty, this is fixed in next version.
Note: A fixed jar file is here: http://lygte-info.dk/pic/Projects/TestController/TestController.jar
 
The following users thanked this post: Messtechniker

Offline dirkwim07

  • Contributor
  • Posts: 14
  • Country: nl
Re: Program that can log from many multimeters.
« Reply #928 on: July 21, 2020, 09:56:50 am »
Im fairly new into this but I would like to test the capacity of the battery pack (36v) for my electric bike. I really like the graphs of the program @HKJ made. Which multimeter (looking for a bang for buck) would be best suited to meassure the capacity (amp hours) for the battery pack I have?
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #929 on: July 21, 2020, 10:38:27 am »
Im fairly new into this but I would like to test the capacity of the battery pack (36v) for my electric bike. I really like the graphs of the program @HKJ made. Which multimeter (looking for a bang for buck) would be best suited to meassure the capacity (amp hours) for the battery pack I have?

You need an electronic load.
Look at BK-Precision, Itech and Maynuo brands (BK-Precision is the most expensive).
A 300W model will allow you to discharge with about 7A assuming initial voltage is 42V.
The PC interface is fairly expensive or you can make one yourself.

At the current time I only support one Maynuo model, but it is very easy to support more models, the only think I am missing is a model identifier. This software will list this value and raporting the model and this value I can add it (It is also possible to add yourself in the Maynuo M97xx definition file).

 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #930 on: July 21, 2020, 11:12:09 am »
V1.02 is up
It is mostly small improvements and a bugfix..
   Included command files to start TestController on linux command line (tcrun & tcrundebug)
   Added: Brymen BM197 & BM195 clamp meter
   Added: Brymen BM357s clamp meter
   Fixed: Bug in #DELAY
   Added: Nested #WHILE is now working
   Fixed: Second channel on TTi CPX400DP was not correctly defined.
   Added: "Adjust scale" has got an option to enable/disable SI format.

It includes support the the Brymen clamp meters that was asked about earlier. The interfaces for these meters includes a new battery lid for the meter with the interface.
BM357s is also a power meter and only AC current
BM197 is AC & DC current and is designed measure amps (not mA).
 
The following users thanked this post: gby, PushUp, Marco1971, MikeLud

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #931 on: July 21, 2020, 10:38:05 pm »
HKJ,

Thanks for getting nested #while loops working.  They seem to work fine and my test is running great now.    :clap:

Just a comment on usage.  To make the script easier to read I tried leading spaces in the lines inside a nested loop.  See code example below.  Running this code example yields an infinite loop and ";; Invalid device <>" lines in the command window output.  If you remove the spaces in front of "=inc=inc+1" the code works as expected.  Just be aware TestController seems to interpret leading spaces as a device name.
Code: [Select]
;Nested loops test
=var set=2
=var inc=3

=set=1

#while (set<2)
#delay 1
=set=set+1
=inc=1

#while (inc<3)
   =inc=inc+1
#endwhile

#endwhile
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #932 on: July 22, 2020, 04:48:22 pm »
To make the script easier to read I tried leading spaces in the lines inside a nested loop.  See code example below.  Running this code example yields an infinite loop and ";; Invalid device <>" lines in the command window output.  If you remove the spaces in front of "=inc=inc+1" the code works as expected.  Just be aware TestController seems to interpret leading spaces as a device name.

When I made the command interpreter I believed it was a good idea to require # and = to be in column 1

I do have a more complete programming language in the expression interpreter and I am thinking on how to make it accessible for more advanced programming.
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
Re: Program that can log from many multimeters.
« Reply #933 on: July 22, 2020, 09:46:16 pm »
HKJ,

I was just on your website and notice that the last part of page https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html has half of the page in a code box

[attachimg=1]
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #934 on: July 23, 2020, 06:44:21 am »
I was just on your website and notice that the last part of page https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html has half of the page in a code box

Page is back to normal again.
 
The following users thanked this post: Marco1971, MikeLud

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #935 on: July 24, 2020, 12:54:42 pm »
V1.03 is up
This is mostly new devices.
   Added: USBHID can now handle multiple meters by using the interface serial number as address (It is automatically added)
      For this to work connect one interface with a meter at a time, this will lock it to that meter.
      Multiple meters can share an address and it is possible to manually clear the address.
   Added: A extra SCPI driver that supports #scpiCmd and a few other details to adapt nearly SCPI devices to SCPI.
   Added: Korad power supplies, but only newer versions (Answer to *IDN? contains spaces between words).
   Added: All Maynuo loads with the help from a EEBLOG member, he send me a list with model codes.

Somebody here mailed me a list with all the id codes for Maynuo and I have added them to the definition.
The Korad supply was not strictly SCPI and I add to make a new driver for it.

I also fixed the issue with using multiple USBHID meters (At least for Brymen) by using the serial number of the interface cable as address:
 
The following users thanked this post: tubularnut, Marco1971, MikeLud, SharpDome

Offline MiroS

  • Regular Contributor
  • *
  • Posts: 145
  • Country: pl
Re: Program that can log from many multimeters.
« Reply #936 on: July 26, 2020, 04:09:19 pm »
New bug - if Arduino is connected before BM869s , BM869s is recognized , but not connected until I remove Arduino from USB port.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #937 on: July 26, 2020, 04:32:23 pm »
New bug - if Arduino is connected before BM869s , BM869s is recognized , but not connected until I remove Arduino from USB port.

Just tried a Nano together with BM869s and did not see any problem.
If you are using a ATmega32U4 in USB mode you must not use the same vendor & product id.

Are you using a hub or directly connected to the computer?
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #938 on: July 27, 2020, 06:58:30 am »
V1.04 is up
This has a new popup and many small changes:
   Added: Definition file for binary DMM protocols
   Added: Program icon, image file is included as png and ico
   Added: Alarm setting than can make a visual and/or audible alarm when values are out of specified range.
   Added: Alarm commands: #SETALARM #ADJUSTALARM #CLOSEALARM
   Added: #CLOSEALL that will close all popups.
   Fixed: The 3 ways to close all popups (Reconnect, popups/closeAll, #closeAll) now works similar and closes all popups (Calculator & Timer only with #closeall)
   Added: Most # commands can now handle expressions, they must be in parenthesis ()
   Added: Integers can nearly everywhere be in decimal, hex or binary (Use prefix 0x/0b or postfix h/b)
   Added: Brymen BM251s, BM252s, BM255s and BM257s

It is now possible to add basically any DMM with a serial interface using either "Single value" or "Binary DMM protocol", documentation: http://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html

I made a program icon, it is not great, but better than the standard Java icon:

The Brymen BM250s series meters has been added, for the money I believe you get a very good meter with computer interface (Interface is a separate buy).

I added a alarm popup:



The alarm is designed to be attention-grabbing, it can be used to signal when to stop a test (Like a battery discharge test with a resistor). Please do not complain here if somebody throws you computer out the nearest window ;D
It can also be configured to be more discrete.

The smaller versions of the alarm window:




 
The following users thanked this post: tubularnut, Marco1971, MikeLud

Offline MiroS

  • Regular Contributor
  • *
  • Posts: 145
  • Country: pl
Re: Program that can log from many multimeters.
« Reply #939 on: July 28, 2020, 07:07:41 pm »
New bug - if Arduino is connected before BM869s , BM869s is recognized , but not connected until I remove Arduino from USB port.

Just tried a Nano together with BM869s and did not see any problem.
If you are using a ATmega32U4 in USB mode you must not use the same vendor & product id.

Are you using a hub or directly connected to the computer?

Directly , no hub;  ATmega32U4 in USB plus  BM869s over Brymen cable. 
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #940 on: July 29, 2020, 04:28:45 am »
Directly , no hub;  ATmega32U4 in USB plus  BM869s over Brymen cable.

Then it is probably not a power problem. I frequently uses a ATmega32U4 together with the Brymen and have seen no problem. Try another bootloaded on the Arduino, I usually uses the Leonardo version on my ProMicro boards.
 

Offline SimonD

  • Regular Contributor
  • *
  • Posts: 92
  • Country: 00
Re: Program that can log from many multimeters.
« Reply #941 on: July 29, 2020, 10:25:33 am »
Hi,
Congratulations for this excellent work!
Any chance to add the Kunkin KP184 electronic load ?

Thanks in advance!
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #942 on: July 29, 2020, 10:46:18 am »
Any chance to add the Kunkin KP184 electronic load ?

As far as I know it uses modbus and I am hoping somebody else will do the work of adding it.
It is something similar to the RidenRD60xx definition.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #943 on: July 29, 2020, 11:47:35 am »
V1.05 is up.
It is mostly a bug fix.
   Changed: Readout will always show a value when started.
   Added: Lux meter CEM DT-1309
   Fixed: Current values did not reset time sums.
   Fixed: BM250 did give occasionally wrong readings on a slow computer.

I have also posted an article on how to use TestController for testing batteries:
http://lygte-info.dk/project/TestControllerDemoBattWithResistor%20UK.html
 
The following users thanked this post: tubularnut, Marco1971, MikeLud

Offline SimonD

  • Regular Contributor
  • *
  • Posts: 92
  • Country: 00
Re: Program that can log from many multimeters.
« Reply #944 on: July 29, 2020, 01:10:19 pm »
... i don`t have it yet (is on the road) but i think it works with an RS232 converted to usb with the help of a dongle interface, if that can help you...
Thanks again!
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 1571
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #945 on: July 29, 2020, 01:45:47 pm »
... i don`t have it yet (is on the road) but i think it works with an RS232 converted to usb with the help of a dongle interface, if that can help you...

I supposed it uses a virtual serial port and that makes the communication easy to setup.
The work is defining the SCPI to modbus translation and making a setup panel in TestController, that is not very easy to do without the device.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 183
  • Country: us
Re: Program that can log from many multimeters.
« Reply #946 on: July 30, 2020, 05:20:38 pm »
I have a Kunkin 184 and it is on my list to do a device file for it....but real busy right now and so won't get to it for a while.

 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
Re: Program that can log from many multimeters.
« Reply #947 on: July 30, 2020, 07:11:54 pm »
I just looked at the manual for the Kunkin KP184 and there are not that many modbus points so I will try to help out and make a device file for it. The only thing is I do not have one (unless someone wants to send me one I will happily accept it) so I will need someone to test it
« Last Edit: July 30, 2020, 07:20:52 pm by MikeLud »
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
Re: Program that can log from many multimeters.
« Reply #948 on: July 31, 2020, 01:12:17 am »
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]
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
Re: Program that can log from many multimeters.
« Reply #949 on: July 31, 2020, 12:56:37 pm »
I was just on your website and notice that the last part of page https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html has half of the page in a code box

Page is back to normal again.

HKJ,
Modbus serial & network and Non-SCPI ascii devices part is missing from the web page. When I was working on the device file for the Kunkin KP184 I went to lookup something and it was not there.

Thanks,
Mike Lud
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf