04-07-2010 08:04 AM
Battler., the In Place Element Structure is essentially a compiler hint. It is normally used to avoid making data copies when extracting or manipulating data in complex data structures (as in the example given above). Complex usually means anything with more than one layer of hierarchy (e.g. cluster containing clusters, cluster with arrays, array of clusters, etc.). Traditional techniques fail in these situations. However, if you always use the In Place Element Structure for data manipulation, you will not need to worry about traditional techniques, such as the "magic pattern" for clusters. On the flip side, overuse of the In Place Element Structure can cause LabVIEW to not optimize its code well, since you may put constraints on the code which do not need to be there. This is rare, but possible. I use the In Place Element Structure when I need it. I find out when I need it by using the buffer viewer. How much time does it save? That depends on how many data copies you avoid and how big the data being copied is. Sometimes it is dramatic. At other times, it amounts to almost nothing. It is another tool to help you build better LabVIEW programs.
Fragger Fox, be careful when using Delete from Array. It is usually very slow. In this case, you are better off determining what portion of the 2D array is needed and indexing the exact subset you rather than indexing the whole 1D array and deleting parts of it. Searching for zeroes is also fraught with danger, since zero is a valid number. The suggestion above to put the number of array elements in the first element is a good one. It makes extracting the portion you need painless. Note that internally, LabVIEW keeps the array size in the array header information. See the LabVIEW documentation for details if you are interested.
04-07-2010 08:39 AM
Thanks DFgray.
"LabVIEW keeps the array size in the array header information."
How can this info be accessed?
04-08-2010 09:13 AM
04-08-2010 04:00 PM
Thanks DFGray. I didn't realise you work for NI.
Can you please take a look at my FG/AE problem:
http://forums.ni.com/ni/board/message?board.id=170&message.id=489302#M489302