03-12-2013 04:24 AM
Hello
Is there a way to check what named structures are running in the system? For debugging reasons this would be convenient - I wouldn't need to create additional code to check whether my loops are running. One way to archieve that is to try to start loop and check if there is error. This is not a good solution in two ways - firstly, I have to create a table with all possible loops names in my system. Secondly, for a brief moment I start the loop in my "checker" VI, so it cannot be started where it is actually needed.
My second question is the meaning of "Wakeup reason" data node. Documentation says: "Returns an enumerated type with the reason for the execution start of the current iteration. The possible values are 0 for Normal, 1 for Aborted, 2 for Asynchronous wakeup, 3 for a Timing source error, 4 for a Timed loop error, and 5 for Timeout.". This is great, but I can't find any explanations of those values. I think I understand 0, 1, 2 and 3, but I'm unsure when Timed loop error and Timeout occurs.
03-12-2013 05:09 AM
Brainstorming: If you put each loop as a sub-vi you can use vi-ref to get running status. It should work, but i'm not sure, i've never done it. 🙂
/Y
03-14-2013 02:43 AM
Ok Yamaeda, here's the twist: the VI containing timed loops is reentrant and runned using asynchronous call. I keep track of the running instances, but what I need is to check what loops are currently running, just for debugging purposes. To make something like "LV taks manager" 😉 LabVIEW prevents multiple loops with the same name from running simultaneously, so it has to all of them by name. There just might be property or invoke node that I'm not aware of?
03-14-2013 06:31 AM
Dear PiDi!
A LabVIEW task manager that views all running VIs already exists, courtesy of the LAVAG Community. You can find it here.
I also have an additional idea if you want to observe loops specifically. You could create a an FGV that is callable from inside all your loops (timed or otherwise). With every loop name that you register, there's a timer associated. You periodically decrement these timers, and if a timer reaches zero, you remove the name from the list. If a loop runs, it calls the VI and refreshes the timer associated with it.
I've quickly whipped up some example code ofr this FGV, please tell me what you think.
Best regards:
Andrew Valko
NI Hungary
03-17-2013 04:28 PM
Thanks, Andrew. FGV is one possible solution of course 😉 But this way I still need to write my own code and manage "debug"/"production" code. As I said, my reasoning was: if LV knows internally every running loop by name, there might be a way to obtain that knowledge. If there is no way, its ok, I can do it on my own.
My second question about wakeup reason is still untouched though, so there are still some kudos on the table 😄
03-18-2013 03:08 AM
Dear PiDi!
The Wakeup Reasons can be as follows:
Normal -If the loop is being called as normally scheduled
Aborted - Called if the timed loop is stopped externally
Timing source error -There is an error with the timing source selected for the timed loop
Timed loop error - An error in the timed loop structure itself
Timeout - Occurs if the amount of time specified in the timeout occurs before the loop begins execution
Please tell me if something is still left unexplained or unclear. About the loop run check, I'm unaware of any option to access this information, but I'll soop around a bit to see if I can dig up something.
Kind regards:
Andrew Valko
AE Hungary