05-06-2009 12:04 PM
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.
05-07-2009 02:12 AM
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
05-07-2009 04:38 AM
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
05-07-2009 04:51 AM
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
05-07-2009 04:55 AM
05-08-2009 08:35 AM
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