LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rapid subpanel execution

Solved!
Go to solution

Yes. I get what you're saying.

 

I think my best way out is to embed the data collection VIs into a VI just for the subpanel (which can be left to run and idle as needed) - that way I don't need to worry about re-architecting and re-qualifying a ton of other programs.

 

Appreciate the support everyone.

0 Kudos
Message 11 of 17
(1,465 Views)

@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

Message 12 of 17
(1,464 Views)

@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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 17
(1,458 Views)

@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 🙂

0 Kudos
Message 14 of 17
(1,448 Views)

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? 

0 Kudos
Message 15 of 17
(1,415 Views)

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.

0 Kudos
Message 16 of 17
(1,412 Views)

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.

0 Kudos
Message 17 of 17
(1,409 Views)