LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DB Connectivity Toolkit and Tree Views

Hi Nick,

 

Getting closer each time!

 

I have came close to getting it, but some of my nodes are being placed in spots that they shouldn't be, i.e. wrong product line, wrong plant, wrong shipment #, etc...I think it's finding a match and placing it under the wrong parent with the way I have it wired now. I'm not sure how to to compare what is in the tree to my array without using the All Tags Property Node. I assume that this is what it's used for. Should I be using something else?

 

I've enclosed my VI for you to look at.

 

I apologize for my ingnorance on some of my questions. This is my first stab at any kind of treeview item and a little hand-holding may be necessary. Smiley Embarassed

0 Kudos
Message 11 of 20
(1,612 Views)

Eric,

 

No problem using the All Tags Property node. I think you will need to design your code so that you step through each element of each row in the data array. Then check to see if the proper tag exists. If no tag exists, then you need to add a child element under the proper parent tag.

 

I would do this by autoindexing the array in a for loop like you have done. Then check to see if the element in Column 1 (Country Code) already has a tag. If it does, move to element in Column 2 etc. If no tags exist, add a tag for Country, Product Line, Plant etc.

 

It seems like you are close, keep at it and you will get there!

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 12 of 20
(1,604 Views)

Hi Nick,

 

As you can see, I had to first put a node in the tree before all of the For Loops ran. If I didn't, the third For Loop would never run because nothing would be in the Tree.All Tags Property Node.

 

I believe I ALMOST have it, but I can't figure out how to get rid of the multiple 0EPS nodes when I run my code. Wondered if you (or anyone else) could help.

0 Kudos
Message 13 of 20
(1,597 Views)

Eric,

 

The code looks like it's coming along well! At first glance I cannot see why this behavior would be happening. I suspect it has something to do that you are statically assigning the 0EPS tag. Ideally, everything would be programmatically tagged, row by row.

 

You would check each column in row 0, if there is no tag created, then add one. If there is continue on to the next column placing new tag under the proper parent tag. It seems at the moment that column zero is not being compared to the existing parent tag, a new one is simply being added for each child element.

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 14 of 20
(1,590 Views)

Nick,

 

I believe I have it although I get the feeling all of the information is not getting implimneted into the tree. I'll have to go over this to make sure that the treeview is getting populated correctly.

 

Thanks for all your help.

 

Code Snippet.png

0 Kudos
Message 15 of 20
(1,587 Views)

Hi,

 

I took a look , I think you wanted to get rid of the extra "ops" parents.

 

The logic on reading the parent ( minus 1 from the array) seems to be throwing the results.  I put in a select that will turn off the "add tag" when there is a blank tag from reading the array at index -1.

 

Hope this helps.

 

Mark

 

untitled 1 version 2.png

 

 

-------
Mark Ramsdale
-------
0 Kudos
Message 16 of 20
(1,586 Views)

Hey guys,

 

I've made it a little bit farther, but I've hit another snag. The third and fourth columns in my array can have one product code per shipment ID (second column) and multiple machines within the product code. I wondered how do I get around that? Use the same principles as the first two For Loops?

0 Kudos
Message 17 of 20
(1,551 Views)

Hey Eric,

I would suggest doing what you did previously to check to see if the parent exists, if so go to the next level, but if not, then create that level.  You will need to do this for every level of your tree structure possibly.

0 Kudos
Message 18 of 20
(1,535 Views)

I GOT IT!

 

While the code looks ugly (it needs sub-VI's), I can at least see what is actually going on and hopefully impliment less code for the same result/solution.

 

For anyone that is interested, here's the code I used.

0 Kudos
Message 19 of 20
(1,516 Views)

Eric,

 

Glad to hear that you got everything working!

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 20 of 20
(1,509 Views)