Limiting the write tag values like in PID

Forum Home Forums Understanding the Software Using Formulas Limiting the write tag values like in PID

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10183
    arunagiri
    Participant

    Hi,

    I am trying to write the values to the manipulating variable (Final Control Element) like control valves. I want to define low/high limit values to the same tag.

    Example:
    I wanted to write a value to the tag valve position=22
    Low Limit of valve=20
    High Limit of valve = 30

    when I write valve position=35 for example
    It should be sent 30 since it is a High Limit

    when I write valve position=15 for example
    It should be sent 20 since it is a Low Limit

    • This topic was modified 2 years ago by arunagiri.
    #10186
    Mikhail
    Moderator

    Hi,

    You should add a formula in the Formulas table to change a command value if it is out of limits. For example:

    public double FixVal(double x)
    {
      if (x < 20)
        return 20;
      else if (x > 30)
        return 30;
      else
        return x;
    }

    Then use the formula in the output channel: FixVal(CmdVal)

    • This reply was modified 2 years ago by Mikhail.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.