jess05 Posted May 31, 2005 Report Share Posted May 31, 2005 i haven't found anything on this topic, but i thought someone might know - is it possible for me to assign mouse buttons to booleans? (in LabVIEW 6.1) i have a start and stop button in my program and want to make the left button click activate the start button and the right activate the stop - possibly assign the mouse wheel to a third button i'd love it if anyone could help me out with this. thanks... jess ps: orange button = start "stop" = stop Download File:post-2309-1117562866.vi Quote Link to comment
Mark Balla Posted June 1, 2005 Report Share Posted June 1, 2005 Here is how you would do it using the event structure. Select Vi with the mouse up option Wire off of the button terminal for start or stop. The mouse cursor must be over the front panel when the mouse is clicked in order for the event structure to pickup the event. As for making it work in you attached vi thats another issue. You may want to consider using a state machine or other method to organize your code. Quote Link to comment
jess05 Posted June 1, 2005 Author Report Share Posted June 1, 2005 As for making it work in you attached vi thats another issue. yeah, that's the problem - i am not sure if it is possible to do that within my setup - i tried looking at lots of different case structure examples and wasn't sure if it was possible within my program- the program works the way that i want/need it to, but my advisor wanted me to try to set it up so that we could start and stop it by clicking different mouse buttons - we need to operate the program from a distance, and we're using a very small laptop so if we can start/stop our program without being able to see the screen, it is ideal... You may want to consider using a state machine or other method to organize your code. i am not sure what this is or how to do it... any suggestions? i have only been using labview since January 2005, and never had to use it extensively until now. thanks for the help! i appreciate it. :thumbup: Quote Link to comment
Mark Balla Posted June 1, 2005 Report Share Posted June 1, 2005 Here is a Demo program that shows how I would approach this program. First separating the User interface from the Processes by using separate loops Next Use a state machine to separate out each process and Daq event. Finally tranfer commands between the 2 loops by using a Que. Download File:post-584-1117644639.llb Hope this isn't too far over your head. This is my favorite type of structure and I use it in various forms for all of my programs. Quote Link to comment
Yair Posted June 19, 2005 Report Share Posted June 19, 2005 If you want to detect the mouse click without an event, you should use the Input Device VIs in the advanced palette. Place a Mouse Init VI to get a connection to the mouse and wire the connection into Acquire Input Data. You will get a cluster telling you which buttons are pressed. You will have to do this by polling. 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.