07-11-2012 06:23 AM - edited 07-11-2012 06:24 AM
Apologies for the slightly vague title - I'm not exactly sure what you'd call my problem!
I have attached a small library who's top level vi scans a list of visa connections to verify if the instruments are connected properly. (In my main program, this is actually a subvi.) There is also a loading bar subvi that displays whilst the visa ports are being scanned. When testing, I encountered a situation where some of the instruments were taking a long time to reply. Since then, I added a 'cancel' button to the loading bar. At the moment this works to close the loading bar, but I want to also stop some code in the calling vi from executing (*) if the button was pressed. My various attempts at that failed, so I've come here to look for some help and pointers. The vi's I've uploaded are in the state from just before I started trying to get the (*) functionality. In the main vi, there is a constant called 'loading bar cancelled' - this is where I want to wire the 'output' from the subvi if possible. There is also a 3rd vi, but this was just for debugging purposes.
Thank you.
- James
Attachment: LabVIEW 8.5
07-11-2012 06:33 AM
07-11-2012 07:27 AM
In the code I'm rewriting from, almost every wire led to a global. That has left me with slight mental scarring and a deeply rooted fear of global variables! I may give your suggesting a try, but is there any other option? 😛
07-11-2012 09:37 AM
You can use a notifier. We use a common VI that can be used in subVIs to see if a stop notification has been fired.
At the point you are processing your cancel have it post to the notifier to siganl a stop condition has occurred. The timeout of 0 on the get notification will not slow down your code but it will catch a new notification.