LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call asynchronously, then close. Can't reopen

Hey guys,

 

I have a problem where I call asynchronouly a VI (graph_sync.vi), when I close it using the X upper right button, I cannot open (or call, perhaps) it again. Close using the 'Close' button in the VI's Front Panel doesn't cause this behavior and the calling works fine whenever I call.

 

Debbuging remotely, my global variable (sync.graph,isopen?) didn't receive the 'false' value it should at closing the VI through the X button, that's was expected, so I made it receive that value using another VI. Tried to open 'graph_sync.vi' again and nothing happened. Then I opened the VI (double click on the static reference in block diagram), it opened running and I closed it using the 'Close' button in its Front Panel. This time trying to open it again worked.

 

What's happening exactly? I feel that I'm missing something here but don't know what... that's why I need your help Smiley Wink.

Download All
0 Kudos
Message 1 of 2
(1,675 Views)

Your "Close" button causes your VI to complete and thus stop.  The "X" button just closes the front panel; it does not stop the VI.  Thus you could not start it again as it was still running.  In some cases LabVIEW automatically ABORTS running VIs with no open front panel, but not in the case of a VI run asynchronously as you have done.

 

The way to get a VI to properly stop when clicking the "X" button is to use an event structure (there is a "Panel Close?" filter event that you use to trigger shutdown).  I almost never bother with an actual "Stop" button anymore; I just use the "X".

 

-- James

Message 2 of 2
(1,658 Views)