Showing results 1 to 5 of 5

Thread: Change Text Color with Straton

  1. #1
    Join Date
    09.02.2018
    Posts
    9

    Default Change Text Color with Straton

    Hi, 

    I am trying to change the text color of a dynamic text field. I can see that there is a variable named Text color dynamic, but I don't know what type of variable I need to assign there or the syntax to use an RGB code to control the color output. Wish someone could offer some guidance.

    Thanks and Regards.

  2. #
    Join Date
    08.12.2015
    Posts
    39
    Best Answer

    Default Re: Change Text Color with Straton

    Ah ok, then it is not just about straton

    But I see what you are trying to do.
    What you have to use is a Reaction Matrix.

    In your zenon project, go to "Variables > Reaction Matrix > Numeric".
    Here, add a new reaction matrix with the values and colors you need;
    1. New status
    2. Value: Equal to the value you will have for your straton variable
    3. Limit value color: the color linked to the value
    4. Do this for each value (can be 0 = green and 1 = red in your case)

    Click image for larger version

Name:	zenonReMa.png
Views:	16
Size:	87.5 KB
ID:	2281

    After that, once you associated every colors to every values you will have, validate and go to the zenon "Variables".
    On the variable you want to be linked to the colors you chose: go to its properties > Limit values > Reaction Matrix [...] => here, choose the reaction matrix you created

    Then, the last step.
    In your dynamic text properties > Text > Text color dynamic > Text color => associate your variable and think to check, just below, "Use limit value color"

    That's all, you just have to set the variable to "Externally visible" so you can control it via straton, then the color will be the one linked to the value you set in the Reaction Matrix

    I hope it is what you are looking for

    Regards,
    Anthony

  3. #2
    Join Date
    08.12.2015
    Posts
    39

    Default Re: Change Text Color with Straton

    Hello,

    Do you mean in the straton Graphics or in the Straton Embedded HMI?
    In the graphics, there is no such option, it is not possible to link a variable to the text color.
    In the Embedded HMI, this corresponds to the number in the "static" color (Eg. for a 1/4 VGA color, 0 is black, 1 is white, 2 is dark grey...)



    But... Only very few users are using the Embedded HMI, maybe you should use the graphics instead !?

    Regards,
    Anthony



    Attached Thumbnails Attached Thumbnails DynamicColorHMI.PNG  

  4. #3
    Join Date
    09.02.2018
    Posts
    9

    Default Re: Change Text Color with Straton

    Hi Anthony, 

    In my Zenon project I have a dynamic text label and I have to change its color from green to red and vice versa. I can see in its properties that there is a field named "Text color dynamic" and it lets me assign a variable to that field, but I don't know what type of variable it needs or how to control the color in order to get the red or green color I need. I have some logic in straton for my zenon project so I will write some code there to control the variable that changes the color of my text.

    Thanks and regards.

  5. #4
    Join Date
    08.12.2015
    Posts
    39
    Best Answer

    Default Re: Change Text Color with Straton

    Ah ok, then it is not just about straton

    But I see what you are trying to do.
    What you have to use is a Reaction Matrix.

    In your zenon project, go to "Variables > Reaction Matrix > Numeric".
    Here, add a new reaction matrix with the values and colors you need;
    1. New status
    2. Value: Equal to the value you will have for your straton variable
    3. Limit value color: the color linked to the value
    4. Do this for each value (can be 0 = green and 1 = red in your case)

    Click image for larger version

Name:	zenonReMa.png
Views:	16
Size:	87.5 KB
ID:	2281

    After that, once you associated every colors to every values you will have, validate and go to the zenon "Variables".
    On the variable you want to be linked to the colors you chose: go to its properties > Limit values > Reaction Matrix [...] => here, choose the reaction matrix you created

    Then, the last step.
    In your dynamic text properties > Text > Text color dynamic > Text color => associate your variable and think to check, just below, "Use limit value color"

    That's all, you just have to set the variable to "Externally visible" so you can control it via straton, then the color will be the one linked to the value you set in the Reaction Matrix

    I hope it is what you are looking for

    Regards,
    Anthony

  6. #5
    Join Date
    09.02.2018
    Posts
    9

    Default Re: Change Text Color with Straton

    Hi Anthony, 

    Yes, that's exactly what I wanted. Thank you very much!!!

    Thanks and Regards

Similar Threads

  1. Replies: 5
    Last Post: 18th July 2014, 13:06
  2. How to Change color of dynamic text element
    By fred.tunell@dateli.se in forum VBA
    Replies: 1
    Last Post: 19th June 2014, 08:28
  3. press button - change color
    By rgv0021 in forum VBA
    Replies: 2
    Last Post: 28th October 2013, 08:05
  4. how to change text and color of invisible button
    By tanveerali in forum zenon Supervisor
    Replies: 1
    Last Post: 14th February 2011, 00:09
  5. CEL- text color
    By hoscillada in forum zenon Supervisor
    Replies: 1
    Last Post: 21st December 2009, 11:38

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •