NI Home > Community > NI Discussion Forums

NI Labs

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Qizhen
Posts: 98

Welcome to "LabVIEW Generic Container Map"

Our purpose is to design some generic containers in LabVIEW.  Map is the first prototype we created.

The generic containers are data type independent widely used data structures.  By using generic container methods, the LabVIEW developer can easily and efficiently store, read and handle any type of data, from simple integers type to complex clusters type.  

The Generic Container Map is optimized for the fast retrieval of values by sort key. You can use the Generic Container Map when an application requires a large number of searching or query operations.

Your feedback is highly appreciated!

Member
Jay Gao
Posts: 10
0 Kudos

Re: Welcome to "LabVIEW Generic Container Map"

I have some questions about "map", and I had written up in your space.(blog)

Pls check it. and hope your feedback.

Member
NJKirchner
Posts: 126
0 Kudos

Re: Welcome to "LabVIEW Generic Container Map"

FYI

Looks like the install will not install examples to the 8.5 dir if it is installed

Member
Qizhen
Posts: 98

Re: Welcome to "LabVIEW Generic Container Map"



NJKirchner 写:

FYI

Looks like the install will not install examples to the 8.5 dir if it is installed



No, it only installs on LabVIEW 8.2.
The reason is that we have only tested it on LabVIEW 8.2 on Windows, I cannot guarantee that it works on other system.
But since the LabVIEW 8.5 has released, hopefully will have an installer for it soon.
Member
Qizhen
Posts: 98

Re: Welcome to "LabVIEW Generic Container Map"


高杰 写:

I have some questions about "map", and I had written up in your space.(blog)

Pls check it. and hope your feedback.


GaoJie asked me some questions in Chinese.  I translated his questions and my answers into English here:

1. Q: If I have lots of data, can this Map container help me save the memory?
    A: No.  The Map cannot save memory for you.  But it increases the efficiency of your program.  Inside the Map, it organized the data in a balanced binary tree.  The time complexity of searching a data with the Map is O(log n), it is faster than the one with a liner data structure O(n).

2. Q: Can I use the Map recursively?
    A: Yes, you can use A map as the data value of an element in another Map.

3. Q: Can I use it in Windows 2000?
    A: Yes, you can.  You can also use it on Linux and Mac OS, by first installing it on Windows XP and then copying all related files to your target machine.  But I have only tested it on a XP system.

4: Q: Can I build my VI that used the Map into EXE?
    A:  No, you can only use the Map inside LabVIEW environment.We will solve this problem in the future.

Member
Ancle
Posts: 160
0 Kudos

Re: Welcome to "LabVIEW Generic Container Map"

I have the same problem in question 4. Wish you can resolve the problem as soon as possible. Thank you.
Member
tchristm
Posts: 1

Re: Welcome to "LabVIEW Generic Container Map"

Is there a reason that you implemented your Map as a tree instead of a Hash Table?  I thought those had faster lookup than Tree-backed maps.
Knight of NI
altenbach
Posts: 27,595
0 Kudos

Re: Welcome to "LabVIEW Generic Container Map"

[ Edited ]

OK, I tried to do something along the lines of the example from the documentation and run into serious problems:

  1. I created the data cluster (name, email, phone) and seach key and added 4 entries of the address book to the map. This seems to work.
  2. For some reason, the map data has different labels (email, phone, phone2), according to the cluster how I first created it (problem1.vi). I don't remember exactly in what order I created the items, but something went definitely wrong.
  3. It seems the map does NOT update correctly if I would change the label of one of the cluster elements of the type after it is wired up.
  4. Only if I remove all elements from the type cluster and reinsert them in the right order, the filed names get updated correctly.
  5. It does not seem to be possible to list elements as instructed, the output is corrupt (see both attached VIs).

Some suggestions:

  1. I accordance with standard LabVIEW error handling, all boolean status outputs should be reversed so they are TRUE if there is a problem.
    1. For FIND, the boolean output should be labeled "not found". (For the current definition, it should be labeled "found", no "find")
    2. For NEXT, the boolean output should be "invalid" so we can wire it to a "stop if true" conditional terminal.
    3. Actually, I am not sure if we really need these boolean outputs. Can't we use the error cluster for this?
  2. Why does FIND have a "key out" If it just duplicates the input, we don't need this.

Other problems:

  1. The context help works if I hover over the icons on the diagram. They don't work if I hover over the icons in the palette.
  2. The example in the documentation "list all items" should have an autoindexing output tunnel to create an array of values.

Why does the way I list all items produce incorrect results? Can you find what I did wrong?

Message Edited by altenbach on 08-25-2007 10:07 PM


LabVIEW Champion . Do more with less code and in less time .

Member
Qizhen
Posts: 98

Re: Welcome to "LabVIEW Generic Container Map"



tchristm 写:
Is there a reason that you implemented your Map as a tree instead of a Hash Table?  I thought those had faster lookup than Tree-backed maps.


It is because that our Map container is for general purpose.  The data numbers in the Map is uncertain.  It's hard to select a suitable Hash Function for it.  When the data number is huge, collision always happens.  In this case, the Hash Table is not as efficient as the binary tree.
However, we could provide a Hash Map besides the binary tree Map, just like the C# language.  And let customer chose a suitable Map for his application.
Member
Qizhen
Posts: 98

Re: Welcome to "LabVIEW Generic Container Map"



altenbach 写:

OK, I tried to do something along the lines of the example from the documentation and run into serious problems:

  1. I created the data cluster (name, email, phone) and seach key and added 4 entries of the address book to the map. This seems to work.
  2. For some reason, the map data has different labels (email, phone, phone2), according to the cluster how I first created it (problem1.vi). I don't remember exactly in what order I created the items, but something went definitely wrong.
  3. It seems the map does NOT update correctly if I would change the label of one of the cluster elements of the type after it is wired up.
  4. Only if I remove all elements from the type cluster and reinsert them in the right order, the filed names get updated correctly.
  5. It does not seem to be possible to list elements as instructed, the output is corrupt (see both attached VIs).

Some suggestions:

  1. I accordance with standard LabVIEW error handling, all boolean status outputs should be reversed so they are TRUE if there is a problem.
    1. For FIND, the boolean output should be labeled "not found". (For the current definition, it should be labeled "found", no "find")
    2. For NEXT, the boolean output should be "invalid" so we can wire it to a "stop if true" conditional terminal.
    3. Actually, I am not sure if we really need these boolean outputs. Can't we use the error cluster for this?
  2. Why does FIND have a "key out" If it just duplicates the input, we don't need this.

Other problems:

  1. The context help works if I hover over the icons on the diagram. They don't work if I hover over the icons in the palette.
  2. The example in the documentation "list all items" should have an autoindexing output tunnel to create an array of values.

Why does the way I list all items produce incorrect results? Can you find what I did wrong?

Message Edited by altenbach on 08-25-2007 10:07 PM


The map data actually should not expose to customers.  We will finally hide it from users.  So the label in it is meaningless.

List elements has a bug that corrupt the out value.  We will fix it.  We are going to have an updates in a couple of weeks.

Thanks a lot for your comments!