10-05-2010 03:29 AM
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
Solved! Go to Solution.
10-05-2010 03:46 AM
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
10-05-2010 04:32 AM
tinnitus
Could you elaborate on that please?
Ray
10-05-2010 04:58 AM
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.
10-05-2010 03:29 PM
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
10-05-2010 03:42 PM
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.
10-05-2010 03:55 PM
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
10-05-2010 04:12 PM - edited 10-05-2010 04:13 PM
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
10-05-2010 05:18 PM
Ravens Fan
Problem with that is the Tab Control event continually fires because each successive mouse down is a new value
10-05-2010 07:53 PM - edited 10-05-2010 07:58 PM
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.