Labels or calculated Variable?

Hello to all!

I would like to make mathematical
calculations with some PLC variables and then display them in runtime or record them as a trend.

What is a better option here:
Labels or calculated Variables?
What is the difference between the two possibilities, where are the advantages and disadvantages.

Are the calculated variables counted as license points?

Thank you very much.
Bernhard

Parents
  • Either way should work, depending on what you want to use it for.

    For point counts, the help says:

    Note: If the expression in the Address field reads from or writes to another tag in the system, the calculated variable is added towards the point count.

    I wouldn't think it would add a point if the referenced tags had already been counted, but you may want to test that.

    Labels cause the actual calculation to be inserted in the command or expression in the compiled version of the project. That's normally fine, unless it is a place that only allows for a single tagname, like when you associate a tag with a super genie. In that case, you would need a calculated variable.

    Another difference is that calculated variables are calculated by the I/O server. Labels are calculated on the client, or wherever they're used. It's unlikely, but if you want to use a local variable from the client in a calculation or the expression calls a Cicode function that needs to run on the client, then you would need to use a label.

    I don't know of a difference in performance. Calculated variables are only supposed to update if some part of Citect is trying to read them, such as when you display it on a page. Labels would work the same way.

Reply
  • Either way should work, depending on what you want to use it for.

    For point counts, the help says:

    Note: If the expression in the Address field reads from or writes to another tag in the system, the calculated variable is added towards the point count.

    I wouldn't think it would add a point if the referenced tags had already been counted, but you may want to test that.

    Labels cause the actual calculation to be inserted in the command or expression in the compiled version of the project. That's normally fine, unless it is a place that only allows for a single tagname, like when you associate a tag with a super genie. In that case, you would need a calculated variable.

    Another difference is that calculated variables are calculated by the I/O server. Labels are calculated on the client, or wherever they're used. It's unlikely, but if you want to use a local variable from the client in a calculation or the expression calls a Cicode function that needs to run on the client, then you would need to use a label.

    I don't know of a difference in performance. Calculated variables are only supposed to update if some part of Citect is trying to read them, such as when you display it on a page. Labels would work the same way.

Children
No Data