LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

References vs dataflow: efficiency

You could have each of the arrays in the data structure in separate shift registers in that global without it producing much clutter (unless the cluster contains a lot more elements than the ones unbundled in the example), that way you don't need to do all the costly bundling and unbundling. But using the whole cluster structure isn't a problem for the global, I'm not sure why you say the global is best to handle smaller structures/arrays (?).

You could also use the global not just to hold the data, but include all kinds of methods to manipulate the data and do calculations within the global (a really "functional" global:-)). That way you'll always work on the data in the shift registers of the global, not copy it to other VIs.

In another post you say
you want to use a cluster of all the arrays because you want a structure easily understandable by humans...Are you thinking of other programmers...or of the users of the application? In some cases it's better to keep the data the way it is most efficiently processed by the computer, and then just "translate" it into a more understandable structure the few places the user is to see it.
0 Kudos
Message 11 of 12
(411 Views)
OK, I can see (i think) that the functional globals act somewhat object oriented in a way, right? That could in fact help a lot, although with a lot of recoding (and re-thinking).

Regarding your question about smaller structure/arrays, it looks to me that the real problem of not being able to reference the data in an efficient way is still not solved regarding clusters. An array in a functional global can be handled efficiently, but a cluster of arrays, or arrays of clusters with arrays cannot, at least not if you want do do some operations on the data.

I see what you mean regarding readability, but i disagree. In my case i will have to do some really strange index manipulations with a few large arrays instead of simple "natural" indexing on m
any smaller arrays. Allmost to the point of where it would be simpler in fact to use one single huge array for all the data and fix everything with clever but strange indexing. That way i wouldn't really need functional globals either. The ability to handle large and complex datastructures efficiently is really the main (and only?) advantage C/C++/F90/95 has over FORTRAN 77 (number crunching vise), and it has all to do with readability, simplification and structuring of the code.

But thanks alot. Seems that functional globals is the way to go for now 🙂
0 Kudos
Message 12 of 12
(411 Views)