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

  • 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.

  • Hello Eric,
    thank you very much for your detailed explanation!

    How can I check if the calculated variable increases the point count, since they are calculated dynamically.

    Thank you very much,
    Bernhard Fuchs
  • Hello Bermhard;
    The calculated tag is not an I/O tag so it is not counted.
    However it is calculated all the time, even if you do not need them. So it will increase the load on the system, especially if you have a PLC tag. The I/O server will read that tag every time.
  • Hi
    Not sure if point count is a concern for you here but wouldn't it be better to do the calculations in the PLC then read and trend the resulting tags in Citect?
  • I agree with !
    the point counts is impacted as confirmed by Eric in the first comment:

    "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."

    You can check at runtime the number of dynamic points on the general page of the Client process on the Citect Server.