回复:还记得ZANE版主的报警处理FB块吗?

坏笨笨

  • 帖子

    402
  • 精华

    4
  • 被关注

    48

论坛等级:侠士

注册时间:2010-03-17

白金 白金 如何晋级?

发布于 2014-03-04 14:20:48

36楼

//********************************50个设备的声光报警,按一次reset就复位************************************//
FUNCTION_BLOCK FB160
VAR_TEMP

t_count:INT;
END_VAR
VAR
// Static Variables
s_Pulse_MEM1:ARRAY [1..50] OF BOOL;
s_Pulse_MEM2:ARRAY [1..50] OF BOOL;
s_Pulse_MEM3:ARRAY [1..50] OF BOOL;
s_Pulse_MEM4:ARRAY [1..50] OF BOOL;
s_Pulse_MEM5:ARRAY [1..50] OF BOOL;
s_Pulse_MEM6:ARRAY [1..50] OF BOOL;
s_Pulse_MEM7:ARRAY [1..50] OF BOOL;
s_Pulse_MEM8:ARRAY [1..50] OF BOOL;
s_Pulse_MEM9:ARRAY [1..50] OF BOOL;
s_Pulse_MEM10:ARRAY [1..50] OF BOOL;
s_Pulse_MEM11:ARRAY [1..50] OF BOOL;
s_Pulse_MEM12:ARRAY [1..50] OF BOOL;
s_pulse_MEM13:ARRAY [1..50] OF BOOL;
s_Pulse1:ARRAY [1..50] OF BOOL;
s_Pulse2:ARRAY [1..50] OF BOOL;
s_Pulse3:ARRAY [1..50] OF BOOL;
s_Pulse4:ARRAY [1..50] OF BOOL;
s_Pulse5:ARRAY [1..50] OF BOOL;
s_Pulse6:ARRAY [1..50] OF BOOL;
s_Pulse7:ARRAY [1..50] OF BOOL;
s_Pulse8:ARRAY [1..50] OF BOOL;
s_Pulse9:ARRAY [1..50] OF BOOL;
s_Pulse10:ARRAY [1..50] OF BOOL;
s_Pulse11:ARRAY [1..50] OF BOOL;
s_Pulse12:ARRAY [1..50] OF BOOL;
s_pulse13:ARRAY [1..50] OF BOOL;
s_count:INT;
s_running:BOOL;
s_Warning:BOOL;
END_VAR
VAR_INPUT
NumberOFDevices:INT;
DevicePar:ARRAY [1..50] OF UDT5;
END_VAR
VAR_OUTPUT
AlarmBeeping:BOOL;
RunningBeeping1:BOOL;
RunningBeeping2:BOOL;
AlarmFlash:BOOL;
END_VAR
BEGIN
t_Count:=0;
s_count:=0;
runningbeeping1:=false;
runningBeeping2:=false;
alarmFlash:=false;
s_warning:=false;
FOR t_count:=1 TO NumberOFDevices BY 1 DO
s_Pulse1[t_count]:=DevicePar[t_Count].Read.Fault AND NOT s_Pulse_MEM1[t_count];
s_Pulse2[t_count]:=DevicePar[t_Count].Read.Overload AND NOT s_Pulse_MEM2[t_count];
s_Pulse3[t_count]:=DevicePar[t_Count].Read.ShearLSW_CW_RopeDis AND NOT s_Pulse_MEM3[t_count];
s_Pulse4[t_count]:=DevicePar[t_Count].Read.Not_standby AND NOT s_Pulse_MEM4[t_count];
s_Pulse6[t_count]:=DevicePar[t_Count].Read.CW_limited AND NOT s_Pulse_MEM6[t_count];
s_Pulse7[t_count]:=DevicePar[t_Count].Read.CCW_Limited AND NOT s_Pulse_MEM7[t_count];
s_Pulse8[t_count]:=DevicePar[t_Count].Read.Inhibit AND NOT s_Pulse_MEM8[t_count];
s_Pulse9[t_count]:=DevicePar[t_Count].Read.CommunicationError AND NOT s_Pulse_MEM9[t_count];
s_Pulse10[t_count]:=devicepar[t_count].read.L_DoorLSW_Error AND NOT s_Pulse_MEM10[t_count];
s_Pulse12[t_count]:=DevicePar[t_Count].Read.R_DoorLSW_Error AND NOT s_Pulse_MEM12[t_count];
s_pulse13[t_count]:=DevicePar[t_Count].Read.ShearLSW_CCW_RopeLS AND NOT s_Pulse_MEM13[t_count];
s_Pulse_MEM1[t_count]:=DevicePar[t_Count].Read.Fault;
s_Pulse_MEM2[t_count]:=DevicePar[t_Count].Read.Overload;
s_Pulse_MEM3[t_count]:=DevicePar[t_Count].Read.ShearLSW_CW_RopeDis;
s_Pulse_MEM4[t_count]:=DevicePar[t_Count].Read.Not_standby ;
s_Pulse_MEM10[t_count]:=devicepar[t_count].read.L_DoorLSW_Error;
s_Pulse_MEM6[t_count]:=DevicePar[t_Count].Read.CW_limited;
s_Pulse_MEM7[t_count]:=DevicePar[t_Count].Read.CCW_Limited;
s_Pulse_MEM8[t_count]:=DevicePar[t_Count].Read.Inhibit;
s_Pulse_MEM9[t_count]:=DevicePar[t_Count].Read.CommunicationError;
s_Pulse_MEM12[t_count]:=DevicePar[t_Count].Read.R_DoorLSW_Error;
s_pulse_MEM13[t_count]:=devicepar[t_Count].read.ShearLSW_CCW_RopeLS;
IF s_pulse1[t_count] OR s_pulse2[t_count] OR s_pulse3[t_count] OR s_Pulse4[t_count] OR s_Pulse10[t_count]
OR s_pulse6[t_count] OR s_pulse7[t_count] OR s_pulse8[t_count]
OR s_pulse9[t_count] OR s_pulse12[t_count] OR s_pulse13[t_count] THEN
s_warning:=true;
END_IF;

IF DevicePar[t_Count].Read.Fault OR DevicePar[t_Count].Read.Overload OR DevicePar[t_Count].Read.ShearLSW_CW_RopeDis OR DevicePar[t_Count].Read.ShearLSW_CCW_RopeLS
OR DevicePar[t_Count].Read.Inhibit OR DevicePar[t_Count].Read.Not_standby
OR DevicePar[t_Count].Read.CommunicationError OR devicepar[t_count].read.L_DoorLSW_Error OR devicepar[t_count].read.R_DoorLSW_Error THEN
alarmFlash:=true;
END_IF;
IF DevicePar[t_Count].Read.Running THEN
IF devicepar[t_count].Set.Devicetype=2 OR devicepar[t_count].Set.Devicetype=4 OR devicepar[t_count].Set.Devicetype=5 THEN
runningbeeping2:=true;
ELSE
runningbeeping1:=true;
END_IF;
END_IF;

END_FOR;
alarmbeeping:=s_WARNING;

END_FUNCTION_BLOCK
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-300/400

共有54616条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。