From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-17-2017 08:18 AM
I have a VI with a tree control.
There is a combo box which which in conjuction with Event Structure adds the text from the combo box to the tree control.
Is there a default behavior of the tree control to append a _1 to a tag?
For example, if the combo box text is Test_step1, when 3 of them are added to the tree control I see
Test_step1
Test_step1_1
Test_step1
I haven't used a tree control very much. I am at a lost why this is happening.
Solved! Go to Solution.
10-17-2017 12:03 PM
Are you sure the last one isn't "Test_step1_2"? The Tags have to be unique, which is why it is appending stuff. You can take control of the tag name when adding items by not leaving the "child tag" input blank:
10-17-2017 01:03 PM - edited 10-17-2017 01:05 PM
@Gregory wrote:
You can take control of the tag name when adding items by not leaving the "child tag" input blank:
Pretty sure I am not leaving Child Tag blank. Even when it is not blank, the _n still happens.
I have resorted to looping through the 1st column for each cell and getting the cell text.
That is the information that is needed.
10-17-2017 01:08 PM
Ok, I think you would need to post your code to debug any further.
10-17-2017 01:10 PM
http://digital.ni.com/public.nsf/allkb/547DFDA3D02FD0AE86257154006933F3
I tried the first VI.
Instead of using the FOR loop index, I fixed the text as Test1.
And you will see that the tags are unique which is not what I wanted.
10-17-2017 01:25 PM
If you read the help, you will see that tags must be unique and the documented behavior.
10-17-2017 01:43 PM - edited 10-17-2017 01:43 PM
Yeah the tree can appear however you want, but to identify any single item in the tree you need to reference it by an alias, which is the tag, and that needs to be unique for all tags. So one way to get around this might be to have a Tree look like this.
Folder 1
-A
-B
Folder 2
-A
-B
But in this case I might have the tags be the following which aren't seen by the user of the software:
Folder 1
-Folder 1 >> A
-Folder 1 >> B
Folder 2
-Folder 2 >> A
-Folder 2 >> B
This of course only works if you aren't allowed to have two folders with the same name at the same level. And I mean even if you would allow that how could the user of the software understand what is what? Anyway just be sure and give unique tags, and one way to help this is to include the full path of the item in the tag.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-17-2017 02:00 PM
@Gregory wrote:
If you read the help, you will see that tags must be unique and the documented behavior.
I inherited this tree control VI and unfortunately this documented behavior creates a bug that the original programmer did not fully account for.
I haven't used tree controls in the past so this is all new to me.
The tree control is being used as a sequencer. The original programmer was using the child tags and the rest of the program is expecting Step1 and not Step1_1, Step1_2 etc.
10-17-2017 02:23 PM
If you don't use underscores for anything else in your tags, you can just "search/split string" to get original step name.
10-17-2017 02:27 PM
@Gregory wrote:
If you don't use underscores for anything else in your tags, you can just "search/split string" to get original step name.
There are underscores galore in this program.
It is a mess.
I had been told that this program needs a few features to be finished.
I didn't know that some of the even most basic of things are not working.