In B&R Automation Studio, the initialization would be something like:
PROGRAM _INIT (* PID parameters *) PID_FrwBack.PIDParameters.Gain := 0.5; PID_FrwBack.PIDParameters.IntegrationTime := 0.7; PID_FrwBack.PIDParameters.DerivativeTime := 0.3; PID_FrwBack.PIDParameters.FilterTime := 0.03; END_PROGRAM PROGRAM _CYCLIC // ------------------------------------------------- // PID_FrwBack - Forwart/Backwart PID Controller // ------------------------------------------------- PID_FrwBack.SetValue := iSetVal; PID_FrwBack.ActValue := iActVal; // Actual Value (* call function block *) PID_FrwBack(); // Controller Output iDrive := PID_FrwBack.Out; // -------------------------------------------------
How can I do this in Codesys? Is there also some kind of Program _Init section?
OK, it's actually quite easy. If I'm not mistaken one has to do the initialization in the "Var" Section, like
VAR PID_FrwBack: Ctrl.Controller_PID := (lrKP := 10); END_VAR
Log in to post a comment.
In B&R Automation Studio, the initialization would be something like:
How can I do this in Codesys? Is there also some kind of Program _Init section?
Last edit: Dr. No 2021-04-27
OK, it's actually quite easy. If I'm not mistaken one has to do the initialization in the "Var" Section, like