在生产过程中需要SMC DP通讯的设备的电流进行保护连锁,因此新增功能块,用于DP设备电流报警连锁。供大家参考。 FUNCTION_BLOCK "SMC_CUR" TITLE='SMC_CUR' AUTHOR:chd NAME:SMC_CUR VERSION:'1.0' FAMILY:SFC_Ctrl KNOW_HOW_PROTECT
VAR_INPUT CUR{S7_dynamic:='true'}:REAL:=0; // HRANGE{S7_dynamic:='true'}:REAL:=0; // LRANGE{S7_dynamic:='true'}:REAL:=0; // QUALITY{S7_dynamic:='true'}:BYTE:=0; //
END_VAR VAR_OUTPUT QCUR{S7_qc:='true';S7_dynamic:='true';S7_m_c:='true';S7_shortcut:='CUR';S7_unit:=''}:REAL:=0;// QC_QCUR:BYTE:=16#80;//
END_VAR
VARTEMP
TOP_SI:STRUCT EV_CLASS:BYTE; EV_NUM:BYTE; PRORITY:BYTE; NUM:BYTE; TYP2_3:BYTE; TYP1:BYTE; ZI1:WORD; ZI2_3:DWORD; END_STRUCT; START_UP_SI:STRUCT EV_CLASS:BYTE; EV_NUM:BYTE; PRORITY:BYTE; NUM:BYTE; TYP2_3:BYTE; TYP1:BYTE; ZI1:WORD; ZI2_3:DWORD; END_STRUCT; ERR:INT; //Error at startup END_VAR
BEGIN QC_QCUR:=QUALITY; QCUR:=CUR*(HRANGE-LRANGE)/100.0;
END_FUNCTION_BLOCK |