I am developing an application that monitors & controls test chambers, and have quite a lot of VIs. I read amongst these pages that it is generally bad practice to have parallel loops in a VI, and one of my VIs has many - because the FP has six XY charts that constantly need updating.
The code required to update each graph is considerable because there are four variables to plot and each variable uses a buffer, which potentially can be very large to incorporate a long history.
I am a relatively new LabView programmer so do not know all the little tricks that are probably out there - but am gradually catching on, i.e. control refs, dynamic loading etc..
I'm conscious that I'll be using too much memory/resources as it will have to run simultaneously with other VIs, and ideally want to make the code as efficient as possible.
My questions/dilemmas are these:
1. I've been trying to make the code to update a graph into a subVI so that it can be called six times as opposed to my current method of having identical code for each graph. I've semi-succeeded in that I have made a subVI that uses control refs to change certain properties (like x-axis scale) but still require the paralled loops so that the code executes correctly. What are the implications of having say, 8 parallel while loops in one VI? (I am using the Wait function) It seems to me that I need them to get different tasks to operate at the same time. (This is because the loop for each graph is inside a case statement that determines if the chamber is running or not - if not then the graph code does not execute)
Once there is one while loop, anything outside that loop will not continue to execute until the loop has finished!
2. To create the buffer I'm using a subVI from an example in LabView (6.02) found in Fundamentals/Graph & Chart/Chart/XY Chart.vi. The subVI is called XY Chart Buffer. The VI is reentrant and allows control of the number of elements allowed in the array. I want to have a large history so the user can see upto 24hrs worth of readings, that is as many as 17280 elements. Can LabView cope with buffers this big if there are many instances of the buffer running at the same time for different variables? Is the size of RAM directly responsible for how big the buffers can be?
If anyone can offer any suggestions or advice i'd be very grateful. Attached is the VI i have talked about with code for only two graphs - one with a subVI using references and one with the code not inside a subVI.
Dan