LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I get a Tab Control Class conflict?

I am using LabVIEW 8.2.1 and I'm experiencing a strange problem. I create some code to manipulate a tab by first creating a reference and then performing property changes or invoke a method on the control. This works fine and I create a VI with the reference as the input and something else as the output if I wish, which also works fine, as you'd expect. However if I create another tab from the containers pallette just as before and pass that reference in instead of the original tab I get a 'class conflict' even though the classes are the same. If I create a copy of the original tab and rename it and then pass that reference in it will run as expected.

I have developed Proof of Concepts for the various LabVIEW parts of the project i'm working on and aimed to simply pass references in for given controls to integrate them into a larger program, which has worked fine for everything else, except the tab controls. This is holding up the project now and could be considered a showstopper for us. The attached image illustrates the issue.

Id appreciate any suggestions.
 
Cheers
 
Tom Powell
0 Kudos
Message 1 of 5
(2,108 Views)

Hi,

try to create a new control element for the tab control in your sub vi:

Move to the front panel of the sub vi and select "Element->Modern->refnum->element(refnum)" and place it on the frontpanel

right click this element and select "choose VI Server Class" (or similar, i'm using the german version) "general probes->G-Object->control element->tab control-> tab control"

This should work with any new tab control connected.

I assume you created your refnum control by copying it - then it was bound to the original tab control.

Good luck

Christian

0 Kudos
Message 2 of 5
(2,094 Views)
When you make the subVI it creates a control reference input. This input will be a strictly typed tab control reference indicated by a red star on the bottom left of the reference found on the front panel of the subVI. Because as default this reference is strictly typed, it will only accept a reference to a tab control that is exactly the same as your original one. In order to solve your problem, right click on the reference and uncheck 'Include data type'. Now you should be able to wire any tab control reference to the subVI.
Message 3 of 5
(2,086 Views)

Thankyou Rich for your superlative support.

I was unaware that the datatype returned from a Tab Control was an enumeration that was formed by the names of the pages. In order to utilize the 'Value' property to manipulate Tab Controls that would have different page names I had to handle the Tab Control as unstrictly typed, which would return a Variant. By casting this variant to a I32 this would give the page number from the order they appear on the control and would not depend on the enumeration created by chaning the page names.

Cheers

Tom

0 Kudos
Message 4 of 5
(2,052 Views)

Great advice!! Solved my propblem as well. Thanks

Mike

0 Kudos
Message 5 of 5
(1,220 Views)