LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab control refnum

Solved!
Go to solution

Hi,

 

In my front panel I have a tab control containg 6 pages with waveform graph, I have a copy graph button on front panel which exports the image of waveform. My requirement is that I want to export the image of currently open tab with waveform graph. Exporting of image is done in a seperate vi, so my only option is to pass reference of tab control into that vi. I thought of using a case structure with each case handling each page of tab control. Does anybody have an idea of how to make case structure conform to handle each page of tab control ?

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 1 of 17
(5,173 Views)

Perhaps I am confused.  If you have a control reference (Tab in this case) then you know what page is being viewed via a property node.

You can feed the page directly into a case structure.

 

2013-08-23 14_50_48-Untitled 1 Block Diagram _.png

 

What is unclear however is if you are only capturing an image of the tabs page why you would need the various cases ?

I would think the code would be similar regardless of the page being viewed...

0 Kudos
Message 2 of 17
(5,159 Views)

Tab Controls have a property node item called Pages which returns an array of refnums.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 17
(5,157 Views)

I have following front panel :

 

Capture.PNG

 

I made a type def Data.ctl control to hold all the references of objects, which looks like this: 

 

2.PNG

 

 

but when I tried to pass the reference I got class conflict error, I understand the use of property node and using the value for each case of case structure. But I am unable to pass reference into a difference vi, 

 

3.PNG

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 4 of 17
(5,097 Views)

Right click on the tab control refnum and change the "Select Control Type" to "Page Selector".  Does that fix the issue?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 17
(5,091 Views)

I tried this but I get a variant data type using value property, how would I access each page of tab control. 

 

4.PNG

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 6 of 17
(5,088 Views)

tab control.png

Not sure how you are doing this, but this is how I would bundle/unbundle the ref...

 

[edit] that's weird, the snippet turned my ref into control

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 17
(5,079 Views)

5.PNG

 

data type of value is variant, I am not understanding what am I doing wrong ? 

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 8 of 17
(5,071 Views)

Hi Raj,

 

You're seeing this conflict because the tab control refnum control is strictly type-defined (notice the red star in the bottom left corner) and something about the tab reference you're providing doesn't match up - it could be the number of tabs, names of tabs, tab order, etc. You should be able to resolve the conflict by right-clicking on the control within the cluster and deselecting the "Include Data Type" option. 

 

@ billko - you get a control in the snippet because the snippet algorithm uses the "create SubVI" code path and exports the block diagram of the subVI that would be created.

 

Regards,

 

 

Tom L.
0 Kudos
Message 9 of 17
(5,069 Views)

This might explain it better:

 

Untitled.png

Weakly-defined types allow for coercion, whereas the strictly type-defined reference will break if it doesn't receive an equivalent reference.

 

Regards,

Tom L.
Message 10 of 17
(5,062 Views)