06-29-2016 10:08 PM
It depends on how you call your sub VI. If you are calling the sub vi directly in the main VI and if the main VI execution depends on the execution of your sub vi then its better to have the Array data (2d Array) connected to the connector pane and read it in main VI. The queue data transfer comes into picture when you are running your VI in a parallel loop or if you are running the VI somewhere else. Please show how you are calling the sub vi in you main vi
06-30-2016 08:10 AM
06-30-2016 08:35 AM - edited 06-30-2016 08:36 AM
I wouldn't suggest a sub vi if it doesn't have large diagram and also your main VI has.If you think having a sub vi makes the main vi clean then you can do that. Passing the 2D array from the sub vi and use it in the main vi instead of a queue.
06-30-2016 08:45 AM
There is another way to approach this challenge that can work...
IF
The data updates are not terribly large such that they are a performance issue.
If so then...
Pass reference of the FP objcts of teh Main VI to the sub-VI and let the sub-VI do the chart updates and fiddle with the properties.
This approach will keep the details of the GUI adjustments out of the Top level VI and still acheive the final task.
If however...
Other porcess running in the application need to KNOW about the value updates....
Proceed with the Producer/Consumer approach recomended above.
Ben
06-30-2016 09:00 AM
As suggested Producer/Consumer design pattern is the best approach for performance and making the application modular.