05-17-2017 11:14 AM
Hello all,
I am implementing a function that using enqueue/dequeue for the button function selection in one tab, when the tap is switched to another, the two while loops stop immediately in the current tab and start the function of the new tab. (Sound crazy...) However, the program failed at recognizing the tab is switched and still stays in the current tab.
My simple code is attached, is it possible to implement such functions as described? Thanks for any comment if possible. Have a nice day!
05-17-2017 11:16 AM
Sorry forget to mention that this code was revised based on another guy from this forum...
05-17-2017 11:39 AM
@Andrea0909 wrote:
Sorry forget to mention that this code was revised based on another guy from this forum...
I'm sure I'm not the other guy
Lets get down with the two biggest problems I see
I hate Tabs
05-17-2017 11:45 AM - edited 05-17-2017 11:47 AM
Hi Andrea,
while I'm not hating tab controls I strongly advise to clean up your VI!
- Why are you using so many local variables? Their terminals are even unused!
- Why do you have a control AND an indicator having the very same label "Read"? How will you (or any other programmer) know which of them is referenced by the local variable "Read"???
- Why do you even have a loop inside the "page 2"/"page 3" case?
- After using so many local variables: WHY did you use "value" property nodes of the TAB control?
Sorry forget to mention that this code was revised based on another guy from this forum...
Why don't you provide a link to the source of this VI?
05-18-2017 04:12 AM
Thanks for the reply.
The issue link is http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loops-inside-a-case-structure/td-p/591259, message 9. The function of this VI is to stop the while loop if switching the tab.
My goal is turning on the "Read" LED when clicking the "Read" button in the first page of the tab. Then turning off the LED when switching to the second tab. The three looping led just to indicate the current tab the programming is staying at.
As far for the issue,
1. the loop1 led is always on when switching the tab.
2. the "Read" LED can not be turned off when switching to 2nd tab.
Guess the while loop in the 1st tab is not stopped when switches to others, while the original code in the above link is working.
So what is going wrong here... Thanks for any comments.