LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab page select

Solved!
Go to solution

Hi All

 

I've posted this question a short while ago, but had no response, so I'm trying again with a very stripped down piece of code.

 

The attached vi is a simple one. It simply scrolls through 2 pages with a tab control, and reutrns to front page.

 

I'm using the pane "mouse down" event to do the above.

 

What I'm trying to do (with no success) is run a piece of code everytime page 2 is selected (at the moment I'm trying to turn on an LED).

 

Could somebody please give me a clue as to how ro do it?

 

Caveat.....must keep the pane "mouse down" event for page selection.

 

Thanks for any help

 

Regards

Ray

0 Kudos
Message 1 of 15
(3,907 Views)

hello,

 

why not using tabcontrol as event instead of testint page 2 boolean then your case selector could react according to input 'enum'

 

code out the event structure has to be remove too

 

you can also remove the wait function it is not usefull with event structure

 

 

 

regards

 

tinnnitus

 

 

 

 

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 2 of 15
(3,899 Views)

tinnitus

 

Could you elaborate on that please?

 

 

Ray

0 Kudos
Message 3 of 15
(3,890 Views)

Attached is what you might want to get done. Let me know if it's any different. Also, you should look into using a Producer/Consumer Architecture based on Events. Have a look for that template in File -> New.. and then navigate to Design Patterns.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 15
(3,881 Views)

Adnan

This vi is almost there, however if you read my OP, the pane "mouse down" must be kept....no ifs buts or maybes. This is the single most important criteria for this application.

 

Using pane "mouse down" it doesn't work, and this is the stumbling block I am having trouble with.

 

This vi is a part of a larger vi which does use the producer/consumer architecture.

 

So, I'm back to my origianl posting.

Ray

0 Kudos
Message 5 of 15
(3,862 Views)

You have the code buried in the page2 Value Change event.  That event will never fire because 1)the page2 boolean control is an indicator 2) you only write to page2 indicator terminal.  You need to use the Value(signalling) property node of page 2 if you want to programmatically fire the page2 value change event.

0 Kudos
Message 6 of 15
(3,857 Views)

Ravens Fan

The code that was posted by Anan works if using the tab control to change pages.

 

Unfortunately, I cannot use the tab control to fire an event to change pages.

 

The postings seem to be wandering off my original post (or I'm really missing something in the above missives).

 

Let me try another approach.

 

The application this code is for is a large screen display on public viewing. The public do not (and should not) have access to a mouse or keyboard. In fact, the ONLY cobtrol to the screen for public uses is a mom push-button switch.

 

When the vi starts the mouse cursor (see my other posting) could be anywhere on the screen, and no way of guiding it to the tab controls at the top of the FP.

 

Therefore the client wants the public to use the PB switch to scroll through the pages...one after another. There will eventually be 4 pages of information and displays for public consumption.

 

The last page of the display will play a short movie (<30 seconds).

 

I hope that gives a clearer picture of why I need to use the pane "mouse down" event to change pages......

 

Thanks for your interest guys

 

Ray

 

0 Kudos
Message 7 of 15
(3,849 Views)

In your Pane Mouse Down event, write the number to the Value(Signalling) property node of the tab control as opposed to the Value property node.

 

Instead of Page2 Value change event, make it Tab Control Value change event.  Inside of that, put a case structure that runs your special code whenever New Value = Page2

0 Kudos
Message 8 of 15
(3,842 Views)

Ravens Fan

 

Problem with that is the Tab Control event continually fires because each successive mouse down is a new value

0 Kudos
Message 9 of 15
(3,828 Views)
Solution
Accepted by rayclout

Yes.  And when that event fires, you will be checking to see whether you are now (new value) on page 2 or not.  If you're not, you do nothing else.  If you are, then you run your special code.

Message 10 of 15
(3,816 Views)