NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting a seperate thread

Hi Everyone,

Is there a way to kick off a timer in TS 4.1 and still continue ( testing) on in a sequnce??  My requirement is to start a timer, then start the test, which is to look at temp ( I'm using LV Prototype adapter) until a certain temp is reached.  I then have to go to the timer I started in the begining and make sure its less than a certain amount of time.  Don't know how to start then stop a seperate thread.  If thats the way to go.  I also have to terminate the test ( in this sep thread ) if more than say 20 mins passes and I haven't reached the required temp.

I'm thinking ( since I'm familiar w LV) to create a VI with a timer in it.  Have TS call it then continue testing the temp ( again using LV) but how??

Thanks,

 

Clint E.

0 Kudos
Message 1 of 6
(3,805 Views)

Clint,

 

you can start a new thread using a sequence call step. But there is another point i want you to think about:

TestStand tracks the time needed for a step by default. So if your "wait function" is included in a single module, you can leave the module if the given temperature is reached. Then you can check the time the step needed which called the module.

But please note that this methods blocks the execution of your system for all that time. So you cannot terminate the execution in between. => Danger of hang because if the temperature is never reached (defective sensor/heating unit).

In that case, maybe calling a control VI in a loop would be a solution and the time is the sum of the time for all steps executed in this loop.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,791 Views)

So it sounds like I'm still better off w my idea of a seperate thread (s.t.) .  Can't I start the timer.vi  s.t., run my temp test vi then pass something to the timer.vi  s.t. to stop it and have it pass back the amount of time it was running??  I remember doing something like this before but can't remember how.

Clint

0 Kudos
Message 3 of 6
(3,785 Views)

Client,

 

you can run a VI using the "Run VI Asynchronously" Step in the LV Utility stepgroup in order to achiev this. If the timing matters only in the LV code at all, you could also start your timer in your "Init temperature acquisition" and stop it in the VI used to determine the moment when the temperature is reached. Just pass the timing back to TestStand using parameters of your VI if you need that information in e.g. the report.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,783 Views)
Thanks!  I found my old code and going to see if I can modify it for my current project.
0 Kudos
Message 5 of 6
(3,780 Views)

I can think of a couple ways to do this also...

 

1) Depending on how accurate the timer needs to be, you could have a step that calls a LabVIEW VI that simply gets the current time and passes it to TestStand (say, locals.time1). You could then run that same VI again after your temperature reading has completed and pass the current time to TestStand again (locals.time2). Subtract locals.time1 from locals.time2 and you will have one way of telling about how long it took to go through your steps that read temperature.

 

2) If your code that checks the temperature is in one step, you can check the total time or start time for the step. You can check Locals.ResultList[i].TS.TotalTime (or StartTime) after the step completes to determine how long the step took.

 

Based off of the information you gave me one of these methods might work. If you have any concerns or questions, let me know.

 

Corbin H.

AE - NIC

0 Kudos
Message 6 of 6
(3,746 Views)