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

0 Members and 6 Guests are viewing this topic.

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #950 on: July 31, 2020, 01:30:54 pm »
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.

Fixed, but it may be some time before the cache is updated.
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Program that can log from many multimeters.
« Reply #951 on: July 31, 2020, 03:52:55 pm »
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.

Fixed, but it may be some time before the cache is updated.

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #952 on: July 31, 2020, 04:22:52 pm »
Fixed, but it may be some time before the cache is updated.
Thanks

It will most likely happen again when I do some simple updates and skip checking the final result. I fix the problems as soon as I become award of them.
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Program that can log from many multimeters.
« Reply #953 on: July 31, 2020, 05:13:25 pm »
Fixed, but it may be some time before the cache is updated.
Thanks

It will most likely happen again when I do some simple updates and skip checking the final result. I fix the problems as soon as I become award of them.

Anytime I can help, since you did so much work on this program and continuing to do so.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #954 on: July 31, 2020, 05:23:33 pm »
Anytime I can help, since you did so much work on this program and continuing to do so.

What I like is getting bug reports, ideas for improvements and questions about the usage of the program (I use the question to thing about improvement in the user interface).
The program is getting close to what I wanted, but there is still some details I would like to improve and also some larger projects I may look at with it.
Next update I am working on it not the main program, but some improvements to the calculator (So it knows what 5j means).
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #955 on: August 01, 2020, 01:06:51 pm »
V1.06 is up
This is about complex numbers in the calculator and do not have any improvement to the general functionality of TestController.
   Added: Help page for calculator
   Added: Calculator quadratic equation solver.
   Added: Calculator complex electronic: cpxC(freq,C) cpxC(freq,C,Rs) cpxL(freq,L) cpxL(freq,L,Rs)
   Added: Calculator complex functions (Nearly all math functions)
   Added: Calculator complex support
   Added: Calculator hyperbolic trigonometry functions


Sticking a i or j after a number will switch that number into complex. Function will use complex if any of the arguments are complex. I.e. sqrt(-1) fails, but sqrt(-1+0i) returns +1i
This is also valid for qeq(a,b,c) (quadratic equation solver), add +0i to any of the arguments and it can return complex results.

The cpxC etc. functions are for handling capacitors and inductors like resistors when calculating:

 
The following users thanked this post: Marco1971, MikeLud

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #956 on: August 01, 2020, 07:59:11 pm »
Hi HKJ,

Since you asked for user input I have some questions, suggestions for TestController.

The device I am supporting (Kollmorgen Servo drive) literally has almost 1000 things you could poll and the dual motor version has almost 1500.  If the standard device file listed all of the possible things to log in the #askvalues statement that would chew up huge resources and be very slow.  So, when doing a particular test you have to modify the #askvalues and the corresponding #Value statements to select just the items you want to log in a custom/temporary device file.  Could there be a way with a script to temporarily define what should be logged?  That way there would be only one device file for the device and each test would use a script to tell TestController what to log that is needed for that test.  Or, perhaps create a way to re-define the existing log items in a script?

When using a script to do something like a frequency sweep we can have the logged variable from the generator for our frequency and some measurement device for our result.  In other words, exactly like the example frequency sweep script you provided.  I was trying to do a frequency sweep with a Siglent generator where the output was phase modulated.  So, the script had a loop to increment the frequency and wrote that set point to the Phase Modulation frequency.  Since the device file does not log modulation frequency you have to modify the device file to add a query to get that frequency into the logged data.  It would be easier if a script could just write a variable's value directly to a logging column.

Thanks in advance for any consideration of these ideas.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #957 on: August 01, 2020, 08:21:45 pm »
Since you asked for user input I have some questions, suggestions for TestController.

I was hoping for ideas that was easier to do. But I like your idea and will see if I can do it some way.

Thinking about it, maybe you can already do it with the Math channels and the deviceRead() function. Only issue is that this will not run in parallel with all the other polls, but first be performed after they are finished. This means it will reduce the fastest logging rate.

Please report back if it works.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #958 on: August 01, 2020, 10:12:21 pm »
I am willing to try, but I am having difficulty finding documentation on deviceRead().  I even went so far as to Google search your site for deviceRead via
site:lygte-info.dk/ deviceRead
and no pages came up.  I need a little help with what you meant by the deviceRead() function.

Did you mean create a Math channel that uses a script variable in it?
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Program that can log from many multimeters.
« Reply #959 on: August 02, 2020, 05:32:54 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.

(Attachment Link)

Has anybody tested the Kunkin KP184 device file, please let me know if it works so HKJ can add it to the next release.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #960 on: August 02, 2020, 06:08:54 am »
I am willing to try, but I am having difficulty finding documentation on deviceRead().  I even went so far as to Google search your site for deviceRead via
site:lygte-info.dk/ deviceRead
and no pages came up.  I need a little help with what you meant by the deviceRead() function.

Sorry about that, the only place where it is mentioned is probably the "Test interface" popup.
The format is deviceRead(deviceHandle,scpiCommands) i.e. something like: deviceRead("AKD2G","AXIS1.MOTOR.TEMP?")

Did you mean create a Math channel that uses a script variable in it?

Instead of using a formula based on the other channels, simply use the deviceRead(). A math channel can only return one value.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #961 on: August 02, 2020, 03:27:37 pm »
HKJ,

I am working on trying your Math channel suggestion.  At first I could not get it to work at all because of errors.  Most of the returned values from device AKD2G are number followed by the units in []'s.  For example, motor speed variable AXIS1.VL.FB? returns "123 [rpm]".  Returns in this format for deviceRead() cause Java errors like:
           dk.hkj.vars.VarExceptions$ConversionException: -0.079 [V] could not be converted to double
and caused TestController to turn that Math Channel off and only report 0 for value's.  Using AKD2G device variables that returned numeric values only (no units) seemed to work. 

For the #askValues line I had to use #askValuesReadFormat fxfxfx to get the numbers to work for logging.  What would be the equivalent for the deviceRead() command?  Hopefully I don't have to add readMath to each SCPI command for this device to remove the asci units characters and always only return the number.  Having units come back should be useful somehow.

If this Math channels device(Read) method ends up working that will be a great solution to my suggestion.  The only extra step would be a way to specify the Math channels in a script.  Can that be done?

Just out of curiosity, where is the "Test interface" popup that has info on deviceRead?  The popup on the Math tab provides info on functions that can be used in the formula but I did not see deviceRead() there.


 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #962 on: August 02, 2020, 04:30:24 pm »
I am working on trying your Math channel suggestion.  At first I could not get it to work at all because of errors.  Most of the returned values from device AKD2G are number followed by the units in []'s.  For example, motor speed variable AXIS1.VL.FB? returns "123 [rpm]".  Returns in this format for deviceRead() cause Java errors like:
           dk.hkj.vars.VarExceptions$ConversionException: -0.079 [V] could not be converted to double
and caused TestController to turn that Math Channel off and only report 0 for value's.  Using AKD2G device variables that returned numeric values only (no units) seemed to work. 

For the #askValues line I had to use #askValuesReadFormat fxfxfx to get the numbers to work for logging.  What would be the equivalent for the deviceRead() command?  Hopefully I don't have to add readMath to each SCPI command for this device to remove the asci units characters and always only return the number.  Having units come back should be useful somehow.

There are a couple of ways to do it, one is:
getMatch(deviceRead(...),"[-.0-9]+");

If this Math channels device(Read) method ends up working that will be a great solution to my suggestion.  The only extra step would be a way to specify the Math channels in a script.  Can that be done?

Yes, use the #math command. The help window will show format when you type it.

Just out of curiosity, where is the "Test interface" popup that has info on deviceRead?  The popup on the Math tab provides info on functions that can be used in the formula but I did not see deviceRead() there.

It is in the "Popups" on the command page.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #963 on: August 02, 2020, 05:45:38 pm »
HKJ,

Using the #math statement in a script sounds great.  However, I can't seem to get any variation of the syntax to work.  I tried a number of variations of the syntax and all of them yielded failed error messages.  Below are some example attempts cut and pasted from the log window on the Commands tab.

   #math FB3_Sin V Formula - getMatch(deviceRead("AKD2G","FB3.SIGNALCOS?"),"[-.0-9]+") failed due to For input string: "-"
   #math "FB3_Sin" "V" "Formula" "-" "getMatch(deviceRead("AKD2G","FB3.SIGNALCOS?"),"[-.0-9]+")" failed due to For input string: "-"
   #math {"FB3_Sin" "V" "Formula" "-" {"getMatch(deviceRead("AKD2G","FB3.SIGNALCOS?"),"[-.0-9]+")"}} failed due to For input string: "-"
   #math {"FB3_Sin" "V" "Formula" "" {"getMatch(deviceRead("AKD2G","FB3.SIGNALCOS?"),"[-.0-9]+")"}} failed due to For input string: """"

No matter which syntax variation I tried it seemed to have issues with the "samples" input in the prototype list #MATH {name {unit type samples sourceFormula}} from the help window.  Leaving the "samples" out of the list did not work either.  Trying that gave no error message but no entry in the Math tab either.

So, I need a little bit more help on legal syntax for this command.  Could you provide a correct syntax example like the one above?

Also, in the Math tab does the "Samples" column have any significance/purpose for the Formula Type?  I am guessing it does nothing.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #964 on: August 02, 2020, 06:24:52 pm »
Using the #math statement in a script sounds great.  However, I can't seem to get any variation of the syntax to work.  I tried a number of variations of the syntax and all of them yielded failed error messages.  Below are some example attempts cut and pasted from the log window on the Commands tab.

You have to specify samples as 0
I will fix that in the syntax to accept -

Also, in the Math tab does the "Samples" column have any significance/purpose for the Formula Type?  I am guessing it does nothing.

Correct, it is ignored.
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #965 on: August 02, 2020, 07:47:30 pm »
HKJ,

Silly me.  I should have thought to try 0 for samples.  I agree it would be a good idea to accept "-" since that is what shows for Formulas in the Math tab.

I noticed that you can't delete a Math if it is enabled.  Is that necessary or could you implicitly disable it and then Remove when the user requests Remove? 

If defining Math logging channels a lot in scripts it would be good to be able to clear all the Math channels with a script statement.  I know that #math with no argument will disable the ones there, but I am concerned about accumulating a large number of Math logging channels.

Based on learning how to use Math channels to log I think the first item in my list was already covered.  Next comes the question of how to add script variables into the logging channels.  Can Math formulas reference script variables?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #966 on: August 02, 2020, 08:09:38 pm »
Silly me.  I should have thought to try 0 for samples.  I agree it would be a good idea to accept "-" since that is what shows for Formulas in the Math tab.

I had fixed it about 5 minutes after I said I would fix it.

I noticed that you can't delete a Math if it is enabled.  Is that necessary or could you implicitly disable it and then Remove when the user requests Remove? 

It is a question about checking. The enable checkmark has some restrictions on when it can be removed and I was lazy when I programmed the delete and only used enable checkmark to check on.
The is also the detail that when a math channel is disabled a column change event must be performed on all pages.

If defining Math logging channels a lot in scripts it would be good to be able to clear all the Math channels with a script statement.  I know that #math with no argument will disable the ones there, but I am concerned about accumulating a large number of Math logging channels.

There is no problem with a lot of defined Math channels and you can remove more than one at a time from the Math page.
But maybe a option to delete a named math channel from script.

Based on learning how to use Math channels to log I think the first item in my list was already covered.  Next comes the question of how to add script variables into the logging channels.  Can Math formulas reference script variables?

Easily, but they must be defined as "globalvar", not only as "var" and you cannot define or change them in the math expression.
In the math definition you can only use one expression, it is not possible to have multiple statetemets with ; between.
« Last Edit: August 02, 2020, 08:14:47 pm by HKJ »
 

Offline gby

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Program that can log from many multimeters.
« Reply #967 on: August 03, 2020, 10:07:28 pm »
HKJ,

I did a test script to set #math to a script variable defined with an =globalvar statement and then incremented that variable in a #while loop.  It seems to work exactly as desired.  However, it was a bit confusing to know whether to put it in ()'s in the #math statement or not.
   #math FtLow - Formula 0 FtLow           works as desired:  log shows incrementing values for script variable
   #math FtLow - Formula 0 (FtLow)        converted the statement to #math FtLow - Formula 0 50 which is a fixed number
In scripts for # commands like #delay you now need ()'s around a variable but for this #math statement you don't.  I don't think it is a big inconsistency, but should be documented.

I am finding it amazing that TestController had the capability that I suggested already.  Just needed to know how  :)

Code: [Select]
; File test creating specific Math log channels via script
; #MATH {name {unit type samples sourceFormula}}

=var stepTime=0.5
=globalvar FtLow=50

; First disable existing Math channels by calling #math with no arguments
#math

#math FtLow - Formula 0 FtLow

#log (stepTime)

#while (FtLow<100)
#delay (3*stepTime)
=FtLow=FtLow+1
#endwhile

#log 0
="Done"
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #968 on: August 04, 2020, 04:31:31 am »
   #math FtLow - Formula 0 FtLow           works as desired:  log shows incrementing values for script variable
   #math FtLow - Formula 0 (FtLow)        converted the statement to #math FtLow - Formula 0 50 which is a fixed number
In scripts for # commands like #delay you now need ()'s around a variable but for this #math statement you don't.  I don't think it is a big inconsistency, but should be documented.

The # command use there parameters textually (Conditional statements excluded), except if you have parentheses, then that part is evaluated before the command is executed. I have mentioned it a few places in the documentation.
In Math, the calculator and after a = you are directly invoking the evaluator that will handle expression.

I am finding it amazing that TestController had the capability that I suggested already.  Just needed to know how  :)

I try to keep the possibilities in TestController fairly open, but still easy to use without needing advanced programming skills.

Try check the #HasLogged command, it is designed for synchronizing scripting with logging.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #969 on: August 04, 2020, 06:22:04 am »
V1.07 is up
This has some improvement to scripting and a significant UI improvement (Restoring layouts)
   Added: #AlignGrid command, it will adjust nearly all open windows/popups onto a grid
   Fixed: Loaded files did not find unit on math channels
   Added: #SaveTable command to save all logged data
   Added: #LoadTable command to load previous logged date
   Added: #ScaleDelete command, this makes it possible for scripts to reduce the clutter on the "Scales for chart" list
   Added: #Scale command to define or change a scale from script
   Changed: Some # commands has been slightly adjusted, I do not believe they will be incompatible with old scripts
   Added: #MathDelete deletes one or more math entries
   Fixed: Script cannot modify used math entries while logging anymore
   Changed: Enabled Math entries can be delete, as long as no logging is running.
   Changed: Redefined "Load and run" button to load scripts into log window, except if script start with #autorun
   Fixed: Some multithreading issues in the user interface and scripts
   Added: Automatic add setup script to menu
   Added: Generating of setup script
   Added: Advance log can directly set above/below conditions without an expression

The main idea is that you can start here:


Do a right click and a left click and end up here (Another right/left click and you could be back to the starting point or another layout):


It is, of course, possible to copy part of (or all) the generated script into your own test scripts.

This is done with a script that is accessible in a right click menu. To generate a script use:


It is possible to edit the script to only include some of the configuration and there is no limits on the number of configuration scripts that can be in the menu.


The "Save as menu and edit" function can also be used to add you own script to the menu (This can be done manually also). When the editor opens change the title after "#scriptMenu" (Especially get rid of the Setup word) and replace the script with your own script. The #autorun keyword means autostart when selected, if removed the script will be copied into the log window instead.

« Last Edit: August 04, 2020, 06:49:36 am by HKJ »
 
The following users thanked this post: tubularnut, Marco1971

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #970 on: August 04, 2020, 11:45:12 am »

Code: [Select]
; File test creating specific Math log channels via script
; #MATH {name {unit type samples sourceFormula}}

=var stepTime=0.5
=globalvar FtLow=50

; First disable existing Math channels by calling #math with no arguments
#math

#math FtLow - Formula 0 FtLow
...

I played a bit with your script and found one serious issue. TestController will recalculate the table with enabled math channels and that spoils the result. The initial recalculation will be removed in next version, but if you do anything on the math page another recalculation will spoil it.
Fortunately I have implement a function to get rid of a math channel again (As you asked about) and using that before stopping the script will prevent recalculation later on. [/code]
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #971 on: August 04, 2020, 05:23:24 pm »
I looked more on the problem with updates and I believe that the best solution is a Math type that works like a "Formula" type, but will prevent recalculations of a table. This will then be the ideal type to use for extra data channels from a device or from variables in TestController added with Math channels.

Just now I call it NoUpdate, but it is not really a good name. Some other ideas I had was "NoRecalc" or "Original"
But neither is perfect.
If anybody has a good idea for a "Formula" type that block for refreshing data in a table to preserve the original result, please post it.
 

Offline jmurray

  • Contributor
  • Posts: 38
  • Country: au
Re: Program that can log from many multimeters.
« Reply #972 on: August 05, 2020, 01:28:35 am »
I'm not super familiar with SCPI as, like many others I presume, I get so far each time and give up because I can't find any program that works/is easy enough.

This looks great. I've tested it with my U1282A and it works just fine.

I have a small issue though. I'm trying to use with an "East Tester" ET5410 Electronic Load.

I keep getting "<Invalid device>".

From what I can tell, TestController is looking for the #idString to match the first two fields of the response to the *IDN command - is that correct?

Unfortunately, this ET5410 responds to the *IDN command with space-delimited fields, rather than comma-delimited. I suspect that is rendering TestController unable to match the strings to that in the definition.

I have tried changing the #idString in the definition text file to the entire *IDN response, followed by two commas, but that hasn't worked either.

Is there a simple work-around that I'm not seeing?
 

Offline jmurray

  • Contributor
  • Posts: 38
  • Country: au
Re: Program that can log from many multimeters.
« Reply #973 on: August 05, 2020, 02:49:28 am »
I'm not super familiar with SCPI as, like many others I presume, I get so far each time and give up because I can't find any program that works/is easy enough.

This looks great. I've tested it with my U1282A and it works just fine.

I have a small issue though. I'm trying to use with an "East Tester" ET5410 Electronic Load.

I keep getting "<Invalid device>".

From what I can tell, TestController is looking for the #idString to match the first two fields of the response to the *IDN command - is that correct?

Unfortunately, this ET5410 responds to the *IDN command with space-delimited fields, rather than comma-delimited. I suspect that is rendering TestController unable to match the strings to that in the definition.

I have tried changing the #idString in the definition text file to the entire *IDN response, followed by two commas, but that hasn't worked either.

Is there a simple work-around that I'm not seeing?

Nevermind, found the Korad definition file referred to in the release notes and found the work-around!

Is there any way to view the release notes other than rolling back to a previous version of the software? Could not see a readme file or anything on the website.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3038
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #974 on: August 05, 2020, 04:19:35 am »
Is there any way to view the release notes other than rolling back to a previous version of the software? Could not see a readme file or anything on the website.

I have not posted the release notes on my website, but you can find them in this thread and here they usually contains more explanation.

I hope you post the definition when you get it working (Remember the #author tag).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf