03-23-2009 05:09 AM
Hello ! I am a newbie in LabView. I am starting to use LabView 8.2.
My question is this : How can i make a 3 value control, and how can i change the value of this control on mouse click.
Also ... i want this control to be a led button (like a boolean control is) and i want it to change color on value change.
How can this be achieved ?... Any ideas ?...I've searched the forum but didn't came across any clear solution.
Thank you 4 your time !
Solved! Go to Solution.
03-23-2009 06:12 AM
Hai,
if you want a control with three states there are number of ways to acheive this. One simple straight solution is to use system mixed checkbox which has ON, OF, Mixed states and toggles between states on mouse click.
The other solutions are create a Enum with three items same can be applied to ring.
Feel free to post for queries.
03-23-2009 06:16 AM
1. You can take a Color Box Indicator for your issue. Than you will need the Event structure to cath the mouse down event on this indicator, there, in this event case you can set any color you want to your color box indicator.
2. Other way is to take a picture ring control with 3 pictures, foreach state.03-24-2009 04:58 AM
Ok ! Thank you 4 all your answers.
The attached vi is my solution to the problem.
My next question is: could this be done in a simpler way ?
Thank 4 your time.
03-24-2009 05:09 AM
03-24-2009 05:14 AM
03-24-2009 05:16 AM
03-24-2009 05:19 AM
03-24-2009 08:03 AM
Ok... another problem ...so let's say we have a few buttons to control, individually.
I've tryed to solve this problem, with no luck, and my solution so far can be seen in the attached vi.
What is the difference between "Mouse down" and "Mouse down ?" in an event structure ? ( beside the "?" sign, of course 🙂 ).
P.S. using labView 8.2.
Thank you 4 your time.
03-24-2009 09:19 AM
Any event that has a "?" at the end of it is called a filter event. What it does is give you a way to programmatically tell LabVIEW to ignore the event. If you click on the properties at the right hand border of the event case, you'll see one called discard. If you wire a False to it, the event will behave just like a non-question mark event. If you wire a True to it, you will have captured the event, but will tell LabVIEW to ignore that the Mouse was clicked down. If you were clicking on a button, it would be a way to make LV act as if the button wasn't actually clicked.
A good use for a filter event is for a Panel Close? event. If someone clicks on the X of a window, LabVIEW would just go and shut down the window aborting the code. Often you don't want to do that, perhaps you want to save data and close off DAQ and serial devices nicely. Think of how if you click on the X in Microsoft Word, it doesn't just shut down and you lose your document. It asks you if you want to save your changes. With Panel Close?, you can capture the event of a button being clicked, but wire a False to the discard telling LabVIEW to ignore that the button was pressed. Then you can move on and execute a sequence of code to initiate a nice orderly shutdown of your VI.