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

0 Members and 14 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1150 on: September 06, 2020, 07:12:35 pm »
Hate to ask but I am a total non programmer at this point, trying to learn

I have a riden power supply and I would like to charge some lifepo batteries and log the results.  Can someone point me in the right direction to get started?
Sorry for basic question.

Connect the PS to TestController and check the connection work, i.e. TC can show values from the PS and control it from the Setup popup.
Connect the battery to the PS
Start logging in TC
Use the Setup popup to set current and voltage.
Wait while the charge is logged. You can use a popups/alarm to set a alarm when the current gets low (Check mark "Outputs off" to automatic turn the charging off).

All the PS and logging stuff could be controlled from a script, but it is an optionally extra.
 

Offline No.15

  • Contributor
  • Posts: 34
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1151 on: September 06, 2020, 07:35:03 pm »
Thank you for the help.

I would like to write a script, similar to you battery discharge test, but for charging.  I have many of these 280ah 3.65v cells I need to charge and then discharge test, for solar forum info.  CC charge is best I beleive.
Very new to this and trying hard to learn and give back.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1152 on: September 06, 2020, 07:49:42 pm »
I would like to write a script, similar to you battery discharge test, but for charging.  I have many of these 280ah 3.65v cells I need to charge and then discharge test, for solar forum info.  CC charge is best I beleive.

It is not that difficult, here I have redone the discharge script (I have not tested it):
#logcmds 0
; Battery charge test
=var chargeVoltage=4.2
=var chargeCurrent=0.3
=var terminationCurrent=0.03
=var stepTime=1
; --------------------------------------------------------------
="Charge with "+chargeCurrent+"A to "+chargeVoltage+"V";
=var ps=getDevice("ps")
=setCurrent(ps,chargeCurrent)
=setVoltage(ps,chargeVoltage)
#log (stepTime)
#haslogged
=setOn(ps,1);
#haslogged
#wait readCurrent(ps)>terminationCurrent
#haslogged
#haslogged
=setOn(ps,0);
#haslogged
#haslogged
#log 0
="Charge terminated"




 

Offline No.15

  • Contributor
  • Posts: 34
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1153 on: September 06, 2020, 08:10:57 pm »
That is awesome, gives me a start.  Debugging is learning.  I think :)
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1154 on: September 06, 2020, 08:32:00 pm »
That is awesome, gives me a start.  Debugging is learning.  I think :)

For debugging you may want to remove the #logcmds 0
 

Offline maukka

  • Supporter
  • ****
  • Posts: 107
  • Country: fi
Re: Program that can log from many multimeters.
« Reply #1155 on: September 08, 2020, 02:19:42 pm »
Also please change the charge voltage to suit your LiFePO4 cells. HKJ defaulted to lithium ion in the script.
 

Offline No.15

  • Contributor
  • Posts: 34
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1156 on: September 08, 2020, 03:02:59 pm »
Also please change the charge voltage to suit your LiFePO4 cells. HKJ defaulted to lithium ion in the script.

yes changed, it seems to be working fine except maybe the termination.  280ah cells take a long time to charge at 5a :)
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1157 on: September 10, 2020, 12:12:18 am »
HKJ,

Getting close to a Tektronix scope device file with interface.  One issue is that a couple of the SCPI commands need to have quotes around the string.  Normal script command syntax for string arguments might be:
         =setCH1Coupling(osc,"AC")
to send the two character sequence A followed by C.  But, to define the math expression for subtracting two channels you need to send "CH1-CH2" with the quotes around it as the SCPI command argument.  Like:
         =setMathDefinition(""CH1-CH2"")
But, TC gives Java error from the two starting and two ending quotes.  I understand we could use an escape character like:
         =setMathDefinition("\"CH1-CH2\"")
but I was hoping to avoid having to have the script writer know to do the slashes before the inner quotes and do that for them in the #interface definition.

How could I create an #interface line that takes the string "CH1-CH2" as an argument and sends it to the scope with the quotes?
« Last Edit: September 10, 2020, 12:20:33 am by gby »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1158 on: September 10, 2020, 04:53:07 am »
How could I create an #interface line that takes the string "CH1-CH2" as an argument and sends it to the scope with the quotes?

It must be something like ("\""+value+"\"")
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1159 on: September 10, 2020, 01:16:23 pm »
V1.25 A couple of small additions and a bug fix.
   Added: Load will accept time in h:m:s format and dateTime in system format.
   Added: Tab format with comma as decimal point (ctab).
   Added: #Connected? Generated a list of used devices and computer, can be saved to a file.
   Added: Help pages got a list of scripting command (A few already had) related to that function/page/popup.
   Added: Save button on Command page will now ask for format: log, script or menu
   Added: Export to table button in export popup.
   Added: #ExportTableReload Export and reload table, this is designed to do data reduction in the table
   Added: Export ReduceByFormula, use a expression to select data for export
   Fixed: Digital curves on chart (They disappeared due to previous update)

With the additions to the export popup it is very easy to remove some data from the table.



Remove the negative part of a sinus wave.



And use "To Table" to directly send it back into TestController (It is a good idea to save the original data first).
 
The following users thanked this post: tubularnut, Marco1971

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1160 on: September 10, 2020, 01:41:42 pm »
How could I create an #interface line that takes the string "CH1-CH2" as an argument and sends it to the scope with the quotes?

It must be something like ("\""+value+"\"")

Suggestion worked fine.  Thanks for the help.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1161 on: September 10, 2020, 04:16:39 pm »
HKJ,

I can't seem to get deviceWrite to work.  I created a small test script:
Code: [Select]
=deviceRead("OscTek_4","SELECT:MATH?")
=deviceWrite("OscTek_4","SELECT:MATH 1")
=deviceRead("OscTek_4","SELECT:MATH?")
OscTek_4:SELECT:MATH 1
=deviceRead("OscTek_4","SELECT:MATH?")
which uses deviceRead to check a value for 0 or 1 and uses deviceWrite to try and set the value.  Below is the output from the dos debug window from Ver 1.25:
Code: [Select]
=deviceRead("OscTek_4","SELECT:MATH?")
;; OscTek_4: Tx <SELECT:MATH?>
;; OscTek_4: Rx <:SELECT:MATH 0>
;; :SELECT:MATH 0
=deviceWrite("OscTek_4","SELECT:MATH 1")
;; OscTek_4: Tx <="OscTek 4"="SELECT:MATH 1">
=deviceRead("OscTek_4","SELECT:MATH?")
;; OscTek_4: Tx <SELECT:MATH?>
;; OscTek_4: Rx <:SELECT:MATH 0>
;; :SELECT:MATH 0
OscTek_4:SELECT:MATH 1
;; OscTek_4: Tx <SELECT:MATH 1>
=deviceRead("OscTek_4","SELECT:MATH?")
;; OscTek_4: Tx <SELECT:MATH?>
;; OscTek_4: Rx <:SELECT:MATH 1>
;; :SELECT:MATH 1

Why does
    =deviceWrite("OscTek_4","SELECT:MATH 1")
not work and the same intended command
    OscTek_4:SELECT:MATH 1
sent directly work?  Per the dos debug log it seems the deviceWrite Tx line is wrong with two = signs and quotes still in the sent message.

Am I using the deviceWrite command incorrectly or is there a bug in the deviceWrite function?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1162 on: September 10, 2020, 04:42:57 pm »
Am I using the deviceWrite command incorrectly or is there a bug in the deviceWrite function?

There is a bug, I have fixed it, for now please use deviceRead.
The idea behind having both a write and read is to make the script more clear, a deviceRead where you do not use the return value is the same as a deviceWrite.

Another note: When using columns to show on/off value, try declaring the datatype "digital(on)" instead of "D0"
 

Offline PushUp

  • Regular Contributor
  • *
  • Posts: 189
  • Country: de
Re: Program that can log from many multimeters.
« Reply #1163 on: September 12, 2020, 12:03:30 pm »
Question:

The Fluke 289 is not able to log faster than 1 second with the internal logging procedure interval as well as the Keysight U1272A / U1273A. Does it make sense to log faster than 1 second with TestController when you wanna have a 100% test result by all means?
Keysight offers a larger baud rate than 9600 compared to the Fluke 289?! Is it essential to go higher? I tried it, but the connection / detection itself wasn't so stable any more, so that I went back to the default setting...?

In other words: Is there any handheld DMM, which is able to log faster than 1 second interval, without skipping measurements in TestController?

By the way, what is a stable and safe logging time with any benchtop DMM < 1 second in combination with TestController?


ThanX.  :)
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1164 on: September 12, 2020, 01:20:10 pm »
HKJ,

I have finished a device file for Tektronix oscilloscopes.  It specifically supports and I have tested with the following oscilloscope families:
   MDO3000, MSO3000, DPO3000, and TDS3000C
Just by adding more #meta sections it should support nearly any Tektronix scope in the last 15 years or so as long as it has Ethernet port.  For example, MDO4000, MSO/DPO5000, MSO/DPO4000.  I did not include these others because I can't test them.

They all work with LXI interface.  MDO3000 just worked with socket interface and socket interface is 5x faster than LXI.  MSO/DPO3000 supports socket but I could not get that to work.  Updating DPO3034 FW from V2.23 to latest V2.40 and socket works but is no faster.  TDS3000C only supports LXI and note that TDS3000 (without C) does not have Ethernet and two different TDS3000B I tried did not work.

This device file includes
   Logging the 4 on screen measurements plus the hidden immediate one.
   Uses #interfaceType OSC with full general purpose script interface.  I suggest using this to add interface to other scopes.
   Has Mode and Setup popups (modified versions of MikeLud's Siglent scope ones)

Please add this device file to the next release.
« Last Edit: September 13, 2020, 05:35:36 pm by gby »
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1165 on: September 13, 2020, 05:32:14 pm »
HKJ,

Further Tektronix device file testing found the popup combo box to set input termination impedance was not working properly.  It was
Code: [Select]
#cmdSetup comboboxhot Termination CH_4
:read: CH4:TERMINATION?
:readmath: getMatch(value, "( |^)[-+.0-9].*")
:write: CH4:TERMINATION
1M 1e6
50 50
75 75
Setting worked fine.  But, it would not register 1M as 1 MegOhm setting when the read returned 1.0000E6.  So the value when opening the popup was not necessarily correct.  Changing the "1M" text to "1e6" got it to work.  It would be nice to get 1M to work since it reads nicer to people but not really necessary.

Updated "Tektronix MDO MSO DPO TDS.txt" device file attached.  Please use this one.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1166 on: September 13, 2020, 07:10:48 pm »
In other words: Is there any handheld DMM, which is able to log faster than 1 second interval, without skipping measurements in TestController?

The short answer is yes.

TestController uses uses a couple of different strategies with multimeters, with some meters it sends a command and wait for an answer (289 works this way). With some other meters the logging and meter communication are decoupled, i.e. TestController communicates with the meter as fast as possible, logging will use the last returned value. This is the way meters that only outputs date works and many of them are in the 3 to 6 samples each second (on DCV).

 
The following users thanked this post: PushUp

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1167 on: September 13, 2020, 07:18:41 pm »
Setting worked fine.  But, it would not register 1M as 1 MegOhm setting when the read returned 1.0000E6.  So the value when opening the popup was not necessarily correct.  Changing the "1M" text to "1e6" got it to work.  It would be nice to get 1M to work since it reads nicer to people but not really necessary.

From next version try formatSI() in readmath

Updated "Tektronix MDO MSO DPO TDS.txt" device file attached.  Please use this one.

It will be included in next version.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1168 on: September 16, 2020, 10:56:46 am »
V1.26 is up
Mostly it is about documentation, but it also includes new devices and some bug fixes.
   Fixed: Discovery often broke running logging, this is reduced (It is brand and firmware version depend).
   Added: Documentation for Timer popup (Press F1 to open in browser)
   Added: Documentation for Test Interface popup (Press F1 to open in browser)
   Added: Documentation for Connected Devices popup (Press F1 to open in browser)
   Added: Documentation for Readout popup (Press F1 to open in browser)
   Added: Documentation for Adjust scale popup (Press F1 to open in browser)
   Added: Documentation for Advanced log and Log Trigger popup (Press F1 to open in browser)
   Added: Documentation for Export popup (Press F1 to open in browser)
   Fixed: DeviceWrite() did not work correctly

The documentation can be access with F1 or from here: https://lygte-info.dk/project/TestControllerIntro%20UK.html

The discovery function did affect some devices (i.e. logging was stopped) when it checked the id of them, to avoid this I now uses a html request to get the device information, if it is supported. Sadly many brands do not know their own name and the html request do not return exactly same brand name as the *idn? request, to fix this I uses a slightly fuzzy search when comparing brand and model names.


gby has added a lot of Tektronix scopes:

 
The following users thanked this post: PushUp, tubularnut

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1169 on: September 16, 2020, 10:33:28 pm »
Setting worked fine.  But, it would not register 1M as 1 MegOhm setting when the read returned 1.0000E6.  So the value when opening the popup was not necessarily correct.  Changing the "1M" text to "1e6" got it to work.  It would be nice to get 1M to work since it reads nicer to people but not really necessary.

From next version try formatSI() in readmath

HKJ,

Thanks for yet more useful functionality.  I added formatSI() to the readmath and changed termination label back to 1M and everything works fine.

Attached is the updated Tektronix scope file with the above update and another small fix for TDS3000C scopes.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1170 on: September 17, 2020, 07:16:15 am »
Attached is the updated Tektronix scope file with the above update and another small fix for TDS3000C scopes.

I will include it in the next update.

Maybe you want to check these tags:

In meta sections use "#sections QuadChannel"

In definition use:

#metaSection QuadChannel
#defs for channel 3 & 4
#metaSection

Documentation is here: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html##sections


 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1171 on: September 18, 2020, 09:14:34 pm »
HKJ,

I am looking to improve the device support for Kollmorgen AKD2G.  The device has nearly a 1000 variables/signals that might be of interest to log.  It also has a built in oscilloscope mechanism for use with its proprietary PC GUI software that works by store and forward and can't continuously log.  It would be very flexible to use this mechanism for logging since there are commands already supported in the TC device file to select what signals will be recorded.

The problem is that the return data comes back as two text lines with the values of the channels separated by commas.  Below is an example returned data:
   01
   2325.793,-12.163,152423176,65532

The issue is that there is a carriage return, line feed after the 01 before the line of data numbers.  This device communicates with standard Telnet and the device file defines this device as:
   #port 23
   #eol \r\n
   #driver ascii
The above works for all the other commands since they are single return line with \r\n at the end.

Thoughts on how to receive the two line reply and parse the numbers as logged values?

This device can have from 1 to 6 values selected for the built in recorder and the reply will then be 01 followed by 1 to 6 comma separated values.  Will TestController be OK with setting missing values to 0 and not have errors when there are less than the maximum 6 log numbers?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #1172 on: September 19, 2020, 08:45:52 am »
I have made a temporary version with support for multiline in Ascii device: http://lygte-info.dk/pic/Projects/TestController/TestController.jar

You can use:
txrx2? or txrxn?
with the n version the number of lines must be specified after the command, i.e. "txrxn? 2 device_command"

The result will contain multiple lines with a LF (\n) between, you can get the second line with getElement(value,1,"\n")

The two commands are untested, but please test both. I expect the txrx2? works, and hope the txrxn? works

To handle missing values, just add a couple of zero values to the end: getElement(value,1,"\n")+" 0 0 0 0 0 0"
Extra values are ignored.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1173 on: September 19, 2020, 01:34:53 pm »
HKJ,

Thanks for this new capability.  It should be a useful addition to TC.  Thank you for this new TC capability.

On a quick command line test both the new txrx2? and the txrxn? <number> commands seem to work.  Trying txrxn? with multiple number arguments on a device command that returns many lines seems to get the correct number of lines each time.  Testing multiple line numbers up to the full 49 of the device seems to just work.  I even tested txrxn? 3 with a command that only returns 2 lines and TC gave the resulting 2 lines with no error messages which is just what you would want.

One small thing that would be good to clean up is the echo to the Command tab result window.  Normally ";;" is added before the return data echo so that when you click the Clean button you remove returned query data.  With the new txrxn? command the extra lines of text are echoed to the screen have no prefix of ";;" like shown below.
Code: [Select]
txrxn? 2 rec.retrievedata 0
;; 01
2325.793,-12.163,152423176,65532
*idn?
;; Kollmorgen,AKD1G, ,
Clicking the Clean button leaves the extra returned lines behind.

Lastly I did a very quick check of using this method to get data and it is working!

The last challenge is what, if anything, to do about units?  With the logged value being channels selected in the test script, then you don't know what units to put in the device file.  I had the same issue with oscilloscope support in that a channel could be voltage or it could be current for example.  For the moment I have put just - in the device file for units but would be interested in your thoughts on setting log channel units in a script.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #1174 on: September 19, 2020, 01:39:45 pm »
While doing an extended test of the fastest logging I could do with the txrxn? command test version I was using #commandtime? and found the results confusing.  Checking mulitple times in a row while continuously logging the "slowest" time was getting smaller and not same or larger.
Code: [Select]
;; AKD1G     last:    15.35 ms     average:    16.30 ms     slowest:    38.45 ms
#commandtime?
;; AKD1G     last:    14.34 ms     average:    16.29 ms     slowest:    34.31 ms
#commandtime?
;; AKD1G     last:    15.27 ms     average:    16.33 ms     slowest:    33.59 ms
#commandtime?
;; AKD1G     last:    15.32 ms     average:    16.29 ms     slowest:    31.92 ms
#commandtime?
;; AKD1G     last:    16.12 ms     average:    16.16 ms     slowest:    30.22 ms
Does #commandtime? reset and start over on a regular basis?

With logging off and just sitting in the command window I once got:
Code: [Select]
#commandtime?
;; AKD1G     last:     0.01 ms     average:     0.01 ms     slowest:     0.01 ms

Before this test version #commandtime?  seemed to always make sense.  Does multi-line txrxn? somehow confuse #commandtime?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf