04-11-2019 08:01 AM
04-11-2019 08:12 AM
@Ben wrote:
If you keep track of the reference of each of the target sub-VI you can remove them (while they are still running) from the sub-panel and insert another.
Yes, this is precisely what I do with my multiple Stations. I start them all, they all run for about 2 hours, and at any time I select one (or none) to "view" and implement this by wiring their RefNums into the "Insert VI" Node associated with the sub-Panel. Note that I don't need to use "Remove VI" to get rid of the existing Asynchronous Clone whose Front Panel is currently being displayed -- the only time I use this Node is if I'm turning "off" the Display so that none of the Clones are being monitored.
Bob Schor
04-11-2019 08:47 AM
@Bob_Schor wrote:
@Ben wrote:
If you keep track of the reference of each of the target sub-VI you can remove them (while they are still running) from the sub-panel and insert another.
Yes, this is precisely what I do with my multiple Stations. I start them all, they all run for about 2 hours, and at any time I select one (or none) to "view" and implement this by wiring their RefNums into the "Insert VI" Node associated with the sub-Panel. Note that I don't need to use "Remove VI" to get rid of the existing Asynchronous Clone whose Front Panel is currently being displayed -- the only time I use this Node is if I'm turning "off" the Display so that none of the Clones are being monitored.
Bob Schor
Well that is interesting!
It never occurred to me that I could just slap a new one into a sub-panel that already had a sub-VI running in it.
That is the result of just mucking about with things and not really knowing what I am doing.
I will have to try that the NEXT time (like tomorrow maybe?) I am stuffing a sub-VI in a sub-panel.
Ben
04-11-2019 11:17 AM
@JÞB wrote:
The front panel is for a user too observe. 20 frames per second is all the human eyeball can see..... and that is faster than the brain can assimilate the data!
Apologies for sidetracking the main discussion, but I'd like to point out that 20 FPS is the *minimum* for human eyes to see motion, not the max. For LabVIEW it's perfectly fine, but if you're expanding into anything high speed it's very different. For example, a football thrown on a 20 FPS display will look blurry, but not on a 60 FPS display. You can easily tell the difference between 60 FPS and 90 FPS if you're playing a video game, and VR goggles running below 80-90 FPS will get you nauseated pretty quick. For further reading:
https://www.testufo.com/# (view some different framerates)
https://gfycat.com/merryspiritedbass-pcmasterrace (a 3D scene rendered at 30 Hz vs 60 Hz)
/sidetrack over, carry on please 🙂
04-18-2019 02:42 PM
So - I have followed the suggestions of this thread: I wrote a message-handling "wrapper" sub-VI that is visible in the subpanel. This VI sits idle when data collection is off, and periodically calls the pesky sub-VIs when data collection is on, communicating with the top-level VI via queues.
Front panel -> subpanel window -> wrapper VI -> multiple data-collection VIs
This approach works - no more mouse flinching. Now I just have a subtle issue - everything works well the first time I run the VI, but if I re-run it after everything stops, the producer loop in the wrapper VI never starts. I need to close the project and re-load it for the loop to work - could this perhaps because I am using a static reference to the VI to load it into the subpanel, and somehow it's preserving state between subsequent VI runs?
04-18-2019 02:47 PM
Stopping your top level VI won't automatically stop other VI's inside subpanels. Make sure you send the subVI a message saying "stop" when your main VI closes.
04-18-2019 02:52 PM - edited 04-18-2019 02:54 PM
The wrapper VI does stop - I am sending a shutdown message to it to explicitly force it to stop processing data and to shut down all its loops, which is working.
Replacing the static VI reference with a call to Open Reference (and a call to Close Reference during shutdown) seemed to fixed the restart issue. From what I read, the static reference is preserved until the top-level VI is dismissed, which mabye explains why I had to close the project to get it to restart correctly. So all issues are now resolved.
This was an insightful thread, thanks for the opinions and guidance.