feat: Se crea gestor alarmas. Se actualiza FC50_MAIN.

This commit is contained in:
2026-07-21 18:56:04 +02:00
parent a2b85dae29
commit fff93784c8
22 changed files with 198 additions and 329 deletions
@@ -42,40 +42,6 @@ DATA_BLOCK DB2000_ED
"ED"[0].Tiempos_TiempoDes := 0;
{ S7_MLC := "MLC_3vw" }
ED[0] := ();
{ S7_MLC := "MLC_334" }
ED[1] := ();
{ S7_MLC := "MLC_3BG" }
ED[2] := ();
{ S7_MLC := "MLC_3s6" }
ED[3] := ();
{ S7_MLC := "MLC_3W8" }
ED[4] := ();
{ S7_MLC := "MLC_eA" }
ED[5] := ();
{ S7_MLC := "MLC_54t" }
ED[6] := ();
{ S7_MLC := "MLC_4Zq" }
ED[7] := ();
{ S7_MLC := "MLC_mj" }
ED[8] := ();
{ S7_MLC := "MLC_34w" }
ED[9] := ();
{ S7_MLC := "MLC_MZ" }
ED[10] := ();
{ S7_MLC := "MLC_3bd" }
ED[11] := ();
{ S7_MLC := "MLC_3kF" }
ED[12] := ();
{ S7_MLC := "MLC_4GK" }
ED[13] := ();
{ S7_MLC := "MLC_dV" }
ED[14] := ();
{ S7_MLC := "MLC_4qr" }
ED[15] := ();
{ S7_MLC := "MLC_4eS" }
ED[16] := ();
{ S7_MLC := "MLC_56B" }
ED[17] := ();
Agrup[0].AlgunaEnManual := FALSE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,37 +7,3 @@
es-ES: .
- id: MLC_3vw
es-ES: NO SE USA
- id: MLC_334
es-ES: DP-201
- id: MLC_3BG
es-ES: DP-202
- id: MLC_3s6
es-ES: DP-203
- id: MLC_3W8
es-ES: DP-204
- id: MLC_eA
es-ES: DP-205
- id: MLC_54t
es-ES: DP-206
- id: MLC_4Zq
es-ES: DP-207
- id: MLC_mj
es-ES: DP-208
- id: MLC_34w
es-ES: DP-209
- id: MLC_MZ
es-ES: DP-210
- id: MLC_3bd
es-ES: DP-211
- id: MLC_3kF
es-ES: DP-212
- id: MLC_4GK
es-ES: DP-213
- id: MLC_dV
es-ES: DP-214
- id: MLC_4qr
es-ES: DP-215
- id: MLC_4eS
es-ES: LL-201
- id: MLC_56B
es-ES: LL-202
@@ -55,36 +55,6 @@ DATA_BLOCK DB2001_EA
EA[0].Aux_Estado := 0;
{ S7_MLC := "MLC_3VM" }
EA[0] := ();
{ S7_MLC := "MLC_3T7" }
EA[1] := ();
{ S7_MLC := "MLC_4zB" }
EA[2] := ();
{ S7_MLC := "MLC_4ni" }
EA[3] := ();
{ S7_MLC := "MLC_jP" }
EA[4] := ();
{ S7_MLC := "MLC_3ah" }
EA[5] := ();
{ S7_MLC := "MLC_3qt" }
EA[6] := ();
{ S7_MLC := "MLC_4fH" }
EA[7] := ();
{ S7_MLC := "MLC_4Xs" }
EA[8] := ();
{ S7_MLC := "MLC_4hy" }
EA[9] := ();
{ S7_MLC := "MLC_4hs" }
EA[10] := ();
{ S7_MLC := "MLC_4WC" }
EA[11] := ();
{ S7_MLC := "MLC_3xK" }
EA[12] := ();
{ S7_MLC := "MLC_47u" }
EA[13] := ();
{ S7_MLC := "MLC_3S5" }
EA[14] := ();
{ S7_MLC := "MLC_3S7" }
EA[15] := ();
Agrup[0].AlgunaEnManual := FALSE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,33 +7,3 @@
es-ES: .
- id: MLC_3VM
es-ES: NO SE USA
- id: MLC_3T7
es-ES: LT-201
- id: MLC_4zB
es-ES: CT-201
- id: MLC_4ni
es-ES: FT-201
- id: MLC_jP
es-ES: TTI-201
- id: MLC_3ah
es-ES: TTI-202
- id: MLC_3qt
es-ES: TTI-203
- id: MLC_4fH
es-ES: TTI-204
- id: MLC_4Xs
es-ES: TTI-205
- id: MLC_4hy
es-ES: TTI-206
- id: MLC_4hs
es-ES: PTI-201
- id: MLC_4WC
es-ES: PTI-202
- id: MLC_3xK
es-ES: PTI-203
- id: MLC_47u
es-ES: PTI-204
- id: MLC_3S5
es-ES: PTI-205
- id: MLC_3S7
es-ES: PTI-206
@@ -44,8 +44,6 @@ DATA_BLOCK DB2005_SD
SD[0].Tiempos_TiempoDes := 0;
{ S7_MLC := "MLC_5C3" }
SD[0] := ();
{ S7_MLC := "MLC_4Xv" }
SD[1] := ();
Agrup[0].AlgunaEnManual := FALSE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,5 +7,3 @@
es-ES: .
- id: MLC_5C3
es-ES: NO SE USA
- id: MLC_4Xv
es-ES: Alimentacion videoregistrador
@@ -53,12 +53,6 @@ DATA_BLOCK DB2006_SA
SA[0].Aux_Estado := 0;
{ S7_MLC := "MLC_4Nk" }
SA[0] := ();
{ S7_MLC := "MLC_4VS" }
SA[1] := ();
{ S7_MLC := "MLC_Rp" }
SA[2] := ();
{ S7_MLC := "MLC_4DF" }
SA[3] := ();
Agrup[0].AlgunaEnManual := FALSE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,9 +7,3 @@
es-ES: .
- id: MLC_4Nk
es-ES: NO SE USA
- id: MLC_4VS
es-ES: VPCT-201
- id: MLC_Rp
es-ES: VPCT-202
- id: MLC_4DF
es-ES: VPCP-203
@@ -59,24 +59,6 @@ DATA_BLOCK DB2010_V
V[0].Tiempos_Ciclos := 0;
{ S7_MLC := "MLC_k3" }
V[0] := ();
{ S7_MLC := "MLC_4aA" }
V[1] := ();
{ S7_MLC := "MLC_3Rt" }
V[2] := ();
{ S7_MLC := "MLC_3p7" }
V[3] := ();
{ S7_MLC := "MLC_3xp" }
V[4] := ();
{ S7_MLC := "MLC_gX" }
V[5] := ();
{ S7_MLC := "MLC_qs" }
V[6] := ();
{ S7_MLC := "MLC_4VU" }
V[7] := ();
{ S7_MLC := "MLC_4SC" }
V[8] := ();
{ S7_MLC := "MLC_Wt" }
V[9] := ();
Agrup[0].AlgunaEnManual := FALSE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,21 +7,3 @@
es-ES: .
- id: MLC_k3
es-ES: NO SE USA
- id: MLC_4aA
es-ES: VA-401
- id: MLC_3Rt
es-ES: VA-402
- id: MLC_3p7
es-ES: VA3-403
- id: MLC_3xp
es-ES: VA4-404
- id: MLC_gX
es-ES: VA3-405
- id: MLC_qs
es-ES: VA-406
- id: MLC_4VU
es-ES: VD-401
- id: MLC_4SC
es-ES: VD-402
- id: MLC_Wt
es-ES: VCT-401
@@ -67,8 +67,6 @@ DATA_BLOCK DB2016_M_VF
M_VF[0].Tiempos_Mantenimiento := 0.0;
{ S7_MLC := "MLC_4u6" }
M_VF[0] := ();
{ S7_MLC := "MLC_3HZ" }
M_VF[1] := ();
Agrup[0].AlgunaEnManual := FALSE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,5 +7,3 @@
es-ES: .
- id: MLC_4u6
es-ES: NO SE USA
- id: MLC_3HZ
es-ES: B-401
@@ -47,10 +47,6 @@ DATA_BLOCK DB2025_TOT
TOT[0].Aux_TotalizadorMem := 0.0;
{ S7_MLC := "MLC_54a" }
TOT[0] := ();
{ S7_MLC := "MLC_4xm" }
TOT[1] := ();
{ S7_MLC := "MLC_3Fp" }
TOT[2] := ();
TiempoCiclo.Actual := 28.50767;
TiempoCiclo."Min" := 150.0;
TiempoCiclo."Max" := 0.0;
@@ -7,7 +7,3 @@
es-ES: .
- id: MLC_54a
es-ES: NO SE USA
- id: MLC_4xm
es-ES: FT-401
- id: MLC_3Fp
es-ES: FT-402
@@ -57,8 +57,6 @@ DATA_BLOCK DB2035_PID
"PID"[0].Aux_oldTd := 0.0;
{ S7_MLC := "MLC_5CL" }
PID[0] := ();
{ S7_MLC := "MLC_4WT" }
PID[1] := ();
Agrup[0].AlgunaEnManual := TRUE;
Agrup[0].AlgunaAlarma := FALSE;
Agrup[0].NuevaAlarma := FALSE;
@@ -7,5 +7,3 @@
es-ES: .
- id: MLC_5CL
es-ES: NO SE USA
- id: MLC_4WT
es-ES: Calentamiento
@@ -315,7 +315,16 @@ FUNCTION "FC50_MAIN" : Void
// ==========================================================================================================
REGION POST_PROGRAMA
// Alarmas generales
"FC5000_GEST_ALARMAS_GNR"();
// Parametros generales
"FC15_ZC_GEST_PREAL"(PrimerCiclo:="DB1_SYS".ARRANQUE,
FechaHora:="DB1_SYS".FechaHoraActual,
Usuario:="DB1_SYS".Usuario.Actual,
PReal:="DB3000_GNR_PREAL".PReal,
IndexTraza:=1,
ValorAnterior:="DB3000_GNR_PREAL".PReal);
END_REGION POST_PROGRAMA
@@ -324,5 +333,6 @@ FUNCTION "FC50_MAIN" : Void
END_NETWORK
END_FUNCTION
@@ -15,21 +15,4 @@ DATA_BLOCK DB2717_INST_M_SINA : FB2017_ZC_M_SINA
SeguridadesOK := TRUE;
HWIDSTW[0] := 0;
HWIDZSW[0] := 0;
SinaSpeed[0].EnableAxis := FALSE;
SinaSpeed[0].AckError := FALSE;
SinaSpeed[0].SpeedSp := 0.0;
SinaSpeed[0].RefSpeed := 0.0;
SinaSpeed[0].ConfigAxis := 16#003F;
SinaSpeed[0].HWIDSTW := 0;
SinaSpeed[0].HWIDZSW := 0;
SinaSpeed[0].AxisEnabled := FALSE;
SinaSpeed[0].Lockout := FALSE;
SinaSpeed[0].ActVelocity := 0.0;
SinaSpeed[0].Error := FALSE;
SinaSpeed[0].Status := 16#0000;
SinaSpeed[0].DiagId := 16#0000;
SinaSpeed[0].STW1 := 16#0000;
SinaSpeed[0].VelocitySP := 16#0000;
SinaSpeed[0].ZSW1 := 16#0000;
SinaSpeed[0].VelocityAV := 16#0000;
END_DATA_BLOCK
@@ -58,6 +58,7 @@ FUNCTION_BLOCK "FB2017_ZC_M_SINA"
HWIDSTW : Array[0.._.N_MAX_DISP_M_SINA] of HW_IO;
{ S7_MLC := "MLC_53F" }
HWIDZSW : Array[0.._.N_MAX_DISP_M_SINA] of HW_IO;
{ S7_Setpoint := "False" }
SinaSpeed : Array[0.._.N_MAX_DISP_M_SINA] of SinaSpeed;
END_VAR
VAR_TEMP
@@ -77,46 +78,6 @@ FUNCTION_BLOCK "FB2017_ZC_M_SINA"
{ S7_Language := "SCL" }
NETWORK
(*
ZEUS CONTROL, S.A.
(c)Copyright (2025) All Rights Reserved
--------------------------------------------------------------------------------------
Software: TIA Portal 18
Restricciones: PLC serie 1200/1500
Nombre: DISPOSITIVO SINAMICS
Descripcion: Modelo de dispositivo sinamics (comunicado)
Dependencias:
FC: FC8_ZC_TRAZA_REGISTRO
FB: -
DB: DB2017_DISP_M_SINA
DB2018_INST_M_SINA
DB1_SYS
UDT: ZC_DISP_M_SINA
ZC_DISP_MUX_M_SINA
Change log:
Version Fecha Tecnico a cargo Descripcion
01.00.00 27.04.2020 (ABH) Primera version.
01.00.01 26.05.2020 (ABH) Se añade logica como dispositivo motor VF.
01.00.02 22.09.2022 (HCR) Cambio lógica SinaSpeed
Se añade trazabilidad manualizaciones
Se añade trazabilidad de activación manual
01.00.03 08.11.2022 (HCR) Cambio lógica enclavamiento
01.00.04 18.09.2023 (ABH) Cambio en tipo de dato de horas de alarma. Se utiliza el tipo de dato ZC_CONTADOR_TIEMPO y el FC15025_ZC_CONTADOR_TIEMPO
01.00.05 28.02.2024 (ABH) Se añade gestion multiplexado para Scada (no indexado)
01.00.06 26.03.2025 (ABH) Se añade variable grupo de alarma para separar los nuevos avisos por cuadro.
01.00.07 07.10.2025 (ABH) Se modifica la logica del multiplexado, la asignacion de oldindex se cambia de sitio ya que de vez en cuando (dependiendo de cuando el HMI
realiza la comunicacion asincrona con el PLC) no detectaba el cambio y se machacaban valores.
02.00.00 17.12.2025 (ABH) Se eliminan los idiomas. Se utiliza codigos para trazabilidad. Se elimina entrada "Idioma". Se elimina nombre de UDT. Se añade indexHMI para lista de
texto en sistemas de supervision.
//=====================================================================================
*)
REGION DESCRIPCION
(*
###### (C)Copyright ZeusControl 2020 - 2026
@@ -175,6 +136,8 @@ FUNCTION_BLOCK "FB2017_ZC_M_SINA"
END_REGION DESCRIPCION
REGION LOGICA_DEL_DISPOSITIVO
// =============================================================================
@@ -52,15 +52,25 @@ FUNCTION_BLOCK "FB15170_ZC_CIP_FASES"
ChequeoRutaActual : _.UDT_ZC_CIP_CHEQUEO_RUTA;
END_VAR
VAR
{ S7_Setpoint := "False" }
LimpiezaSosa : _.FB15160_ZC_CIP_SOSA_LIMP;
{ S7_Setpoint := "False" }
EnjuagueSosa : _.FB15161_ZC_CIP_SOSA_ENJ;
{ S7_Setpoint := "False" }
LimpiezaAcido : _.FB15162_ZC_CIP_ACIDO_LIMP;
{ S7_Setpoint := "False" }
EnjuagueAcido : _.FB15163_ZC_CIP_ACIDO_ENJ;
{ S7_Setpoint := "False" }
SoloEnjuague : _.FB15164_ZC_CIP_SOLO_ENJ;
{ S7_Setpoint := "False" }
LimpiezaDesinfectante : _.FB15165_ZC_CIP_DESINF_LIMP;
{ S7_Setpoint := "False" }
EnjuagueDesinfectante : _.FB15166_ZC_CIP_DESINF_ENJ;
{ S7_Setpoint := "False" }
Esterilizacion : _.FB15167_ZC_CIP_ESTERIL;
{ S7_Setpoint := "False" }
AguaRecuperada : _.FB15168_ZC_CIP_AGUA_RECUP;
{ S7_Setpoint := "False" }
Rechazos : _.FB15169_ZC_CIP_RECUP_RECHAZO;
END_VAR
@@ -10,28 +10,36 @@
}
FUNCTION "FC17_ZC_GEST_ALM" : Void
VAR_INPUT
{ S7_MLC := "MLC_3JE" }
PrimerCiclo : Bool;
{ S7_MLC := "MLC_497" }
FechaHora : DTL;
{ S7_MLC := "MLC_V8" }
Usuario : String;
{ S7_MLC := "MLC_4YZ" }
PInt : Array[*] of _.UDT_ZC_PINT;
{ S7_MLC := "MLC_3RP" }
IndexTraza : Int;
{ S7_MLC := "MLC_3FJ" }
Pulso1Seg : Bool;
{ S7_MLC := "MLC_3Ra" }
Ack : Bool;
{ S7_MLC := "MLC_3bC" }
AutoAck : Bool;
END_VAR
VAR_IN_OUT
{ S7_MLC := "MLC_4tY" }
ValorAnterior : Array[*] of Int;
ALM : Array[*] of _.UDT_ZC_ALARMA;
{ S7_MLC := "MLC_4ej" }
AlarmasHMI : Array[*] of Word;
{ S7_MLC := "MLC_42S" }
NuevaAlarma : Bool;
{ S7_MLC := "MLC_36G" }
AlgunaAlarma : Bool;
END_VAR
VAR_TEMP
{ S7_MLC := "MLC_3pd" }
for_i : DInt;
{ S7_MLC := "MLC_4S8" }
t_IndiceSuperior : DInt;
t_IndiceSuperiorAlarmas : DInt;
{ S7_MLC := "MLC_53S" }
t_IndiceInferior : DInt;
t_IndiceInferiorAlarmas : DInt;
{ S7_MLC := "MLC_3NY" }
t_IndiceSuperiorHmi : DInt;
{ S7_MLC := "MLC_52h" }
t_IndiceInferiorHmi : DInt;
t_IndiceAlarma : Int;
t_ValorAlarma : Bool;
END_VAR
{ S7_Language := "SCL" }
@@ -52,31 +60,30 @@ FUNCTION "FC17_ZC_GEST_ALM" : Void
---
### Descripción Funcional
Función principal para la gestión de trazabilidad de los parámetros **enteros** del proceso.
Función principal para la gestión de alarmas.
Su objetivo principal es detectar cambios de valor en el array de parámetros y lanzar un registro de traza cuando esto sucede.
Su objetivo principal es gestionar y temporizar la activacion de las alarmas.
El bloque opera de la siguiente manera:
1. Calcula dinámicamente los límites superior e inferior del array de entrada.
2. Si es el primer ciclo de ejecución de la CPU, inicializa los valores "anteriores" con los valores "actuales" para evitar falsos registros de traza iniciales.
3. En ciclos normales, compara el valor actual de cada parámetro con su valor guardado en el ciclo anterior.
4. Si detecta una diferencia, llama a la función `FC8_ZC_TRAZA_REGISTRO` para registrar el cambio y actualiza el valor anterior.
2. Comprueba la logica de activacion de las alarmas.
3. Gestiona la conversion de alarmas para HMI.
---
### Dependencias Requeridas
| Tipo | Elementos |
|------|-----------|
| FC | `FC8_ZC_TRAZA_REGISTRO` |
| FC | - |
| FB | - |
| DB | - |
| UDT | `UDT_ZC_PINT` |
| UDT | `UDT_ZC_ALARMA` |
---
### Historial de Cambios
| Versión | Fecha | Técnico | Cambios |
|----------|------------|---------|---------|
| 01.00.00 | 2026-03-20 | (ABH) | Primera version. |
| 01.00.00 | 21.07.2026 | (ABH) | Primera version. |
*)
END_REGION DESCRIPCION
@@ -84,64 +91,150 @@ FUNCTION "FC17_ZC_GEST_ALM" : Void
// ==========================================================================================================
REGION CALCULO_LIMITES_ARRAY
// Calculo de los limites del array, ya que la entrada del array de parametros es variable.
#t_IndiceInferior := LOWER_BOUND(ARR := #PInt, DIM := 1);
#t_IndiceSuperior := UPPER_BOUND(ARR := #PInt, DIM := 1);
// Calculo de los limites del array
#t_IndiceInferiorAlarmas := LOWER_BOUND(ARR := #ALM, DIM := 1);
#t_IndiceSuperiorAlarmas := UPPER_BOUND(ARR := #ALM, DIM := 1);
#t_IndiceInferiorHmi := LOWER_BOUND(ARR := #AlarmasHMI, DIM := 1);
#t_IndiceSuperiorHmi := UPPER_BOUND(ARR := #AlarmasHMI, DIM := 1);
END_REGION CALCULO_LIMITES_ARRAY
// ==========================================================================================================
REGION PRIMER_ARRANQUE
REGION GESTION_ALARMAS
// En el primer arranque de la CPU, recorremos el array completo y almacenamos los valores actuales como valores anteriores en el arranque de la CPU.
// Esto se realiza ya que los valores anteriores no son remanentes, para optimizar la memoria del PLC.
IF #PrimerCiclo THEN
FOR #for_i := #t_IndiceInferior TO #t_IndiceSuperior DO
#ValorAnterior[#for_i] := #PInt[#for_i].Valor;
END_FOR;
// Salimos inmediatamente de la funcion, para realizar la gestion de los parametros con la CPU arrancada
RETURN;
END_IF;
// Reinicializacion de variables
#AlgunaAlarma := FALSE;
END_REGION PRIMER_ARRANQUE
// ==========================================================================================================
REGION GESTION_PARAMETROS
// Gestion de los cambios de valor de los parametros. Si detecta un cambio, lanza la traza
// y actualiza el valor anterior.
FOR #for_i := #t_IndiceInferior TO #t_IndiceSuperior DO
// Gestion de activacion alarmas
FOR #for_i := #t_IndiceInferiorAlarmas TO #t_IndiceSuperiorAlarmas DO
// En caso de detectar cambio de valor
IF #PInt[#for_i].Valor <> #ValorAnterior[#for_i] THEN
#t_ValorAlarma := FALSE;
// Invertir valor en caso de habilitado
IF #ALM[#for_i].HabilitarInvertir THEN
#t_ValorAlarma := NOT #ALM[#for_i].In;
ELSE
#t_ValorAlarma := #ALM[#for_i].In;
END_IF;
// Reinicializacion de la salida
IF #AutoAck THEN
// Lanzamos la trazabilidad
"FC8_ZC_TRZ_REGISTRO"(FechaHora := #FechaHora,
Registrar := 1,
Categoria := "TRZ_CAT_26_PINT",
User := #Usuario,
CodInt_1 := #IndexTraza + DINT_TO_INT(#for_i - 1),
CodInt_2 := "TRZ_SYS_PAR_VAL_ANT",
CodInt_3 := "TRZ_SYS_PAR_VAL_NUE",
CodInt_4 := 0,
CodInt_5 := 0,
CodReal_1 := #ValorAnterior[#for_i],
CodReal_2 := #PInt[#for_i].Valor);
#ALM[#for_i].Out := FALSE;
// Actualizamos el valor anterior
#ValorAnterior[#for_i] := #PInt[#for_i].Valor;
ELSE
IF (#ALM[#for_i].Out AND #Ack)
OR
#AutoAck
THEN
#ALM[#for_i].Out := FALSE;
END_IF;
END_IF;
#ALM[#for_i].OutInstantanea := FALSE;
// Retardo de la activacion de la alarma
IF #t_ValorAlarma AND #ALM[#for_i].Habilitar THEN
IF #ALM[#for_i].TiempoRetardo <> 0 THEN
IF #ALM[#for_i].auxTiempoAlarma >= #ALM[#for_i].TiempoRetardo THEN
#ALM[#for_i].OutInstantanea := TRUE;
ELSE
IF #Pulso1Seg THEN
#ALM[#for_i].auxTiempoAlarma += 1;
END_IF;
END_IF;
ELSE
#ALM[#for_i].OutInstantanea := TRUE;
END_IF;
ELSE
#ALM[#for_i].auxTiempoAlarma := 0;
END_IF;
IF #ALM[#for_i].OutInstantanea THEN
#ALM[#for_i].Out := TRUE;
END_IF;
// Aalguna alarma
IF #ALM[#for_i].Out THEN
#AlgunaAlarma := TRUE;
END_IF;
// Deteccion de nueva alarma
IF #ALM[#for_i].Out AND NOT #ALM[#for_i].oldAlarma AND #ALM[#for_i].HabilitarSonora THEN
#NuevaAlarma := TRUE;
END_IF;
// Estado anterior de las alarmas
#ALM[#for_i].oldAlarma := #ALM[#for_i].Out;
END_FOR;
END_REGION GESTION_PARAMETROS
END_REGION GESTION_ALARMAS
// ==========================================================================================================
REGION GESTION_ALARMAS_HMI
// Copia de valores de las alarmas a WORD para Scada/HMI
#t_IndiceAlarma := 1;
FOR #for_i := #t_IndiceInferiorHmi TO #t_IndiceSuperiorHmi DO
#AlarmasHMI[#for_i].%X0 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X1 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X2 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X3 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X4 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X5 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X6 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X7 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X8 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X9 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X10 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X11 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X12 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X13 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X14 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
#AlarmasHMI[#for_i].%X15 := #ALM[#t_IndiceAlarma].Out;
#t_IndiceAlarma += 1;
END_FOR;
END_REGION GESTION_ALARMAS_HMI
// ==========================================================================================================
REGION ACUSE_NUEVA_ALARMA
// Acuse de nuevas alarmas
IF #Ack THEN
#NuevaAlarma := FALSE;
END_IF;
END_REGION ACUSE_NUEVA_ALARMA
END_NETWORK
END_FUNCTION
@@ -1,21 +1,27 @@
MultiLingualTexts:
- id: MLC_yr
es-ES: FC17_ZC_GEST_ALM
- id: MLC_3JE
es-ES: Marca de primer ciclo de arranque de la CPU
- id: MLC_497
es-ES: Fecha y hora actual
- id: MLC_V8
es-ES: Usuario actual
- id: MLC_4YZ
es-ES: Array de parametro entero
- id: MLC_3RP
es-ES: Indice de texto parametro para trazabilidad
- id: MLC_3FJ
es-ES: Pulso de 1 segundo
- id: MLC_3Ra
es-ES: Acuse general
- id: MLC_3bC
es-ES: Auto acuse de las alarmas
- id: MLC_4tY
es-ES: Array de valores anteriores
es-ES: Array de alarmas
- id: MLC_4ej
es-ES: Array de alarmas para HMI
- id: MLC_42S
es-ES: Nueva alarma
- id: MLC_36G
es-ES: Alguna alarma activa
- id: MLC_3pd
es-ES: Variable para bucles FOR
- id: MLC_4S8
es-ES: Indice superior del array
es-ES: Indice superior del array de alarmas
- id: MLC_53S
es-ES: Indice inferior del array
es-ES: Indice inferior del array de alarmas
- id: MLC_3NY
es-ES: Indice superior del array de alarmas HMI
- id: MLC_52h
es-ES: Indice inferior del array de alarmas HMI