RSLOGIX5000斜坡函数AOI
RAMP_FC
//使能&保持
if not EN then
Output_val:=0;
tnd();
end_if;
//偏差
Err:=Input_val-Output_val;
if not (Err=0) then
Cycle_Val:=Ramp_Rate*Cycle_Time/60000;
end_if;
//计算
if Err<-Cycle_Val then
Output_val:=Output_val-Cycle_Val;
elsif Err>-Cycle_Val and Err<Cycle_Val then
Output_val:=Output_val+Err;
elsif Err>Cycle_Val then
Output_val:=Output_val+Cycle_Val;
end_if;