08-23-2013 02:38 PM
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 ?
Solved! Go to Solution.
08-23-2013 02:53 PM
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.
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...
08-23-2013 02:55 PM
Tab Controls have a property node item called Pages which returns an array of refnums.
08-26-2013 02:06 PM
I have following front panel :
I made a type def Data.ctl control to hold all the references of objects, which looks like this:
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,
08-26-2013 02:13 PM
Right click on the tab control refnum and change the "Select Control Type" to "Page Selector". Does that fix the issue?
08-26-2013 02:17 PM
I tried this but I get a variant data type using value property, how would I access each page of tab control.
08-26-2013 02:36 PM - edited 08-26-2013 02:38 PM
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
08-26-2013 03:00 PM
data type of value is variant, I am not understanding what am I doing wrong ?
08-26-2013 03:02 PM
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,
08-26-2013 03:10 PM
This might explain it better:
Weakly-defined types allow for coercion, whereas the strictly type-defined reference will break if it doesn't receive an equivalent reference.
Regards,