05-21-2015 03:48 AM
Dear sir,
I am developing an application using state machine concept and it consisting of START & STOP buttons. Initially i want to put green color for start button and red color for stop button. when the moment i click on start button the color should change to red and the stop button should change to green color at the same time. Similarly if i click on stop button it will interchange the colors (like traffic signal).
Regards,
S Nagaraju
05-21-2015 04:07 AM - edited 05-21-2015 04:08 AM
Hi S,
that's a nice project. And what's your problem?
- Each FP element has properties - and you can change those properties programmatically using property nodes!
- User actions are best processed by the event structure…
05-21-2015 10:30 AM
Gerd gave you some good tips to help get you started.
But I'm wondering if what you are describing is the right thing to do.
It would seem very confusing to me to have a situation where Start is now red, and Stop is now green.
If you want to signal that a button is no longer pressable or should be used in the current context, then I would use the Disabled and Grey property on those buttons and leave the colors alone.
05-21-2015 11:00 AM
Building on what RavensFan said I would also suggest using the "Visible" property to hide the button once it is not needed and show the other.
05-21-2015 10:39 PM
can you please provide the an example. I tried using property node and event structure but it is not working.
05-21-2015 11:10 PM
Dear sir,
My application development steps are as follows:
1. My application consists of three control buttons are Start, Stop & Exit
2. Initially input parameters validation (Limits are assigned)
3. If any value entered out of limit, it will show the error message and the start button will gray and disabled. The user should not start the application until entered values are valied.
4. Internally some conversions and logics are implimented.
5. Coming to Front panel (GUI) start button is green color and stop button is red color.
6. The user entered the correct parameters and he started the appilication. After sometime he should know already application was started and he should not start again until he stops the appilcation.
For this i need logic for start and stop buttons to implement in my application. Thats why i choosen the traffic light concept changing the colors vice versa (which button shows green he should press that perticular button).
Please suggest me or provide any better option for start and stop buttons.
Regards,
S Nagaraju
05-21-2015 11:51 PM - edited 05-21-2015 11:53 PM
Share your code.
As others said, Instead of changing colors, Change the propriety value.
Example: If value is out of limit, Make START button in “Disabled and Gray out” mode with its property value.
Once user is setting correct values, Change the START button to “Enable” mode.
If user is pressing START button, Enable STOP button & Disable START button or Hide. After execution, Make it reverse.
05-22-2015 03:51 AM
Hi Munna,
Please find the enclosed main VI and subVIs.
Provide the interactive solution for those start and stop buttons.
Nagaraju.
05-22-2015 08:12 AM
It looks like you've figured out how to disable the Start button once you press Start as I can see in the Start: Value Change event case. In that same case you need to enable the stop button.
Then copy the code into the Stop: Value change event case and do just the opposite with them.
05-22-2015 11:09 PM
If you observe clearly, I am disabling the start button if the entered values are invalid and enabling if the values are valid. The condition is contineously checking. If the start button is disabled after pressing the start button, immediately it will enable because that condition will check contineously. Thats why I am looking for color combination. Please provide some solution for this asap.