07-28-2009 06:26 AM
Hello,
I am novice and I would know if it's possible to program a test with a script (I don't know with what kind on script, I search the best way).
I want that this script execute a test with labview, for example a script (with values in an excel file etc...) wich will command a motor for automatics tests.
I don't know if it's possible and how do this kind of scripts, I want that people (that doesn't know labview)modified a script onl, and the script execute a labview automatic test, with parameters defined in the script.
Bye.
07-28-2009 06:47 AM
It is certainly possible to write LabVIEW code to run a script - it has been done many times.
I recently develop a system of Queued Message Handler Test Blocks that import a .xml to perform a set of tests. The .xml file is derived from a excel spreadsheet. The Test Engineer "programs" the test on the excel worksheet(s) then creates a TestStand sequence to call the individual test blocks and associated configuration (Test) files.
A note of caution - this is not a trivial programming exercise. A lot of planning and coding is required before any DUT testing can begin. This can aid the Test Department as the Test Engineers do not have to know LabVIEW to develop a test.
07-28-2009 07:06 AM
07-28-2009 07:08 AM
I haven't TestSand, it's for an internship, I have all my blocks to generate DC voltage, measurement, CAN communication etc... and I would find a ( simple) mean to enter parameters in an excel file etc (for the basic solution...), and the parameters could be read by labview to execute a test defines with the blocks.
I saw that there is some script based on xml but I don't the possibilities of this kind of scripts, maybe I think it exist script based on C, but I don't know if this script can controled my VI, if it's if it's the better solution...
07-28-2009 07:34 AM
Hi muks, I saw your link, I think it's a good program, it would be a good solution but ... the scripts will be re use by people that don't know labview... or that they haven't labview necessary on their computer, they just modified the script and send the script to an other person which execute the script with the labview program to launch an automatic test.
I don't think that Labview Scripting it's a good solution, what is the language XML ?
07-28-2009 08:02 AM
I use a Table to hold the LabVIEW commands.
You need to:
1.) Define the keywords the LabVIEW will execute.
2.) Create a Queued Message handler to perform your tests.
3.) Read the Table row-by-row and perform the actions required.
for each Row load the Queue with the states needed to perform an action.
Here is a very simple example:
Keyword Device Alias Action Value Result States
Setup DMM DMM1 Function DC Volts DMM Config, Idle
Setup DMM DMM1 Range 100.0 DMM Config, Idle
Read DMM DMM1 24.01 Read Dmm, Display, Idle
Log Result Save Data
07-28-2009 08:40 AM
ok I will try to do that 🙂
thank you
07-29-2009 02:45 AM
Hello VADave,
I want to better understand your example, I don't understand why do you use a key word in your row because you have the state, the actio, the value etc...
If I want to write a small test that turn on a motor (START), check a voltage (ANALYZE) and then turn off the motor (STOP):
keyword Device Alias Action Value Result States
Setup ? ? function DC volt START
Setup ? ? range 10.0 START
Read multimeter ? 10.0 ANALYZE
stop ? ? STOP
Is it right? I think that I have not well understand how the system pass at an other state...
07-29-2009 09:14 AM
As pointed out in the new thread you started, what you need to do is to create a state machine to run your script's actions.
How you parse the script is completely up to you based on how you define the format of the script. If you choose to use XML, then you have to decide whether to use the LabVIEW XML schema (which is documented in the LabVIEW Help) or your own. If you use your own, then reading the XML file will depend on which version of LabVIEW you have. If you have 8.6 then you can use the XML parser that comes with LabVIEW. If not, then you need to use third-party XML VIs such as LabXML or JKI's Easy XML.
07-29-2009 09:33 AM
ok I have a state machine on a paper so I should program my state machine on Labview and give the parameters with XML files? Or Can I create a state machine in the XML file?
An other question, what is the advantage to choose the labview schema, I saw it, I understand that he define attributes for structures but I haven't really understand what is the model or how can I use it...
Thanks a lot for your previous answers.