Nagaraju Posted July 25, 2015 Report Share Posted July 25, 2015 Dear sir, I am using state machine concept in one of my projects. In my VI i have total 20 controls with different events. Now i would like to introduce the Pane mouse down event to front panel to validate my input parameters. If i introduce this pane mouse down event, then i have click on controls first it is executing the pane mouse down event and then it is going to particular control event means two events are happening. If i click on Pane only Pane mouse down event is executing. I want to discard the pane mouse down event when i click on the controls. Kindly let me know how to implement this kind of events. Thanks & regards, S Nagaraju. Quote Link to comment
hooovahh Posted July 27, 2015 Report Share Posted July 27, 2015 Perform the mouse down event on the control not the pane. This will generate one event when there is a mouse down. But a better solution would be to use the value change on the control, because I can change the value using the keyboard, with things like tab, which then wouldn't be caught using your mouse down event. Also post your code if you can so it can be made more clear what you are trying to do. Quote Link to comment
Nagaraju Posted July 28, 2015 Author Report Share Posted July 28, 2015 Dear sir, I am attaching my project (.zip) here, please look in to that and solve the issue. Thanks & Regards, S Nagaraju Test_Pane.zip Quote Link to comment
hooovahh Posted July 28, 2015 Report Share Posted July 28, 2015 Wow this is entirely too complicated. How do you even stop this? You have a false making sure your VI never stops running. What's with the random 10ms waits all over, and the key focus? And the 100ms loop which does nothing for you. Your enums aren't typed. Your controls aren't labeled well (there is a boolean output named true). Controls aren't on the root of the BD in subVIs. You have multiple controls named the same in a single VI, your Panel Close should always discard, so you can perform cleanup by stopping the loop. You should not exit LabVIEW like you are when in the development environment No need to validate the values again when you start, if you are validating them when they have the value changed. As I mentioned before just use the value change event on the control, no need for that top loop or all those local variables at all, or the functional global variable. Attached is an updated version with some of these changes but man you know what would make this code even easier? If you you use the control to coerce the entered value to have the range you want, then there would be no need to perform a validation because you'll know the values are correct. Lucky for you someone has already posted this solution for you Test_Pane Hooovahh Edit.zip Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.