JDave Posted March 5, 2008 Report Share Posted March 5, 2008 The current ability that I have found is to include the "Set Close If Lonely" node. This will close the tool if all other VIs (minus System VIs) are closed. This is nice for certain needs. Also one may set the VI as a System VI so that it does not show up in the VI Hierarchy. I am looking to make a background service that monitors for the 'true' active VI using the VI Activation scripting event. It would also monitor for certain keyboard shortcuts. This seems necessary due to limitations in the scripting API. Active VI does not always change with window focus changes. Sometimes requires clicking on an object on the window. MenuLaunch VI does not function for a custom icon editor nor tools called from the File menu. Custom Tool Menu items can not currently have shortcuts assigned. If there is some way to overcome these limitations without having a background service, that would be very nice and welcome. Assuming a background service, however, it would be expected that if all other VIs were closed then the Getting Started window would appear. The service would not stop, but remain hidden. If the user closed LabVIEW, the service would also close automatically. Is this even possible? David Quote Link to comment
PJM_labview Posted March 5, 2008 Report Share Posted March 5, 2008 QUOTE(JDave @ Mar 4 2008, 08:31 AM) ... Active VI does not always change with window focus changes. Sometimes requires clicking on an object on the window. This is odd. I have never noticed any issues with this. I used it quite a bit, and it seem to always work for me. I think NI is using it in the navigation window, and as far as I know, I have not heard people saying that it does not display the image of the right VI with focus. QUOTE(JDave @ Mar 4 2008, 08:31 AM) ...Assuming a background service, however, it would be expected that if all other VIs were closed then the Getting Started window would appear. The service would not stop, but remain hidden. If the user closed LabVIEW, the service would also close automatically. Is this even possible? Yes this is possible. Here are a couple items that help in doing this. 1) The close if lonely does generate a scripting event (I forgot which one at the moment) which you can catch and act upon. 2) System VIs, while not shown in the hierarchy, could be used as well for this background service if they are the only one left running in memory. PJM Quote Link to comment
JDave Posted March 5, 2008 Author Report Share Posted March 5, 2008 QUOTE(PJM_labview @ Mar 4 2008, 09:09 AM) This is odd. I have never noticed any issues with this. I used it quite a bit, and it seem to always work for me. I think NI is using it in the navigation window, and as far as I know, I have not heard people saying that it does not display the image of the right VI with focus. Testing in LV 7.1, 8.2, and 8.5 shows that changing focus on Front Panel and Block Diagram windows does not change the Active VI. Selecting any object updates Active VI. Most tools play with selected objects, which is why this isn't much of an issue. I suspect that NI uses the VI Activation scripting event in the Navigation window. QUOTE(PJM_labview @ Mar 4 2008, 09:09 AM) Yes this is possible. Here are a couple items that help in doing this. 1) The close if lonely does generate a scripting event (I forgot which one at the moment) which you can catch and act upon. 2) System VIs, while not shown in the hierarchy, could be used as well for this background service if they are the only one left running in memory. Have you gotten behavior where the only running VI is a System VI and this causes the Getting Started window to appear? I can't seem to get that behavior with System VIs. I had one System VI running (shown or hidden) and nothing else open. Still the Getting Started window never showed up. Though it is nice that if you choose to Exit LabVIEW, you don't get a warning that your System VIs will be aborted. Thanks for looking into this. David Quote Link to comment
PJM_labview Posted March 5, 2008 Report Share Posted March 5, 2008 QUOTE(JDave @ Mar 4 2008, 10:00 AM) ...I suspect that NI uses the VI Activation scripting event in the Navigation window. Oops sorry, I though that this was what you were talking about. I missread. QUOTE(JDave @ Mar 4 2008, 10:00 AM) Have you gotten behavior where the only running VI is a System VI and this causes the Getting Started window to appear? I can't seem to get that behavior with System VIs. I had one System VI running (shown or hidden) and nothing else open. Still the Getting Started window never showed up. David Is you background service FP close? PJM Quote Link to comment
JDave Posted March 5, 2008 Author Report Share Posted March 5, 2008 QUOTE(PJM_labview @ Mar 4 2008, 10:39 AM) Is you background service FP close? That was it. Thanks very much. I never tried it with the front panel closed, just hidden. David 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.