Author Topic: Test controller Scripting  (Read 1708 times)

0 Members and 1 Guest are viewing this topic.

Offline DreddiTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Test controller Scripting
« on: January 03, 2023, 06:16:45 am »
I'm new to EEVblog but I've been watching the videos for years now and somehow just stumbled onto the forum in search of Test Controller and some help. This will likely be a very easy one for most of you.

I'm running Test Controller and I need a custom script for a battery conditioning process. I've done a fair bit of basic programming but I'm completely unfamiliar with the language used for scripts here.

what I need is a simple script that will calculate and set different current settings and terminate the cycle based on current.
Example:
Calculate step 1 discharge voltage (Nominal voltage/1.2) = step 1 terminate voltage.
Calculate step 1 discharge current (Nominal capacity/C1) = step 1 current.
set step 1 cutoff voltage and current.

Once step 1 voltage has been met switch to constant current until some additional step values are met and switch to another mode/value.

I'm using an East Tester ET5410A+ and so far I'm enjoying it and the Test Controller software. I just can't locate a resource so far that will help me understand how to implement my script. I've been over most of the info here in the forum but I can't find enough. Perhaps someone has or knows of a "how-to" for scripting?
 

Offline BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: us
Re: Test controller Scripting
« Reply #1 on: January 03, 2023, 04:28:41 pm »
The unit support SCPI language and you can find information about SCPI online but I can't find its specific instruction set. It wouldn't support all commands available in SCPI I don't think so. Also I do not know the baud rate, parity etc... of the unit.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3367
  • Country: nl
Re: Test controller Scripting
« Reply #2 on: January 03, 2023, 05:06:37 pm »
I'm wondering why you even bought the thing without checking out it's programming interface.

I agree with BeBuLamar that it probably talks SCPI over it's USB interface (I assume it's CDC class).
https://en.wikipedia.org/wiki/Standard_Commands_for_Programmable_Instruments

Best I know "basic" is obsolete. In these modern times Python seems to be the goto scripting language, and there are Python libraries to work with SCPI commands.

You can start by looking at your PC's USB ports of how this device identifies itself. If it identifies as a CDC class device you can very likely start a generic terminal emulator to connect to it (I liked TeraTerm Pro in my windoze days) and then send some SCPI formatted text strings to it.

It's also quite possible that this work has already been done and that there are repositories for this device on those source code sharing websites.

Edit:
It took me about 30 seconds to find the document below.
It confirms (on page 17) that it uses SCPI, and that it uses CDC (Communication Device Class = Serial over USB).
https://www.easttester-cn.com/uploads/ET5410-ET5411-Programmable-Single-DC-Electronic-Load-User-Manual.pdf
« Last Edit: January 03, 2023, 05:12:21 pm by Doctorandus_P »
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Test controller Scripting
« Reply #3 on: January 06, 2023, 01:48:43 pm »
what I need is a simple script that will calculate and set different current settings and terminate the cycle based on current.
Example:
Calculate step 1 discharge voltage (Nominal voltage/1.2) = step 1 terminate voltage.
Calculate step 1 discharge current (Nominal capacity/C1) = step 1 current.
set step 1 cutoff voltage and current.

There is some description of the TC language on the online help pages, you can press F1 in TC to open them (On most computers).
There is also some examples on how to write scripts.
The main TC thread is here: https://www.eevblog.com/forum/testgear/program-that-can-log-from-many-multimeters/

Generally TC has two programming modes, but they are intertwined. One mode is scripting mode where all commands start with # and expressions with =
Expressions are handled in the "Program" mode, that uses a expression syntax similar to C and Java.
You can access values from connected devices by the names shown on the "Current Values" tab.
To store values you must create variables, i.e.

=var termVolt=ET5410A.Voltage/1.2;

To set a value there a multiple options:

Use the "Setup" popup and set a value, the right click on the log, select "Generate script", "Mode & Setup", "In log Window", this will give you the command for the device and you can replace the value with (termVolt) to instead use the variable, note () will give access to the variables and the programming language in script commands.
Another possibility is to use the programming command (=set...).

There is no guarantee exactly what settings are supported either way, that depends on who has implemented the device and what the device supports.

When the popup "Log event" is open and filled, a script can be generated with the same functionality from the "Generate script" menu. This is a easy way to start on a script.
 

Online dobsonr741

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: Test controller Scripting
« Reply #4 on: January 06, 2023, 03:36:04 pm »
The SCPI specs were posted here on Eevblog. Get yourself a Jupyter notebook, pyvisa, and get the measurements going!

BTW, the tread: https://www.eevblog.com/forum/testgear/east-tester-et5410-et5420-et5411-et54-series-software/
 

Offline BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: us
Re: Test controller Scripting
« Reply #5 on: January 06, 2023, 10:40:03 pm »
Is this controller capable of running a script on its own or you have to have a computer or something to send the SCPI commands and the script would have to run on a PC or something like that?
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Test controller Scripting
« Reply #6 on: January 07, 2023, 05:44:33 am »
Is this controller capable of running a script on its own or you have to have a computer or something to send the SCPI commands and the script would have to run on a PC or something like that?

TestController is a PC program, that can run on Windows/Mac/Linux. It can control, collect and show data from multiple devices.
 

Offline BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: us
Re: Test controller Scripting
« Reply #7 on: January 07, 2023, 01:21:57 pm »
Thank you!
Now I know. I am not familiar with the Test Controller software but I think it's easy enough to write a PC program to control the East Tester device. The only problem I see is that the manual doesn't list whih SCPI commands the device supports. Without that one has to do a trial and error sending out SCPI commands and see if the device would response to.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Test controller Scripting
« Reply #8 on: January 07, 2023, 01:51:13 pm »
Thank you!
Now I know. I am not familiar with the Test Controller software but I think it's easy enough to write a PC program to control the East Tester device. The only problem I see is that the manual doesn't list whih SCPI commands the device supports. Without that one has to do a trial and error sending out SCPI commands and see if the device would response to.

It might be, but you do not get all the features of TC.
Take a look at the homepage for TC to get a idea of what it can do: https://lygte-info.dk/project/TestControllerIntro%20UK.html
It supports well above 400 different devices. and can handle multiple of them simultaneous.

To do "once of" testing, you do not need to do any scripting, but if you want to run the same test many times doing a script will save your time and reduce the probability for errors.
« Last Edit: January 07, 2023, 01:56:08 pm by HKJ »
 

Offline BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: us
Re: Test controller Scripting
« Reply #9 on: January 07, 2023, 01:56:29 pm »
I don't say to have all the features Test Controller software does but to do exactly what the OP wanted to do.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Test controller Scripting
« Reply #10 on: January 07, 2023, 07:43:40 pm »
I don't say to have all the features Test Controller software does but to do exactly what the OP wanted to do.

He probably also wanted to log the data and maybe show a curve while doing the test, functions that are included in TC.
It is no problem to program that, but it takes time and some work to do it, using scripting in TC takes some learning (TC can help you write the scripts), but then you get all of that and a lot more.
 

Offline DreddiTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Test controller Scripting
« Reply #11 on: January 08, 2023, 07:37:38 am »
what I need is a simple script that will calculate and set different current settings and terminate the cycle based on current.
Example:
Calculate step 1 discharge voltage (Nominal voltage/1.2) = step 1 terminate voltage.
Calculate step 1 discharge current (Nominal capacity/C1) = step 1 current.
set step 1 cutoff voltage and current.

There is some description of the TC language on the online help pages, you can press F1 in TC to open them (On most computers).
There is also some examples on how to write scripts.
The main TC thread is here: https://www.eevblog.com/forum/testgear/program-that-can-log-from-many-multimeters/

Generally TC has two programming modes, but they are intertwined. One mode is scripting mode where all commands start with # and expressions with =
Expressions are handled in the "Program" mode, that uses a expression syntax similar to C and Java.
You can access values from connected devices by the names shown on the "Current Values" tab.
To store values you must create variables, i.e.

=var termVolt=ET5410A.Voltage/1.2;

To set a value there a multiple options:

Use the "Setup" popup and set a value, the right click on the log, select "Generate script", "Mode & Setup", "In log Window", this will give you the command for the device and you can replace the value with (termVolt) to instead use the variable, note () will give access to the variables and the programming language in script commands.
Another possibility is to use the programming command (=set...).

There is no guarantee exactly what settings are supported either way, that depends on who has implemented the device and what the device supports.

When the popup "Log event" is open and filled, a script can be generated with the same functionality from the "Generate script" menu. This is a easy way to start on a script.

Thank you all for responding.

HKJ - Your input here has helped fill in a few major holes I had in the understanding. I cannot that you enough! Are you aware of any extensions I can use in Visual Studio Code that would allow me to run and debug in a test environment? I didn't realize the F1 short-cut was an option. I will be doing that reading. I also can't believe there isn't a donation system setup for TC or at least one I've been able to find. The amount of use I've gotten from it and the number of things its capable of is absolutely something I would be happy to pay into.

To everyone else;

Thank you and to clarify, Test Controller is the PC software I'm using to control my DC load with my computer and its fantastic. I am using it primarily to do voltage and current logging along with its already implemented DC Load control functions. The load I'm using accepts standard SCPI commands and I have the document from the manufacture on how to utilize them, but those are the commands TC outputs to the device, not used inside the TC environment. TC is capable of a lot more than just simple device control and logging and I'd like to use it to control my DC load to do a very specific NiCd battery pack conditioning process and follow-up testing. In order to make the process automatic I'm looking to write a script for TC to run for me.

I want to be able to take the nominal battery voltage and capacity from the pack data plate and enter those values into TC. TC will then calculate the various voltage and current settings and monitor and make changes as needed and send the appropriate SCPI commands to my DC load. I can then let an untrained person execute the process by simply reading the battery data plate. I'm just trying to wrap my head around the specific language used in TC to write the needed scripts. I'm used to editing post-processors for CNC CAM milling and this is obviously a tad different.
 

Offline HKJ

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Test controller Scripting
« Reply #12 on: January 08, 2023, 08:33:51 am »
HKJ - Your input here has helped fill in a few major holes I had in the understanding. I cannot that you enough! Are you aware of any extensions I can use in Visual Studio Code that would allow me to run and debug in a test environment? I didn't realize the F1 short-cut was an option. I will be doing that reading. I also can't believe there isn't a donation system setup for TC or at least one I've been able to find. The amount of use I've gotten from it and the number of things its capable of is absolutely something I would be happy to pay into.

The language is exclusive to TC and you will not find any external tools for it.

Here is a bit of code to ask for parameters, the last line will print the two values. The code can be copied directly to the log window and run (For regular use I will recommend to save as menu):
Code: [Select]
#logcmds 0
=var packVolt=5
=var packCap=1
#popupInit "NiCD condition"
#popupNumber "Pack voltage" packVolt 1 15 "Rated voltage of battery pack"
#popupNumber "Pack capacity" packCap 1 20 "Rated capacity of battery pack"
#popupButtons Start ok Abort
#popupShow
#if !ok
="Test aborted"
#return
#endif
=var termVolt=packVolt/1.2;
=var dischargeCurrent= packCap;
=termVolt+"  "+dischargeCurrent

For the pack voltage using the #popupcombo statement will give you the possibility of a selection list instead of a number input.

At the bottom of the main web page (Just above the download links) there is a email address that can be used for donations.


I will recommend using the "Log Event" popup and "Generate script" function to make the initial charge and discharge scripts, you can then edit them and replace fixed values with variables.

Also note that TC has build in documentation for all script commands (i.e. anything starting with #), just type it on the command line to get the help.

« Last Edit: January 08, 2023, 08:39:13 am by HKJ »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf