I think what you are asking is directly from the button itself, during design time. Try this.
A button is on the screen for a user event so set the variable that you want to toggle under CATEGORY-INPUT, Check toggle variable and place a boolean in the variable entry box. Now when ever that variable is TRUE the color variable under CATEGORY-COLORVARIABLES-FILL COLOR ALARM will be used.
CATEGORY-COLORVARIABLES-FILL COLOR is changing the default gray color to a color of your choice when there is no alarm and no alarm fill color selected.
So if you tie the toggle variable to PLC_PRG.a, and set FILL COLOR ALARM to 16#0000FF00 the button will fill completely green when ever a := TRUE;
If you want to set the button frame color then that is found and selected under CATEGORY-BITMAP-ALARM COLOR.
I use this sometimes because the CoDeSys button is very hard to tell that it is actually depressed so I color it to exaggerate the alarm.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
How to change the color for "Button". In CoDeSys V2.3 (Visualization) tool
"Color Change" option is disabled.
Please let me know if anybody knows.
best
Anil
Idea nΒ°1 :
VAR_GLOBAL
END_VAR
PROGRAM
IF Bool1 THEN
ELSE
END_IF;
Configuration of the button :
Category Input : Toggle variable : .Bool1
Category Colorvariables : Fill Color : .Color1
Idea nΒ°2 :
Use a rectangle instead of a button, You will lose the draft of the button on the click but the color change is easier to configure !
J hope this can help you
I think what you are asking is directly from the button itself, during design time. Try this.
A button is on the screen for a user event so set the variable that you want to toggle under CATEGORY-INPUT, Check toggle variable and place a boolean in the variable entry box. Now when ever that variable is TRUE the color variable under CATEGORY-COLORVARIABLES-FILL COLOR ALARM will be used.
CATEGORY-COLORVARIABLES-FILL COLOR is changing the default gray color to a color of your choice when there is no alarm and no alarm fill color selected.
So if you tie the toggle variable to PLC_PRG.a, and set FILL COLOR ALARM to 16#0000FF00 the button will fill completely green when ever a := TRUE;
If you want to set the button frame color then that is found and selected under CATEGORY-BITMAP-ALARM COLOR.
I use this sometimes because the CoDeSys button is very hard to tell that it is actually depressed so I color it to exaggerate the alarm.