LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programmatically insert steps from the Setup to Main section in Teststand?

During the sequence setup, I would like to programmatically create and insert a varying number of pass/fail tests in the main part of the sequence based on input from a LabVIEW VI.  I plan to read in different parameters (test name, input values to the test VI, etc.) for how ever many tests I am performing and then create these tests in the main section.  What is the quickest way to perform this?

0 Kudos
Message 1 of 9
(4,035 Views)

"VADrew" <x@no.email> wrote in message news:1173985811056-492553@exchange.ni.com...
During the sequence setup, I would like to programmatically create and insert a varying number of pass/fail tests in the main part of the sequence based on input from a LabVIEW VI.&nbsp; I plan to read in different parameters (test name, input values to the test VI, etc.) for how ever many tests I am performing and then create these tests in the main section.&nbsp; What is the quickest way to perform this?


If you by mean "quickest way" the fastest way to develop it, you should have a look at NI's Teststand. It's a complete sequencer, that is capable of what you describe and a lot more. It's often used for plant wide test facilities, so it might be a bit oversized.


Otherwise, you can make a framework with VI Server. You typically dynamically load a vi by it's name or path, and fill in it's inputs dynamically. Then you can run the vi and read the outputs dynamically. If you are a beginner, the teststand solution might even be cheaper.


Regards,


Wiebe.
0 Kudos
Message 2 of 9
(4,030 Views)

"Wiebe@CARYA" <wiNOebe.walsSPtra@carAMya.nl> wrote in message news:45fa5e46$1@PYROS.natinst.com...


"VADrew" <x@no.email> wrote in message news:1173985811056-492553@exchange.ni.com...
During the sequence setup, I would like to programmatically create and insert a varying number of pass/fail tests in the main part of the sequence based on input from a LabVIEW VI.&nbsp; I plan to read in different parameters (test name, input values to the test VI, etc.) for how ever many tests I am performing and then create these tests in the main section.&nbsp; What is the quickest way to perform this?


If you by mean "quickest way" the fastest way to develop it, you should have a look at NI's Teststand. It's a complete sequencer, that is capable of what you describe and a lot more. It's often used for plant wide test facilities, so it might be a bit oversized.


Otherwise, you can make a framework with VI Server. You typically dynamically load a vi by it's name or path, and fill in it's inputs dynamically. Then you can run the vi and read the outputs dynamically. If you are a beginner, the teststand solution might even be cheaper.


Regards,


Wiebe.


Never mind. The title was truncated, so I didn't read it all. It didn't mention teststand in the message, so my response is a bit weird.


Regards,


Wiebe.
0 Kudos
Message 3 of 9
(4,027 Views)
I was able to programmatically insert steps by modifying an example VI that only inserts a single step (I just put a FOR loop around the section that inserts the step).  I am able to pass any length array of names (read in from a tab delimited Excel spreadsheet), and the VI populates a sequence file (the path for which is an input) with Pass/Fail tests with those names.  This works well when I run it only in LabVIEW, but when I try to call it from TestStand it causes TS to freeze.  Does anyone know what I need to do to prevent TS from freezing?  Also, if anyone knows an easier way to insert steps (maybe avoiding having to call a VI in the first place) please share.

Thanks,
0 Kudos
Message 4 of 9
(4,026 Views)
Hi VADrew,

It's probably hanging because you are attempting to access the Engine object inside of the VI. If you only get the reference to the run-time copy of the SequenceContext it shouldn't hang. For more info and examples on doing this see here.
Test Engineer - CTA
0 Kudos
Message 5 of 9
(4,010 Views)
Hi VADrew you can also add the step direcly in TestStand using the api, here is an example
Best regards
Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 6 of 9
(4,001 Views)
Thanks for all the help, I have successfully been able to programmatically create steps using either LabVIEW or the TestStand API (I ended up going following the Sequence Builder Tool example).  Now I am having difficulty figuring out how to change specific test step inputs (inputs to the VI that is being called by the test step).  For example, I have a VI with inputs of Test Name, Input Power, Input Frequency, and an output Pass/Fail indicator.  I also have a tab-delimited Excel spreadsheet listing several tests, each with a name, frequency, and power.  I am able to create and name a test step for each of the tests listed in the spreadsheet but I am unable to programmatically specify the inputs to each test from the spreadsheet.   Any suggestions?
0 Kudos
Message 7 of 9
(3,974 Views)
VADrew,

You could try using the Property Loader to do this, though I don't know if that would be the best way of doing it. Examples are located on your hard drive in the Program Files\National Instruments\TestStand x.x\Examples\PropertyLoader directory. The reason that it might not work is that the file has to be formatted a specific way. If you are using the same file to dynamically create steps and then load properties for those steps from the same file, Property Loader will not be able to recognize the file format. You would need to split the file into two different ones, one that would be used to create the steps and another to load properties for those steps.
Test Engineer - CTA
0 Kudos
Message 8 of 9
(3,960 Views)
I was able to get this to work another way.  In my template file (from which I clone a template step) I assign local variables (arrays) as inputs to the test VI (the specific array element is selected by another local index variable which is incremented as a post-expression of the step).  I then have a second template file into which I insert the cloned steps that contains local variables of the same name.  In my main sequence, after I have inserted steps into the second template file, I save it under a new name.  I will therefore be calling two sequences from my overall main sequence.  The first sequence will be called to create the second sequence.  I am now trying to figure out how to disable tracing on the first sequence (so that it doesnt trace through each step insertion, etc.) but enable it on the second sequence file (where the actual tests are performed).
0 Kudos
Message 9 of 9
(3,944 Views)