NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute two steps in parallel?

Solved!
Go to solution

I've always used sequential execution, but now have a situation that two steps need to be run in parallel (one step sends data to a device and other step shut off device's power after some delay).

How it can be implemented in TestStand?

0 Kudos
Message 1 of 9
(9,100 Views)
Solution
Accepted by Sergey_Kolbunov

I've attached a simple example in TS 4.1.1.

 

Basically put one of the steps that will do an operation in a subsequence and call that sequence in a new thread.  In the sequence call step settings you will see the Execution Options.  Use New Thread!

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 9
(9,092 Views)

jigga,

 

I was hoping you could help with a very similar problem. The "step that will do the operation" which I have in a sub-sequence is a count up timer. I do have an input control (boolean) for this step for closing, and an output status (true, when running). This count up timer is controlled by a user button (in labview), the input control I previously mentioned. My problem is when I launch in a seperate thread, I will eventually need to close it when the other tests complete. But I need to do this programmatically as the test currently will not end until the user presses the input control of the count up timer step. So basically, how do I call this seperate thread (use new thread when launched) to close it at the end with a TRUE for the input control on the step (count up timer) to close the VI. I'm still new to TestStand, so any help would be appreciated.

 

Thanks in advance to anyone who can help.

 

Best Regards,

 

Chazzzmd

0 Kudos
Message 3 of 9
(8,888 Views)

Chazzzmd,

 

Let me see if I understand your question:  Basically you have 2 threads.  Let's call them T1 and T2.  Let's say that T1 is your main thread and T2 is the one you spawn.  So T1 is going along and then it spawns T2, which contains a counter written in LV?  Then T1 continues with some operations while T2 displays a VI which has buttons the user can click on.  If T1 gets to a certain point and the VI isn't done or the user hasn't clicked on those buttons then you want T2 to kill the VI and then T2 will die so that you now only have one thread T1.  Is this correct?

 

The trick is knowing how to access information in TS from LV.  When you installed TestStand it created some palettes in LV which are specific to TestStand.  On the block diagram in the TestStand palette you will find a GetProperty and SetProperty VI.  This allows you to access local and global variables of TestStand.  So basically T1 can set a global variable to True.  Then you can use this GetProperty VI to watch that variable.  When it goes high you can exit the loop.  The trick with all of this is passing in the sequence context.  And passing the correct sequence context is key.  You need the sequence context from T1.  So when you spawn the thread you will have to pass it to the subsequence and then pass that into the VI.  When I get home on my own time I can create an example.  Let me know if this is what you are looking for.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 9
(8,885 Views)

Jigg,

 

Thank you for the quick follow up. Yes, I believe what you mentioned is what I'm trying to accomplish, although it is in a way I wasn't expecting. I was hoping to handle everything in TS. But I'm all for learning something new!

 

I will see if I can get anywhere with your response, if not I'll wait for your follow up.

 

Thanks again, and have a great weekend.

 

Chazzzmd

0 Kudos
Message 5 of 9
(8,883 Views)

What versions of TS and LV are you using?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 9
(8,881 Views)

I threw together a quick example of 1 way you can do it.  Check it out and let me know if you have questions.  You may have to relink the VI.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Download All
Message 7 of 9
(8,869 Views)

BTW,

 

4.5 TestStand

 

10.0 LabView

 

I will try your example hopefully sometime this weekend fromt he house.

 

Thanks again,

 

Chazzzmd

0 Kudos
Message 8 of 9
(8,866 Views)

Jigg,

 

Thanks for the attached example, it worked like a charm this morning. Always love learning something new.

 

Thanks again,

 

Chazzzmd

0 Kudos
Message 9 of 9
(8,841 Views)