PID processing instruction
This implementation allows you to access the F355_PID instruction via the structure PID_DUT_31.
Input
FALSE: Manual setting of MV possible
TRUE: Automatic PID controlled MV
Output
For a detailed explanation of parameters, please refer to PID_DUT_31
The value for MV can be assigned externally either when the program is initialized or when the value of Automatic is FALSE.
In order to achieve maximum resolution and minimum dead time beyond LowerLimit and UpperLimit, these values should, if possible, cover the entire range of 0–10000.
if the parameter settings are outside the permissible range
if the parameter settings are outside the permissible range
In the global variable list you define variables that can be accessed by all POUs in the project.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR_EXTERNAL
Set_Value_SP: INT:=0;
(*A/D CH0*)
Process_Value_PV: INT:=0;
(*A/D CH1*)
Output_Value_MV: INT:=0;
(*D/A*)
END_VAR
VAR
PID_Parameter: PID_DUT;
(*PID Parameters*)
PID_Control: PID_FB_DUT;
@'': @'';
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 4 ;
NETWORK_BODY
B(B_VARIN,,Set_Value_SP,9,2,11,4,);
B(B_VAROUT,,PID_Parameter.SP,11,2,13,4,);
L(1,0,1,4);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 2 ;
NETWORK_BODY
B(B_VARIN,,Process_Value_PV,9,0,11,2,);
B(B_VAROUT,,PID_Parameter.PV,11,0,13,2,);
L(1,0,1,2);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_FB,PID_FB_DUT!,PID_Control,10,1,18,5,,?BAutomatic?BPidDut?APidDut);
B(B_VARIN,,TRUE,8,2,10,4,);
B(B_VARIN,,PID_Parameter,8,3,10,5,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 4 ;
NETWORK_BODY
B(B_VARIN,,PID_Parameter.MV,10,2,12,4,);
B(B_VAROUT,,Output_Value_MV,12,2,14,4,);
B(B_COMMENT,,Write manipulated value to the output,3,1,22,2,);
L(1,0,1,4);
END_NETWORK_BODY
END_NET_WORK
END_BODY
PID_Parameter.SP := Set_Value_SP;
PID_Parameter.PV := Process_Value_PV;
PID_Control( Automatic:= TRUE,
PidDut:= PID_Parameter);
Output_Value_MV := PID_Parameter.MV;