Nesara Posted June 24, 2010 Report Share Posted June 24, 2010 Hi I am facing a problem while running a sub VI. I have developed a VI where I am calling windows system functions using ActiveX. This vi will generate an event (in this sub VI it will come out from "wait for next event" with out error) whenever Ethernet cable is plugged or unplugged. Once I run this vi it will wait at invoke node - "wait for next event". At this point I can't stop this sub VI even with abort button. It's creating the problem in my application (application hangs). Attached my VI. Please let me know if you need more information. Thanks Nesara WMI_EVENT_Notification.vi Quote Link to comment
Wire Warrior Posted June 24, 2010 Report Share Posted June 24, 2010 I notice that you have a time out set for 5 minutes. Are you saying that the VI will wait for 5 minutes and block everything or that it will never return from the Wait For Next Event. Jason Quote Link to comment
Nesara Posted June 25, 2010 Author Report Share Posted June 25, 2010 I notice that you have a time out set for 5 minutes. Are you saying that the VI will wait for 5 minutes and block everything or that it will never return from the Wait For Next Event. Jason Hi Jason Yes VI will wait for 5 minutes and block everything. It will return from Wait for Next Event either after time out or after Ethernet plug/unplug event. I can give less time out like 100 msec but application performance will reduce. I also learnt that since it is an external code LabView loses its execution control on it. If I make this Sub VI as LabVIEW function block (yellow color blocks) then problem may solve. But pls let me know how do that. Thanks Nesara Quote Link to comment
Mellroth Posted June 28, 2010 Report Share Posted June 28, 2010 If I make this Sub VI as LabVIEW function block (yellow color blocks) then problem may solve. But pls let me know how do that. When you speak of a "yellow color block" I assume you speak about the built in functions in LabVIEW, and as a user you cannot really create built in functions. The option for a user is to create a SubVI, but this will still not give you the option to abort the VI with the abort button. Regarding the performance issue when you specify a smaller timeout, I think that you see a degradation in performance over time due to that you are not closing references, and because the stop node wont execute if the timeout error is propagated to its inputs. To get even better speed you should initialize the event watcher, and only call the WaitForNotification in your loops (don't forget to close references afterwards). Please have a look at the attached example, where this Init-Wait-Clear is used to increase performance. WMI_EVENT_Example Folder.zip /J 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.