CoDeSys V2.3 Visualization "Button"

anni-reddy
2009-11-19
2009-12-09
  • anni-reddy - 2009-11-19

    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

     
  • JAPIB

    JAPIB - 2009-11-20

    Idea nΒ°1 :

    VAR_GLOBAL

     Bool1:BOOL;
    
     Color1:DWORD;
    

    END_VAR

    PROGRAM

    IF Bool1 THEN

     Color1:=16#00808080;
    

    ELSE

     Color1:=16#00FF0000;
    

    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

     
  • spfeif - 2009-12-09

    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.

     

Log in to post a comment.