NCLibrary V 2.1
Instructions and Graphics ( MonAn08 )
应用场合举例:
大型电机减速机和辊的轴瓦、电机转子等多点测温,都是多个温度输入,需要对其进行报警和联锁保护。
显示8个模拟量值,并对其进行归档
计算测量模拟量值的Zui大值(Max),Zui小值(Min )和平均值(Ave),可以三选一作为报警过程值
断线坏值显示并报警 (图中红线方框标记)
自动剔除模拟量坏值,坏值不参与Zui大值Zui小值平均值的计算
—————————————————————————————————————————————————
PV1~8连接模拟量过程值
Bad1~8连接模拟量过程值评估结果
Mode模式选择
——————————————————————————————————————————
FUNCTION_BLOCK MonAn08S
VAR_INPUT
PV1 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV2 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV3 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV4 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV5 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV6 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV7 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV8 {S7_m_c:='true';S7_archive:='shortterm';S7_dynamic:='true'} :REAL := 0.0; //Process Value
PV_Unit {S7_m_c:='true'} : STRING[10] := '%';//Unit of measure for processvalue
Bad1 : BOOL :=FALSE;
Bad2 : BOOL :=FALSE;
Bad3 : BOOL :=FALSE;
Bad4 : BOOL :=FALSE;
Bad5 : BOOL :=FALSE;
Bad6 : BOOL :=FALSE;
Bad7 : BOOL :=FALSE;
Bad8 : BOOL :=FALSE;
PV_ScaleHigh {S7_m_c:='true'} :REAL := 100.0; // high Limit for scale in PV bar graph offaceplate
PV_ScaleLow {S7_m_c:='true'} :REAL := 0.0; // low Limit for scale in PV bar graph offaceplate
Mode{S7_m_c:='true';S7_dynamic:='true'}:INT;
SimOn {S7_visible:='false'} : BOOL:= FALSE; //Simalation On
SimPV {S7_m_c:='true';S7_visible:='false'} : REAL := 0.0; // Process value used for SimOn =1
PV_AH_Lim {S7_m_c:='true';S7_visible:='false'} : REAL:= 95.0; // Limit PV alarm (high)
PV_WH_Lim {S7_m_c:='true';S7_visible:='false'} : REAL:= 90.0; // Limit PV warning (high)
PV_WL_Lim {S7_m_c:='true';S7_visible:='false'} : REAL:= 10.0; // Limit PV warning (low)
PV_AL_Lim {S7_m_c:='true';S7_visible:='false'} : REAL:= 5.0; // PV alarm limit (low)
PV_AH_EN {S7_visible:='false'} : BOOL := False; // 1 = Enable PV alarm limit (high)
PV_WH_EN {S7_visible:='false'} : BOOL := False; // 1 = Enable PV warning limit (high)
PV_WL_EN {S7_visible:='false'} : BOOL := False; // 1 = Enable PV warning limit (low)
PV_AL_EN {S7_visible:='false'} : BOOL := False; // 1 = Enable PV alarm limit (low)
PV_Hyst {S7_m_c:='true';S7_visible:='false'} : REAL := 0.0; // Hysteresis for PV alarm,warning and tolerance limits
Deadband {S7_m_c:='true';S7_visible:='false'} :REAL := 0.0 ; // Width of Dead band
PV_A_DC {S7_visible:='false'} : REAL :=0.0; // Delay time for incoming PV alarms[s]
PV_W_DC {S7_visible:='false'} : REAL :=0.0; // Delay time for incoming PV warnings[s]
PV_A_DG {S7_visible:='false'} : REAL :=0.0; // Delay time for gone PV alarms [s]
PV_W_DG {S7_visible:='false'} : REAL :=0.0; // Delay time for gone PV warnings [s]
SampleTime {S7_visible:='false';S7_sampletime:='true'} : REAL :=0.2; // Sampling time [s] (assignedautomatically)
END_VAR