12-10-2008 09:38 AM
Hi
I need to launch a VI that monitors emergency stop as a background task. The main sequence launches this VI but it doesn’t wait for it to finish, so the execution in the main sequence continues and completes it's execution. And the monitor stays open and the next execution of the main sequence will launch the monitor that already is open.
/Christian
Solved! Go to Solution.
12-11-2008 06:33 AM
Hi,
You can just kill that execution in your clean-up of your main sequence. Store a reference to your back ground task in TestStand so that you can use this in the Terminate method.
Regards
Ray Farmer
12-11-2008 06:56 AM
Hi Ray
Is it possible that you can show me how to store a reference from my back ground task in TestStand so that I can use this in the Terminate method. I have attached an example of my code. The "Heartbeat parallel_2.seq" is the to level sequnece.
Thanks in advance
/Christian
12-11-2008 04:39 PM
Hi Christian,
I have done two things.
1. add a step to terminate the execution.
2. add some monitoring in the VI to exit if the execution is seen to be terminating.
See attached pictures.
This is a solution but I don't like it as it gives the appearance that the sequence has terminated in the results.
Anyway see how you get on with this.
Also instead of running the VI in a Sequence you can launch the VI via the LabVIEW Utility steptype "Run VI Asynchronously".
Regards
Ray Farmer
12-12-2008 03:46 AM
Thanks Ray
It's almost there
Can I monitor the main sequence in the Heartbeat.VI or force the Heartbeat.vi to close from the main sequence when main sequence comes to certain point; without using Terminate. Because, as you also observed it is generating a Terminate dialog and it loges in the report. I only want to use Terminate if an emergency occurred. So when the sequence runs normally it just closes the Heartbeat.vi without any action as Terminate.
/Christian
12-12-2008 04:32 AM
Hi,
(It was getting late when I posted my reply, so the brain had stopped working. )
Yes, a better method would be to use the Synchronzation step type and use a Notification to tell the heartbeat to stop.
I'll have a look at this latter today, if you dont solve it your self in the mean time.
Regards
Ray Farmer
12-12-2008 06:21 AM
Hello Ray
I've taken a totally new approach. I've made sub sequence that is monitoring the Emergency input in a new thread. The sub sequence can terminate execution if needed, and the sub sequence is stopped by using a StationGlobals that is set by the calling main sequence. The disadvantage it that there is nothing visual indicating to the user that the monitor is running or not, but I can live with that
Thanks a lot for your help
/Christian
12-12-2008 02:24 PM
Christian,
You might also be interested in the example here: http://forums.ni.com/ni/board/message?board.id=330&message.id=20875#M20875