03-21-2009 06:02 PM
In my brief research preparing a small program to sort heirarchical data, I have found very little discussion about implementing and using traditional data structures (linked lists, trees, etc.) in LabVIEW. There are a few suggestions for implementing data structures using arrays of clusters, but the overall discourse on this topic is so thin as to make me suspect I am trying to put a square peg in round hole. Is it because data structures (beyond arrays) are just not required in most LabVIEW applications? Perhaps it is because the dataflow nature of LabVIEW makes implementation more of a nuisance then it is worth?
Most students first exposure to data structures and the algorithms used to manage them is within a control flow, object oriented language such as JAVA. Should one bite the bullet and learn LVOOP if one wants to use data structures with any regularity in LabVIEW?
03-22-2009 04:58 AM
The main problem is that linked lists and trees require pointers to work (efficiently or at all) and LabVIEW doesn't have the concept of a pointer. Essentially, it takes care of all memory management behind the scenes. If you know what you're doing, however, you can build your code in such a way that it actually does pass the data around by using pointers.
If you search the LAVA forums, you should find implmentations both for a linked list and for a tree, both of them using LVOOP and some relatively new primitives which give you better memory control. As for your question, such structures do have their place, but most LabVIEW programmers probably don't need them (and probably don't even know they exist), as the problems they face can be solved using other methods.
03-23-2009 05:10 AM