01-09-2010 09:13 AM
Hello 2 all !
I have the following dilema : I have an array of integers which i read from a txt file. Idealy, the file should only be read once.
This array is used on multiple vi's, but it isn't used simultaneously on all the vi's that use the read array.
I guess the question is : how to make the array available to all the vi's but read the file only once.
Thank you 4 your time !
P.S. I'm using LabView 8.5.1 on Windows XP SP 2
01-09-2010 09:40 AM
01-09-2010 09:42 AM
01-09-2010 01:25 PM
That is the way to do the job but, I would expand the AE to allow you to "do more" Consider the use of the data and allow for some common actions i.e. "Methods". "Init (from source), Get (values), Set(values) and Write(to source). You may not need them all but its easy to do and when (not if) you find a need to use the other actions they are already there. Also a "Null, Default" case in the AE allows a really quick method for adding functionality to the AE. Use a type def Enum for the method control and maintanence is pretty easy.
I rarely have an AE with less than these 5 basic methods and commonly add Get subset by indecies and Set subset by indecies
01-11-2010 07:48 AM
I must disagree with my esteemed colleagues on this one. An action engine is a poor choice for holding an array if you need to actually read the whole thing elsewhere. This is because it is almost impossible to read an array from an action engine without making a copy. A single-element queue or data value reference are better choices. Both allow you to design in-place use of the array. If you do not wish to pass the reference around, place the reference in an action engine.
On the other hand, if you need to get values or extract subsets from the array at multiple places, an action engine works very well. You can easily encapsulate in-place behavior in your action engine and only have to write it once. You can do the same with subVIs using a single-element queue or data value reference, as well. The methods are effectively equivalent for this application.
01-11-2010 09:07 AM