From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Revision: How to make tab control stop on a specific page upon pressing Pause?

I have a scrolling tab which scrolls through the tab pages until the user presses Pause. That works. Now I want the tab control to stop on a specific page once the user presses Pause. How to do this?

0 Kudos
Message 1 of 7
(2,917 Views)

Stop executing the part of the code that does the incrementing to step through the pages!

0 Kudos
Message 2 of 7
(2,916 Views)

Well, hopefully I can give a simpler explanation of my project. There is a tab control (right now of 3 pages). I have written code which flips (scrolls) through the pages, one page per second approx. There is also a Pause button. When the user presses it, the scrolling of pages stops and whatever page is shown at the time of Pausing is the page that is viewable. So that could be page 1, 2, or 3 given when the Pause button was pressed.

 

But now, I would like to implement the feature that when the Pause button is pressed the tab control, through coding, has no choice but to show Page 1 (for example) or whichever page I restrict it to.

 

Actually I think I've got a idea now after typing this out, but your suggestions are very welcome!

 

I've attached screenshots of my code to this reply. The first two show Case States in my code (scrolling, not scrolling) and the 3rd isof the Front Panel and the tab panel itself.

Download All
0 Kudos
Message 3 of 7
(2,901 Views)

Sorry if the screenshots are too cropped. I couldn't shrink down everything enough.

0 Kudos
Message 4 of 7
(2,895 Views)

You could just write whichever case you want to the tab control inside of the Pause = TRUE case.  That is the simple way based on what I see of your code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(2,888 Views)

One recommendation I would have is to keep the current page number in shift register and increment that number in the timeout event, rather than using the i iteration value.  If you add other events they way you have it now, they would trigger the event structure and thus iterate the loop, and when you get back to the timeout case, it would appear that the code is jumping over certain tabs.

0 Kudos
Message 6 of 7
(2,875 Views)

ScreenHunter_28 Aug. 28 09.54.jpgScreenHunter_29 Aug. 28 09.57.jpg

 

 

 

 

 

 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 7 of 7
(2,863 Views)