6BSPJ motion
Detaljer
- Typ
- Program
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 2
- Uppdaterad
- 2013-09-03
- Skapad
- 2013-08-28
- Kategori
- Allmän automation
- Visningar
- 3458
Beskrivning
Motionering
Bruksanvisning
Saknas
Juridisk information
Alla skript tillhandahålls i befintligt skick och all användning sker på eget ansvar. Felaktig använding kan leda till skadad eller förstörd utrustning.
Skript kod
ROUTINE fire_ex
ALIAS
DI_ind_open_1 = CHANNEL[59]; %TA1-ST1 öppen
DI_ind_open_2 = CHANNEL[63]; %CF1-ST1 öppen
DI_ind_open_3 = CHANNEL[65]; %CF1-ST2 öppen
DI_ind_open_4 = CHANNEL[48]; %CF2-ST1 öppen
DI_ind_open_5 = CHANNEL[50]; %CF2-ST2 öppen
DI_ind_open_6 = CHANNEL[52]; %CF2-ST3 öppen
DI_ind_closed_1 = CHANNEL[60]; %TA1-ST1 Stängd
DI_ind_closed_2 = CHANNEL[64]; %CF1-ST1 Stängd
DI_ind_closed_3 = CHANNEL[66]; %CF1-ST2 Stängd
DI_ind_closed_4 = CHANNEL[49]; %CF2-ST1 Stängd
DI_ind_closed_5 = CHANNEL[51]; %CF2-ST2 Stängd
DI_ind_closed_6 = CHANNEL[53]; %CF2-ST3 Stängd
DO_open = CHANNEL[68]; %Brandspjäll
FIRE_alarm = ALARM[18]; %Rökdetektor
ALARM = CHANNEL[98]; %Larmkanal BSP
ALARM_1 = CHANNEL[92]; %TA1-ST1 i Felläge
ALARM_2 = CHANNEL[93]; %CF1-ST1 i Felläge
ALARM_3 = CHANNEL[94]; %CF1-ST2 i Felläge
ALARM_4 = CHANNEL[95]; %CF2-ST1 i Felläge
ALARM_5 = CHANNEL[96]; %CF2-ST2 i Felläge
ALARM_6 = CHANNEL[97]; %CF2-ST3 i Felläge
RUN_cal = CALENDAR[1]; %BSP-Motion
RUN_time = PARAMETER[36]; %Brandspjälltid
STATE = CHANNEL[99]; %Status Brandspjäll
CNT = CHANNEL[100]; %Räknare Brandspjäll
VAR
Last_RUN_cal;
DI_ind_open; DI_ind_closed;
BEGIN
DI_ind_open := DI_ind_open_1 AND DI_ind_open_2 AND DI_ind_open_3 AND DI_ind_open_4 AND DI_ind_open_5 AND DI_ind_open_6;
DI_ind_closed := DI_ind_closed_1 AND DI_ind_closed_2 AND DI_ind_closed_3 AND DI_ind_closed_4 AND DI_ind_closed_5 AND DI_ind_closed_6;
IF FIRE_alarm = 1 THEN
DO_open <- 0;
STATE <- 0;
ELSIF (DI_ind_closed = 1) AND (DI_ind_open = 1) THEN
ALARM <- 1;
STATE <- 0;
ELSE
IF RUN_cal = 1 THEN
IF (RUN_cal = 1) AND (Last_RUN_cal = 0) THEN
STATE <- 1;
DO_open <- 0;
CNT <- RUN_time;
ENDIF;
IF (STATE = 1) THEN
IF DI_ind_closed = 1 THEN
STATE <- 2;
DO_open <- 1;
CNT <- RUN_time;
ENDIF;
ELSIF (STATE = 2) THEN
IF DI_ind_open = 1 THEN
STATE <- 3;
CNT <- RUN_time;
ENDIF;
ELSIF (STATE = 3) THEN
CNT <- RUN_time;
ENDIF;
CNT <- CNT - 1;
IF (CNT < 0) THEN
ALARM <- 1;
IF STATE = 1 THEN
ALARM_1 <- (DI_ind_closed_1 = 0);
ALARM_2 <- (DI_ind_closed_2 = 0);
ALARM_3 <- (DI_ind_closed_3 = 0);
ALARM_4 <- (DI_ind_closed_4 = 0);
ALARM_5 <- (DI_ind_closed_5 = 0);
ALARM_6 <- (DI_ind_closed_6 = 0);
ELSIF STATE = 2 THEN
ALARM_1 <- (DI_ind_open_1 = 0);
ALARM_2 <- (DI_ind_open_2 = 0);
ALARM_3 <- (DI_ind_open_3 = 0);
ALARM_4 <- (DI_ind_open_4 = 0);
ALARM_5 <- (DI_ind_open_5 = 0);
ALARM_6 <- (DI_ind_open_6 = 0);
ENDIF;
ENDIF;
ELSE
DO_open <- 1;
STATE <- 0;
CNT <- 0;
IF (DI_ind_open = 0) OR (DI_ind_closed = 1) THEN
ALARM <- 1;
IF (DI_ind_open_1 = 0) OR (DI_ind_closed_1 = 1) THEN
ALARM_1 <- 1;
ELSE
ALARM_1 <- 0;
ENDIF;
IF (DI_ind_open_2 = 0) OR (DI_ind_closed_2 = 1) THEN
ALARM_2 <- 1;
ELSE
ALARM_2 <- 0;
ENDIF;
IF (DI_ind_open_3 = 0) OR (DI_ind_closed_3 = 1) THEN
ALARM_3 <- 1;
ELSE
ALARM_3 <- 0;
ENDIF;
IF (DI_ind_open_4 = 0) OR (DI_ind_closed_4 = 1) THEN
ALARM_4 <- 1;
ELSE
ALARM_4 <- 0;
ENDIF;
IF (DI_ind_open_5 = 0) OR (DI_ind_closed_5 = 1) THEN
ALARM_5 <- 1;
ELSE
ALARM_5 <- 0;
ENDIF;
IF (DI_ind_open_6 = 0) OR (DI_ind_closed_6 = 1) THEN
ALARM_6 <- 1;
ELSE
ALARM_6 <- 0;
ENDIF;
ELSE
ALARM <- 0;
ALARM_1 <- 0;
ALARM_2 <- 0;
ALARM_3 <- 0;
ALARM_4 <- 0;
ALARM_5 <- 0;
ALARM_6 <- 0;
ENDIF;
ENDIF;
ENDIF;
Last_RUN_cal := RUN_cal;
END;
ALIAS
DI_ind_open_1 = CHANNEL[59]; %TA1-ST1 öppen
DI_ind_open_2 = CHANNEL[63]; %CF1-ST1 öppen
DI_ind_open_3 = CHANNEL[65]; %CF1-ST2 öppen
DI_ind_open_4 = CHANNEL[48]; %CF2-ST1 öppen
DI_ind_open_5 = CHANNEL[50]; %CF2-ST2 öppen
DI_ind_open_6 = CHANNEL[52]; %CF2-ST3 öppen
DI_ind_closed_1 = CHANNEL[60]; %TA1-ST1 Stängd
DI_ind_closed_2 = CHANNEL[64]; %CF1-ST1 Stängd
DI_ind_closed_3 = CHANNEL[66]; %CF1-ST2 Stängd
DI_ind_closed_4 = CHANNEL[49]; %CF2-ST1 Stängd
DI_ind_closed_5 = CHANNEL[51]; %CF2-ST2 Stängd
DI_ind_closed_6 = CHANNEL[53]; %CF2-ST3 Stängd
DO_open = CHANNEL[68]; %Brandspjäll
FIRE_alarm = ALARM[18]; %Rökdetektor
ALARM = CHANNEL[98]; %Larmkanal BSP
ALARM_1 = CHANNEL[92]; %TA1-ST1 i Felläge
ALARM_2 = CHANNEL[93]; %CF1-ST1 i Felläge
ALARM_3 = CHANNEL[94]; %CF1-ST2 i Felläge
ALARM_4 = CHANNEL[95]; %CF2-ST1 i Felläge
ALARM_5 = CHANNEL[96]; %CF2-ST2 i Felläge
ALARM_6 = CHANNEL[97]; %CF2-ST3 i Felläge
RUN_cal = CALENDAR[1]; %BSP-Motion
RUN_time = PARAMETER[36]; %Brandspjälltid
STATE = CHANNEL[99]; %Status Brandspjäll
CNT = CHANNEL[100]; %Räknare Brandspjäll
VAR
Last_RUN_cal;
DI_ind_open; DI_ind_closed;
BEGIN
DI_ind_open := DI_ind_open_1 AND DI_ind_open_2 AND DI_ind_open_3 AND DI_ind_open_4 AND DI_ind_open_5 AND DI_ind_open_6;
DI_ind_closed := DI_ind_closed_1 AND DI_ind_closed_2 AND DI_ind_closed_3 AND DI_ind_closed_4 AND DI_ind_closed_5 AND DI_ind_closed_6;
IF FIRE_alarm = 1 THEN
DO_open <- 0;
STATE <- 0;
ELSIF (DI_ind_closed = 1) AND (DI_ind_open = 1) THEN
ALARM <- 1;
STATE <- 0;
ELSE
IF RUN_cal = 1 THEN
IF (RUN_cal = 1) AND (Last_RUN_cal = 0) THEN
STATE <- 1;
DO_open <- 0;
CNT <- RUN_time;
ENDIF;
IF (STATE = 1) THEN
IF DI_ind_closed = 1 THEN
STATE <- 2;
DO_open <- 1;
CNT <- RUN_time;
ENDIF;
ELSIF (STATE = 2) THEN
IF DI_ind_open = 1 THEN
STATE <- 3;
CNT <- RUN_time;
ENDIF;
ELSIF (STATE = 3) THEN
CNT <- RUN_time;
ENDIF;
CNT <- CNT - 1;
IF (CNT < 0) THEN
ALARM <- 1;
IF STATE = 1 THEN
ALARM_1 <- (DI_ind_closed_1 = 0);
ALARM_2 <- (DI_ind_closed_2 = 0);
ALARM_3 <- (DI_ind_closed_3 = 0);
ALARM_4 <- (DI_ind_closed_4 = 0);
ALARM_5 <- (DI_ind_closed_5 = 0);
ALARM_6 <- (DI_ind_closed_6 = 0);
ELSIF STATE = 2 THEN
ALARM_1 <- (DI_ind_open_1 = 0);
ALARM_2 <- (DI_ind_open_2 = 0);
ALARM_3 <- (DI_ind_open_3 = 0);
ALARM_4 <- (DI_ind_open_4 = 0);
ALARM_5 <- (DI_ind_open_5 = 0);
ALARM_6 <- (DI_ind_open_6 = 0);
ENDIF;
ENDIF;
ELSE
DO_open <- 1;
STATE <- 0;
CNT <- 0;
IF (DI_ind_open = 0) OR (DI_ind_closed = 1) THEN
ALARM <- 1;
IF (DI_ind_open_1 = 0) OR (DI_ind_closed_1 = 1) THEN
ALARM_1 <- 1;
ELSE
ALARM_1 <- 0;
ENDIF;
IF (DI_ind_open_2 = 0) OR (DI_ind_closed_2 = 1) THEN
ALARM_2 <- 1;
ELSE
ALARM_2 <- 0;
ENDIF;
IF (DI_ind_open_3 = 0) OR (DI_ind_closed_3 = 1) THEN
ALARM_3 <- 1;
ELSE
ALARM_3 <- 0;
ENDIF;
IF (DI_ind_open_4 = 0) OR (DI_ind_closed_4 = 1) THEN
ALARM_4 <- 1;
ELSE
ALARM_4 <- 0;
ENDIF;
IF (DI_ind_open_5 = 0) OR (DI_ind_closed_5 = 1) THEN
ALARM_5 <- 1;
ELSE
ALARM_5 <- 0;
ENDIF;
IF (DI_ind_open_6 = 0) OR (DI_ind_closed_6 = 1) THEN
ALARM_6 <- 1;
ELSE
ALARM_6 <- 0;
ENDIF;
ELSE
ALARM <- 0;
ALARM_1 <- 0;
ALARM_2 <- 0;
ALARM_3 <- 0;
ALARM_4 <- 0;
ALARM_5 <- 0;
ALARM_6 <- 0;
ENDIF;
ENDIF;
ENDIF;
Last_RUN_cal := RUN_cal;
END;
Användarnas noteringar
Du måste vara inloggad för att göra en notering. Bli medlem eller logga in. Vi använder en moderator som godkänner noteringarna innan de visas.