コード例 #1
0
        public void Update()//Because of the 4 different senarios, the update function has some overloading
        {
            _PV = Filter.FilterValue((Read.Value - 1) * 50 / 4);

            UpdateAlarms();
            OPC_PV.Write(_PV);
        }
コード例 #2
0
 private void trmTick_Tick(object sender, EventArgs e)
 {
     TT01.Update(Airheater.y);
     PI.r        = OPC_r.Read();
     Airheater.u = PI.Compute(TT01.PV);
     OPC_u.Write(PI.U);
 }
コード例 #3
0
        public double Compute(double PV)//Standard PI controller with anti wind-up
        {
            r = OPC_R.Read();
            e = r - PV;
            P = Kp * e;
            I = I + e * (Kp * Ts) / Ti;


            if (I > MaxU)
            {
                I = MaxU;
            }
            else if (I < MinU)
            {
                I = MinU;
            }

            if (P + I > MaxU)
            {
                U = MaxU;
            }

            else if (P + I < MinU)
            {
                U = MinU;
            }

            else
            {
                U = P + I;
            }

            OPC_U.Write(U);
            return(U);
        }
コード例 #4
0
 public void Update()//For real processs
 {
     NI_R.Value = (OPC_R.Read() * 4 / 50 + 1);
     OPC_U.Write(NI_U.Value);
 }