19tommy83 Posted August 19, 2010 Report Share Posted August 19, 2010 (edited) Hi, I'm new to Labview and I need help by the implementation of an double linked list in Labview2009. I've found an example from NI but it's more confusing me. I want to design the double linked list with a LVclass as data member and the data should be an reference to one instance of this LVclass. Edited August 19, 2010 by 19tommy83 Quote Link to comment
Aristos Queue Posted August 19, 2010 Report Share Posted August 19, 2010 Hi, I'm new to Labview and I need help by the implementation of an double linked list in Labview2009. I've found an example from NI but it's more confusing me. I want to design the double linked list with a LVclass as data member and the data should be an reference to one instance of this LVclass. A) How new are you to LabVIEW? If you are fairly new, you may be surprised by the lack of a doubly linked list as a formal library in LV. That's because it is rarely needed or desirable, relative to other programming languages. There are often better ways of handling the situation in LV, which might be worth investigating. B) Here's a full implementation of a singly linked list. http://decibel.ni.com/content/docs/DOC-12668 You should be able to adjust it to be doubly linked with little effort. This mechanism is *much* easier to grasp (and use) than the XControl impl. that you were looking at. Quote Link to comment
19tommy83 Posted August 19, 2010 Author Report Share Posted August 19, 2010 A) How new are you to LabVIEW? If you are fairly new, you may be surprised by the lack of a doubly linked list as a formal library in LV. That's because it is rarely needed or desirable, relative to other programming languages. There are often better ways of handling the situation in LV, which might be worth investigating. B) Here's a full implementation of a singly linked list. http://decibel.ni.co.../docs/DOC-12668 You should be able to adjust it to be doubly linked with little effort. This mechanism is *much* easier to grasp (and use) than the XControl impl. that you were looking at. Hi, I'm fairly new. I used LV for a little bit of measuring but my next task is to do data handling and storing of huge datasets. So my idea is to use a double linked list to store and search in the datasets ( >1000 entries). Thanks for the example, I found this implementation too but it is also confusing me. http://decibel.ni.co.../docs/DOC-12668 why is in this example the linked list build of two classes? Quote Link to comment
Tim_S Posted August 19, 2010 Report Share Posted August 19, 2010 Hi, I'm fairly new. I used LV for a little bit of measuring but my next task is to do data handling and storing of huge datasets. So my idea is to use a double linked list to store and search in the datasets ( >1000 entries). 1000 entries is not really a huge dataset... that's a day's production. A description of the type of data and what you're trying to accomplish may help point you in a good direction. Linked lists have been a foreign concept in LabVIEW until rescently when objects were added to the language. Tim Quote Link to comment
Aristos Queue Posted August 20, 2010 Report Share Posted August 20, 2010 Hi, I'm fairly new. I used LV for a little bit of measuring but my next task is to do data handling and storing of huge datasets. So my idea is to use a double linked list to store and search in the datasets ( >1000 entries). Just use an array. As Tim said, 1000 entries is trivial compared to what a lot of LV apps handle. I strongly do not recommend that you do anything with references until you've been working in the language for a while. There's a reason they didn't exist in the language until LV 2009 -- you generally don't need them and you probably will get burned in some way since refnums and parallelism don't play so well together. Thanks for the example, I found this implementation too but it is also confusing me. http://decibel.ni.co.../docs/DOC-12668 why is in this example the linked list build of two classes? Because LV does not allow a class definition to refer to itself, even through a reference. A class can refer to its parent class in its own definition. So the linked list uses a node which has references of type "parent of node".Linked lists have been a foreign concept in LabVIEW until rescently when objects were added to the language. They're still a foreign concept. :-) Quote Link to comment
Black Pearl Posted August 20, 2010 Report Share Posted August 20, 2010 If speed matters, I guess nothing will beat the native array. The other issue I see is that LV doesn't support generics, so you will need to implement the linked list for every class and can't reuse it. If you really want to dive into by-ref design, there are several threads here that discuss it. Maybe a good starting point would be to search for Daklu's bag implementation. Felix Quote Link to comment
Aristos Queue Posted August 20, 2010 Report Share Posted August 20, 2010 The other issue I see is that LV doesn't support generics, so you will need to implement the linked list for every class and can't reuse it. For a lot of the work that OO programmers coming from other languages want to use it for, they'll be able to make good distance with the version where the core type is LabVIEW Object and just downcast when they extract from the list. This applies to all the container types. JAVA didn't have any sort of generics for a long time, claiming that the common root object (java.lang.object) was sufficient and they wanted to avoid the complexity that C++ had developed that was (at the time) the source of most bugs in all C++ compilers. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.