Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Defining two variable in one rectangle box in Visualization

BY
2017-01-13
2017-04-22
  • BY - 2017-01-13

    Hello,

    I have researched lots of thing about this topic, but I could not find anything. I am using CodeSys V2.3 and in Visualization section, I created one rectangle box. Then In its "Variable>Textdisplay" menu, I want to declare two variables. How can I do it?

    P.S.1 : I did so many things. Like C language I tried that:
    I write to "Text Content": "%s %s", then I write to "Variable>Textdisplay" section two variable as "Var1,Var2". But it displayed nothing.

    P.S.2 : Also I tried to write to "Variable>Textdisplay" section "CONCAT(Var1,Var2)". But it did not work,too.

    I would be gratefull if you can help me.

     
  • Anonymous - 2017-01-19

    Originally created by: scott_cunningham

    Probably the easiest is to use two boxes. Use one box for the shape, color and first variable. The secret me box is for the second variable and it should not have any fill or edge. Place it on top/inside your first box so the variables line up as you prefer.

     
  • BY - 2017-01-27

    Thank you for your reply scott_cunningham. I have already known that. I just wanted to learn there is or not a way defining two variable in one rectangle.

     
  • josepmariarams - 2017-04-21

    Hi.

    Field invisible accepts a method which returns an boolean.

    May be the field where adds the variable to visualize accepts a method returning an string. (Method could contains concat).

     
  • LMDaniel999 - 2017-04-22

    If the concat method won't work in the visu, you can create a simple program on the plc, which concats the strings.
    You can add Numbers, Time, Strings, etc.
    So you create your custom output string and put it into the rectangle box by using this output string as the text variable and as text you use %s.

    If you need an "multi-output-field", this is my preferred method.
    You can change the strings easily in the program.

     

Log in to post a comment.