Omar Mussa Posted July 3, 2008 Report Share Posted July 3, 2008 Is there a way to tell if a VI is executing? I know that I can get the Execution.State property to tell if the VI is 'reserved' for execution (state=running), but is there any way to tell if a VI is actually executing? Quote Link to comment
Karissap Posted July 3, 2008 Report Share Posted July 3, 2008 I'm not sure if there is a property for this, I don't think there is. You could use a boolean indicator on the VI you're interested in that only turns on while the VI is executing, there will be a small delay though. Here's an example Download File:post-8228-1214985256.zip Quote Link to comment
pikapp506 Posted July 19, 2008 Report Share Posted July 19, 2008 I'm not sure about version 8.2, but is there the hightlight execution button on the block diagram of the VI your inquiring about? You may be able to select that and your program would be really slow while executing that particular VI, but you would be able to see if it was running. Quote Link to comment
Omar Mussa Posted July 19, 2008 Author Report Share Posted July 19, 2008 QUOTE (Karissap @ Jul 2 2008, 12:55 AM) I'm not sure if there is a property for this, I don't think there is. You could use a boolean indicator on the VI you're interested in that only turns on while the VI is executing, there will be a small delay though. Ya, I was looking for something that wouldn't require any code modifications to the existing code. QUOTE (pikapp506 @ Jul 18 2008, 12:20 PM) I'm not sure about version 8.2, but is there the hightlight execution button on the block diagram of the VI your inquiring about? I'm looking for a way to do this programatically. Quote Link to comment
Norm Kirchner Posted July 19, 2008 Report Share Posted July 19, 2008 Damn.... this is harder than it seems at first. Quote Link to comment
LAVA 1.0 Content Posted July 20, 2008 Report Share Posted July 20, 2008 QUOTE (Norm Kirchner @ Jul 18 2008, 05:34 PM) Damn.... this is harder than it seems at first. Sure is! If you are looking for gloabl solution that finds which of all of the VI's in memory are running, (note: there maybe more than one running) it seems you would have to interact with the OS's scheduler to do that since LV utilizing the OS to schedule VIs and for that matter the multiple possible threads within each VI. The only other thing that I feel is worth mentioning is the "skip if busy" option availabe for VI's marked as sub-routine. When a subroutine VI is dropped on a diagram, it exposes an option called "skip if busy". This option is the one and only exception to the data flow paradigm in that when that option is selected AND the VI is alredy executing, the sub-VI call will be skipped. If there any return values expected from the VI that was skipped, LV will use the "default" for the data type (Note the default as defined by the sub-VI will NOT be returned since LV would have to access that VI to know that and since its being skipped LV does not know that). So... If the VI in question is structed like an AE you could call it using a "check method" that returns a true boolean. If you try the "check" and it returns false, the VI was skipped because it was busy. Those are the only thoughts I can offer. Anyone else have thoughts on this matter? Ben Quote Link to comment
Omar Mussa Posted July 20, 2008 Author Report Share Posted July 20, 2008 QUOTE (neB @ Jul 19 2008, 06:52 AM) If you are looking for gloabl solution that finds which of all of the VI's in memory are running, (note: there maybe more than one running) it seems you would have to interact with the OS's scheduler to do that since LV utilizing the OS to schedule VIs and for that matter the multiple possible threads within each VI. I have no idea how to check an OS scheduler to see which VI is running. I guess I only care about Windows apps in my case. Here is my goal... I have a state machine UI. I want to be able to run a supervisory VI that monitors the state machine and can log every VI that was actually run/called (as opposed to just being in memory) until the state machine completes. I was just about to give up on this but then I realized that the LabVIEW VI Profiler basically does what I need to do (and more). Unfortunately I am not sure how it does this... Any ideas? (Is it checking the OS scheduler? -- that would be surprising since it would mean there would be a different flavor of the VI Profiler for each LabVIEW OS version supported). Quote Link to comment
LAVA 1.0 Content Posted July 21, 2008 Report Share Posted July 21, 2008 QUOTE (Omar Mussa @ Jul 19 2008, 11:48 AM) I have no idea how to check an OS scheduler to see which VI is running. I guess I only care about Windows apps in my case.Here is my goal... I have a state machine UI. I want to be able to run a supervisory VI that monitors the state machine and can log every VI that was actually run/called (as opposed to just being in memory) until the state machine completes. I was just about to give up on this but then I realized that the LabVIEW VI Profiler basically does what I need to do (and more). Unfortunately I am not sure how it does this... Any ideas? (Is it checking the OS scheduler? -- that would be surprising since it would mean there would be a different flavor of the VI Profiler for each LabVIEW OS version supported). THanks, so you really just need to know after the fat and not durring... [Pushing my knowledge = True] All of the debugging and profiler stuff seems to be built into the under-lying C code. Even poking around in prvicate methods only let you turn stuff on-and off. [Pushing my knowledge = False] The Trace Execution Toolkit is something I have only used in the RT environments but is supposed to run under Windows now. It works by putting hocks into all of the code before you run it and will produced detailed reports of everything that called when for how long and also gives you an idea if anything goes idle waitng for memory management. That toolkit may be helpful. Ben Quote Link to comment
Omar Mussa Posted July 21, 2008 Author Report Share Posted July 21, 2008 QUOTE (neB @ Jul 20 2008, 06:26 AM) The Trace Execution Toolkit is something I have only used in the RT environments but is supposed to run under Windows now. It works by putting hocks into all of the code before you run it and will produced detailed reports of everything that called when for how long and also gives you an idea if anything goes idle waitng for memory management. That toolkit may be helpful. Cool, I will try to check it out. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.