12-22-2015 07:24 PM
I am building an application which uses a tab control to present 3 pages on the front panel, I then wire the tab control to a case selector on the block diagram. Within each case I have built a producer consumer loop for the buttons displayed on each page. This approach seems to work fine when there are 2 pages, but when I use 3 pages, the application fails. I am not able to switch between the pages.
Please help
12-22-2015 07:56 PM
12-22-2015 08:21 PM
The symptom you are seeing is due to many copies of events. In this case, you have multiple event structures looking for the Tab:Value Change event. When this event is not reachable due to the case structure, the front panel locks.
I agree with Mike that subpanels are what you really want to use here. You just load up the front panel of a VI and that VI contains all of the code necessary for that tab. Make duplicating the code super simple. You could even just create multiple clones of the same VI and choose which clone to load up (assuming all3 tabs are exactly the same).
As a compromise to keep your general setup, you should have 4 loops here: 1 for handling events and then 1 for each tab. You will have 3 queues so you can send the command to the right loop. You do not need a case structure to run different code based on the tab selection.
And as an asthetics go, do not color your block diagram. It makes it nearly unreadable.