02-09-2012 09:48 AM
Hi,
I am attaching the VI and Sub VIs of my application. My application says when you select a signal type from cluster present in front panel and submit corresponding panel light will glow and a bit also will proceed to DAQ assistance.
My application was working fine but when I inserted a Tab control in front panel to enhance my application it stopped working, I know the problem is in the find light.VI sub VI but I am not able to trace.
Thanks
Prashant
02-09-2012 10:43 AM - edited 02-09-2012 10:44 AM
The controls don't exist on the panel anymore. The tab control exists on the panel.
From there, you have to use the property node "Pages" which gives you an array of all the pages in the tab control. From there, you need to determine which page has your control, and use that page reference with a Property node for "Controls on Page" which gives an array of references to all the controls on the page.
The snippet below shows how to build an array of all the controls on all the pages.
02-09-2012 10:55 AM
When you place controls in a tab, those controls become elements of a page of the tab control, not of the top-level front panel. If all the lights are on the same page, you can get a reference to all the controls on that page instead of getting a reference to all the controls on the top level of the VI, as shown here:
I don't have time to really look at your VI and understand what it does, but all the manipulation of controls using references without ever writing to the terminals makes me suspect there's a better way to do it, possibly involving putting all the lights in a cluster. Also, if you're just using the tab as a way to put a box around the lights, consider using a simple decoration instead - then you won't have to change your code.
02-09-2012 11:14 AM
As Ravens Fan and nathand said you can take the reference of the Tab control and access each indicator and also
I would recommend you to put all your Boolean indicators into a cluster and take the reference of the cluster and from that you can take the reference of each controls individually like this.
02-09-2012 11:35 AM
Hi,
I have to put same number of indicators in three differenet tabs and control those with the help of WIU enum so I think using cluster is not a good idea.
Can I make lable text property of ctl on page?
Please suggest.
Thanks
Prashant
02-09-2012 01:28 PM
Hi,
I have to convert data from (ctlsonpage) to text string because I have to compare those with the indicator strings present in the front panel and lit the light. Please suggest how to convert output of ctlson page to a text string.
Thanks
Prashant
02-09-2012 01:34 PM
The output from CtlsOnPage is similar to the "Controls[]" output from the VI property node in the code you uploaded, except that it contains references only to the controls contained on that page of the tab control.
02-09-2012 02:23 PM
Hi,
This is what I made in the attachment, the problem I am facing while connecting this sub VI to the main VI and also refnum input for TabCtl propery node. Please comment and suggest.
Thanks
Prashant
02-09-2012 02:52 PM
drop a vi server ref contrtol on the FP right click it and follow:
Select VI Server Class>>Generic>>GObject>>Controls>>PageSelector>>TabControl
Similarly in your array constant you want the type to be Generic>>GObject>>Control>>Control to fix that coersion