diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7dcl index 2e4d103..c404dcb 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7dcl @@ -23,6 +23,7 @@ DATA_BLOCK DB2000_ED NumDispositivos : Int; END_VAR + "ED"[0].Hmi_Estado := 0; "ED"[0].Estado_AutoMan := FALSE; "ED"[0].Estado_Activado := FALSE; "ED"[0].Estado_EntradaCanal := FALSE; @@ -33,6 +34,7 @@ DATA_BLOCK DB2000_ED "ED"[0].Config_HabilitarInvertir := FALSE; "ED"[0].Aux_oldActivado := FALSE; "ED"[0].Aux_oldAutoMan := FALSE; + "ED"[0].Config_TipoAcceso := 0; "ED"[0].Config_GrupoAlarma := 0; "ED"[0].Config_DirEntradaByte := 0; "ED"[0].Config_DirEntradaBit := 0; @@ -42,8 +44,114 @@ DATA_BLOCK DB2000_ED "ED"[0].Tiempos_TiempoDes := 0; { S7_MLC := "MLC_3vw" } ED[0] := (); + "ED"[1].Hmi_Estado := 9; + "ED"[1].Estado_AutoMan := FALSE; + "ED"[1].Estado_Activado := TRUE; + "ED"[1].Estado_EntradaCanal := TRUE; + "ED"[1].Orden_ActivarManual := TRUE; + "ED"[1].Config_Habilitar := TRUE; + "ED"[1].Config_HabilitarRetardoAct := FALSE; + "ED"[1].Config_HabilitarRetardoDes := FALSE; + "ED"[1].Config_HabilitarInvertir := FALSE; + "ED"[1].Aux_oldActivado := TRUE; + "ED"[1].Aux_oldAutoMan := FALSE; + "ED"[1].Config_TipoAcceso := 0; + "ED"[1].Config_GrupoAlarma := 0; + "ED"[1].Config_DirEntradaByte := 202; + "ED"[1].Config_DirEntradaBit := 0; + "ED"[1].Tiempos_SPTiempoAct := 3; + "ED"[1].Tiempos_SPTiempoDes := 3; + "ED"[1].Tiempos_TiempoAct := 0; + "ED"[1].Tiempos_TiempoDes := 0; + { S7_MLC := "MLC_334" } + ED[1] := (); + "ED"[2].Hmi_Estado := 1; + "ED"[2].Estado_AutoMan := FALSE; + "ED"[2].Estado_Activado := FALSE; + "ED"[2].Estado_EntradaCanal := FALSE; + "ED"[2].Orden_ActivarManual := FALSE; + "ED"[2].Config_Habilitar := TRUE; + "ED"[2].Config_HabilitarRetardoAct := FALSE; + "ED"[2].Config_HabilitarRetardoDes := FALSE; + "ED"[2].Config_HabilitarInvertir := FALSE; + "ED"[2].Aux_oldActivado := FALSE; + "ED"[2].Aux_oldAutoMan := FALSE; + "ED"[2].Config_TipoAcceso := 0; + "ED"[2].Config_GrupoAlarma := 0; + "ED"[2].Config_DirEntradaByte := 202; + "ED"[2].Config_DirEntradaBit := 1; + "ED"[2].Tiempos_SPTiempoAct := 3; + "ED"[2].Tiempos_SPTiempoDes := 3; + "ED"[2].Tiempos_TiempoAct := 0; + "ED"[2].Tiempos_TiempoDes := 0; + { S7_MLC := "MLC_3BG" } + ED[2] := (); + "ED"[3].Hmi_Estado := 1; + "ED"[3].Estado_AutoMan := FALSE; + "ED"[3].Estado_Activado := FALSE; + "ED"[3].Estado_EntradaCanal := FALSE; + "ED"[3].Orden_ActivarManual := FALSE; + "ED"[3].Config_Habilitar := TRUE; + "ED"[3].Config_HabilitarRetardoAct := FALSE; + "ED"[3].Config_HabilitarRetardoDes := FALSE; + "ED"[3].Config_HabilitarInvertir := FALSE; + "ED"[3].Aux_oldActivado := FALSE; + "ED"[3].Aux_oldAutoMan := FALSE; + "ED"[3].Config_TipoAcceso := 0; + "ED"[3].Config_GrupoAlarma := 0; + "ED"[3].Config_DirEntradaByte := 202; + "ED"[3].Config_DirEntradaBit := 2; + "ED"[3].Tiempos_SPTiempoAct := 3; + "ED"[3].Tiempos_SPTiempoDes := 3; + "ED"[3].Tiempos_TiempoAct := 0; + "ED"[3].Tiempos_TiempoDes := 0; + { S7_MLC := "MLC_3s6" } + ED[3] := (); + "ED"[4].Hmi_Estado := 1; + "ED"[4].Estado_AutoMan := FALSE; + "ED"[4].Estado_Activado := FALSE; + "ED"[4].Estado_EntradaCanal := FALSE; + "ED"[4].Orden_ActivarManual := FALSE; + "ED"[4].Config_Habilitar := TRUE; + "ED"[4].Config_HabilitarRetardoAct := FALSE; + "ED"[4].Config_HabilitarRetardoDes := FALSE; + "ED"[4].Config_HabilitarInvertir := FALSE; + "ED"[4].Aux_oldActivado := FALSE; + "ED"[4].Aux_oldAutoMan := FALSE; + "ED"[4].Config_TipoAcceso := 0; + "ED"[4].Config_GrupoAlarma := 0; + "ED"[4].Config_DirEntradaByte := 202; + "ED"[4].Config_DirEntradaBit := 3; + "ED"[4].Tiempos_SPTiempoAct := 3; + "ED"[4].Tiempos_SPTiempoDes := 3; + "ED"[4].Tiempos_TiempoAct := 0; + "ED"[4].Tiempos_TiempoDes := 0; + { S7_MLC := "MLC_3W8" } + ED[4] := (); + "ED"[5].Hmi_Estado := 1; + "ED"[5].Estado_AutoMan := FALSE; + "ED"[5].Estado_Activado := FALSE; + "ED"[5].Estado_EntradaCanal := FALSE; + "ED"[5].Orden_ActivarManual := FALSE; + "ED"[5].Config_Habilitar := TRUE; + "ED"[5].Config_HabilitarRetardoAct := FALSE; + "ED"[5].Config_HabilitarRetardoDes := FALSE; + "ED"[5].Config_HabilitarInvertir := FALSE; + "ED"[5].Aux_oldActivado := FALSE; + "ED"[5].Aux_oldAutoMan := FALSE; + "ED"[5].Config_TipoAcceso := 0; + "ED"[5].Config_GrupoAlarma := 0; + "ED"[5].Config_DirEntradaByte := 202; + "ED"[5].Config_DirEntradaBit := 4; + "ED"[5].Tiempos_SPTiempoAct := 3; + "ED"[5].Tiempos_SPTiempoDes := 3; + "ED"[5].Tiempos_TiempoAct := 0; + "ED"[5].Tiempos_TiempoDes := 0; + { S7_MLC := "MLC_eA" } + ED[5] := (); Agrup[0].AlgunaEnManual := FALSE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 24; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7res b/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7res index 4aaaa01..b909e85 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7res +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2000_ED.s7res @@ -7,3 +7,13 @@ 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 diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7dcl index 65a0cb0..ea742b3 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7dcl @@ -23,6 +23,7 @@ DATA_BLOCK DB2001_EA NumDispositivos : Int; END_VAR + EA[0].Hmi_Estado := 0; EA[0].Estado_ValorIngenieria := 0.0; EA[0].Estado_AutoMan := FALSE; EA[0].Alarmas_Min := FALSE; @@ -55,8 +56,174 @@ DATA_BLOCK DB2001_EA EA[0].Aux_Estado := 0; { S7_MLC := "MLC_3VM" } EA[0] := (); + EA[1].Hmi_Estado := 1; + EA[1].Estado_ValorIngenieria := 276.4214; + EA[1].Estado_AutoMan := FALSE; + EA[1].Alarmas_Min := FALSE; + EA[1].Alarmas_Max := FALSE; + EA[1].Alarmas_HiloRoto := FALSE; + EA[1].Alarmas_Lectura := FALSE; + EA[1].Alarmas_Parametros := FALSE; + EA[1].Alarmas_General := FALSE; + EA[1].Config_Habilitar := TRUE; + EA[1].Config_HabilitarAlarmaMin := FALSE; + EA[1].Config_HabilitarAlarmaMax := FALSE; + EA[1].Config_HisteresisTipo := FALSE; + EA[1].Aux_oldAlarma := FALSE; + EA[1].Aux_oldAutoMan := FALSE; + EA[1].Config_TipoAcceso := 0; + EA[1].Config_GrupoAlarma := 0; + EA[1].Estado_ValorTarjeta := 6114; + EA[1].Estado_Lectura := 16#0000; + EA[1].Orden_ConsignaManual := 276.4214; + EA[1].Config_DireccionEntradaByte := 2000; + EA[1].Config_EscaladoMinTarjeta := 0; + EA[1].Config_EscaladoMaxTarjeta := 27648; + EA[1].Config_EscaladoMinIngenieria := 0.0; + EA[1].Config_EscaladoMaxIngenieria := 1250.0; + EA[1].Config_EscaladoOffset := 0.0; + EA[1].Config_ErrorMinIngenieria := 0.0; + EA[1].Config_ErrorMaxIngenieria := 100.0; + EA[1].Config_ErrorMinHisteresis := 0.0; + EA[1].Config_ErrorMaxHisteresis := 0.0; + EA[1].Aux_Estado := 1; + { S7_MLC := "MLC_3T7" } + EA[1] := (); + EA[2].Hmi_Estado := 1; + EA[2].Estado_ValorIngenieria := 1.0489; + EA[2].Estado_AutoMan := FALSE; + EA[2].Alarmas_Min := FALSE; + EA[2].Alarmas_Max := FALSE; + EA[2].Alarmas_HiloRoto := FALSE; + EA[2].Alarmas_Lectura := FALSE; + EA[2].Alarmas_Parametros := FALSE; + EA[2].Alarmas_General := FALSE; + EA[2].Config_Habilitar := TRUE; + EA[2].Config_HabilitarAlarmaMin := FALSE; + EA[2].Config_HabilitarAlarmaMax := FALSE; + EA[2].Config_HisteresisTipo := FALSE; + EA[2].Aux_oldAlarma := FALSE; + EA[2].Aux_oldAutoMan := FALSE; + EA[2].Config_TipoAcceso := 0; + EA[2].Config_GrupoAlarma := 0; + EA[2].Estado_ValorTarjeta := 29; + EA[2].Estado_Lectura := 16#0000; + EA[2].Orden_ConsignaManual := 1.0489; + EA[2].Config_DireccionEntradaByte := 2002; + EA[2].Config_EscaladoMinTarjeta := 0; + EA[2].Config_EscaladoMaxTarjeta := 27648; + EA[2].Config_EscaladoMinIngenieria := 0.0; + EA[2].Config_EscaladoMaxIngenieria := 1000.0; + EA[2].Config_EscaladoOffset := 0.0; + EA[2].Config_ErrorMinIngenieria := 0.0; + EA[2].Config_ErrorMaxIngenieria := 100.0; + EA[2].Config_ErrorMinHisteresis := 0.0; + EA[2].Config_ErrorMaxHisteresis := 0.0; + EA[2].Aux_Estado := 1; + { S7_MLC := "MLC_4zB" } + EA[2] := (); + EA[3].Hmi_Estado := 1; + EA[3].Estado_ValorIngenieria := 10.41667; + EA[3].Estado_AutoMan := FALSE; + EA[3].Alarmas_Min := FALSE; + EA[3].Alarmas_Max := FALSE; + EA[3].Alarmas_HiloRoto := FALSE; + EA[3].Alarmas_Lectura := FALSE; + EA[3].Alarmas_Parametros := FALSE; + EA[3].Alarmas_General := FALSE; + EA[3].Config_Habilitar := TRUE; + EA[3].Config_HabilitarAlarmaMin := FALSE; + EA[3].Config_HabilitarAlarmaMax := FALSE; + EA[3].Config_HisteresisTipo := FALSE; + EA[3].Aux_oldAlarma := FALSE; + EA[3].Aux_oldAutoMan := FALSE; + EA[3].Config_TipoAcceso := 0; + EA[3].Config_GrupoAlarma := 0; + EA[3].Estado_ValorTarjeta := 4; + EA[3].Estado_Lectura := 16#0000; + EA[3].Orden_ConsignaManual := 10.41667; + EA[3].Config_DireccionEntradaByte := 2004; + EA[3].Config_EscaladoMinTarjeta := 0; + EA[3].Config_EscaladoMaxTarjeta := 27648; + EA[3].Config_EscaladoMinIngenieria := 0.0; + EA[3].Config_EscaladoMaxIngenieria := 72000.0; + EA[3].Config_EscaladoOffset := 0.0; + EA[3].Config_ErrorMinIngenieria := 0.0; + EA[3].Config_ErrorMaxIngenieria := 100.0; + EA[3].Config_ErrorMinHisteresis := 0.0; + EA[3].Config_ErrorMaxHisteresis := 0.0; + EA[3].Aux_Estado := 1; + { S7_MLC := "MLC_4ni" } + EA[3] := (); + EA[4].Hmi_Estado := 1; + EA[4].Estado_ValorIngenieria := 25.16204; + EA[4].Estado_AutoMan := FALSE; + EA[4].Alarmas_Min := FALSE; + EA[4].Alarmas_Max := FALSE; + EA[4].Alarmas_HiloRoto := FALSE; + EA[4].Alarmas_Lectura := FALSE; + EA[4].Alarmas_Parametros := FALSE; + EA[4].Alarmas_General := FALSE; + EA[4].Config_Habilitar := TRUE; + EA[4].Config_HabilitarAlarmaMin := FALSE; + EA[4].Config_HabilitarAlarmaMax := FALSE; + EA[4].Config_HisteresisTipo := FALSE; + EA[4].Aux_oldAlarma := FALSE; + EA[4].Aux_oldAutoMan := FALSE; + EA[4].Config_TipoAcceso := 0; + EA[4].Config_GrupoAlarma := 0; + EA[4].Estado_ValorTarjeta := 6076; + EA[4].Estado_Lectura := 16#0000; + EA[4].Orden_ConsignaManual := 25.16204; + EA[4].Config_DireccionEntradaByte := 2008; + EA[4].Config_EscaladoMinTarjeta := 0; + EA[4].Config_EscaladoMaxTarjeta := 27648; + EA[4].Config_EscaladoMinIngenieria := -10.0; + EA[4].Config_EscaladoMaxIngenieria := 150.0; + EA[4].Config_EscaladoOffset := 0.0; + EA[4].Config_ErrorMinIngenieria := 0.0; + EA[4].Config_ErrorMaxIngenieria := 100.0; + EA[4].Config_ErrorMinHisteresis := 0.0; + EA[4].Config_ErrorMaxHisteresis := 0.0; + EA[4].Aux_Estado := 1; + { S7_MLC := "MLC_jP" } + EA[4] := (); + EA[5].Hmi_Estado := 1; + EA[5].Estado_ValorIngenieria := 25.19676; + EA[5].Estado_AutoMan := FALSE; + EA[5].Alarmas_Min := FALSE; + EA[5].Alarmas_Max := FALSE; + EA[5].Alarmas_HiloRoto := FALSE; + EA[5].Alarmas_Lectura := FALSE; + EA[5].Alarmas_Parametros := FALSE; + EA[5].Alarmas_General := FALSE; + EA[5].Config_Habilitar := TRUE; + EA[5].Config_HabilitarAlarmaMin := FALSE; + EA[5].Config_HabilitarAlarmaMax := FALSE; + EA[5].Config_HisteresisTipo := FALSE; + EA[5].Aux_oldAlarma := FALSE; + EA[5].Aux_oldAutoMan := FALSE; + EA[5].Config_TipoAcceso := 0; + EA[5].Config_GrupoAlarma := 0; + EA[5].Estado_ValorTarjeta := 6082; + EA[5].Estado_Lectura := 16#0000; + EA[5].Orden_ConsignaManual := 25.19676; + EA[5].Config_DireccionEntradaByte := 2010; + EA[5].Config_EscaladoMinTarjeta := 0; + EA[5].Config_EscaladoMaxTarjeta := 27648; + EA[5].Config_EscaladoMinIngenieria := -10.0; + EA[5].Config_EscaladoMaxIngenieria := 150.0; + EA[5].Config_EscaladoOffset := 0.0; + EA[5].Config_ErrorMinIngenieria := 0.0; + EA[5].Config_ErrorMaxIngenieria := 100.0; + EA[5].Config_ErrorMinHisteresis := 0.0; + EA[5].Config_ErrorMaxHisteresis := 0.0; + EA[5].Aux_Estado := 1; + { S7_MLC := "MLC_3ah" } + EA[5] := (); Agrup[0].AlgunaEnManual := FALSE; - Agrup[0].AlgunaAlarma := FALSE; + Agrup[0].AlgunaAlarma := TRUE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 30; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7res b/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7res index 2786b8c..3aabb3f 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7res +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2001_EA.s7res @@ -7,3 +7,13 @@ 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 diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2005_SD.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2005_SD.s7dcl index 0fc6682..675930a 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2005_SD.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2005_SD.s7dcl @@ -23,9 +23,11 @@ DATA_BLOCK DB2005_SD NumDispositivos : Int; END_VAR + SD[0].Hmi_Estado := 0; SD[0].Estado_AutoMan := FALSE; SD[0].Estado_Activado := FALSE; SD[0].Estado_Enclavado := FALSE; + SD[0].Estado_Salida := FALSE; SD[0].Orden_ActivarManual := FALSE; SD[0].Orden_ActivarAuto := FALSE; SD[0].Config_Habilitar := FALSE; @@ -35,6 +37,7 @@ DATA_BLOCK DB2005_SD SD[0].Aux_oldActivado := FALSE; SD[0].Aux_oldAutoMan := FALSE; SD[0].Estado_SeguridadOk := TRUE; + SD[0].Config_TipoAcceso := 0; SD[0].Config_GrupoAlarma := 0; SD[0].Config_DireccionSalidaByte := 0; SD[0].Config_DireccionSalidaBit := 0; @@ -47,5 +50,6 @@ DATA_BLOCK DB2005_SD Agrup[0].AlgunaEnManual := FALSE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 0; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7dcl index 56f8b88..8bc759d 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7dcl @@ -23,6 +23,8 @@ DATA_BLOCK DB2006_SA NumDispositivos : Int; END_VAR + SA[0].Hmi_Estado := 0; + SA[0].Estado_ValorActual := 0.0; SA[0].Estado_AutoMan := FALSE; SA[0].Estado_Enclavado := FALSE; SA[0].Alarmas_Min := FALSE; @@ -36,6 +38,7 @@ DATA_BLOCK DB2006_SA SA[0].Aux_oldAlarma := FALSE; SA[0].Aux_oldAutoMan := FALSE; SA[0].Estado_SeguridadOk := TRUE; + SA[0].Config_TipoAcceso := 0; SA[0].Config_GrupoAlarma := 0; SA[0].Estado_ValorTarjeta := 0; SA[0].Estado_Escritura := 16#0000; @@ -53,8 +56,172 @@ DATA_BLOCK DB2006_SA SA[0].Aux_Estado := 0; { S7_MLC := "MLC_4Nk" } SA[0] := (); - Agrup[0].AlgunaEnManual := FALSE; + SA[1].Hmi_Estado := 3; + SA[1].Estado_ValorActual := 100.0; + SA[1].Estado_AutoMan := TRUE; + SA[1].Estado_Enclavado := FALSE; + SA[1].Alarmas_Min := FALSE; + SA[1].Alarmas_Max := FALSE; + SA[1].Alarmas_Escritura := FALSE; + SA[1].Alarmas_Parametros := FALSE; + SA[1].Alarmas_General := FALSE; + SA[1].Config_Habilitar := TRUE; + SA[1].Config_HabilitarAlarmaMin := FALSE; + SA[1].Config_HabilitarAlarmaMax := FALSE; + SA[1].Aux_oldAlarma := FALSE; + SA[1].Aux_oldAutoMan := TRUE; + SA[1].Estado_SeguridadOk := TRUE; + SA[1].Config_TipoAcceso := 0; + SA[1].Config_GrupoAlarma := 0; + SA[1].Estado_ValorTarjeta := 27648; + SA[1].Estado_Escritura := 16#0000; + SA[1].Orden_ConsignaManual := 100.0; + SA[1].Orden_ConsignaAuto := 0.0; + SA[1].Orden_ConsignaEnclavado := 0.0; + SA[1].Config_DireccionSalidaByte := 2002; + SA[1].Config_EscaladoMinTarjeta := 0; + SA[1].Config_EscaladoMaxTarjeta := 27648; + SA[1].Config_EscaladoMinIngenieria := 0.0; + SA[1].Config_EscaladoMaxIngenieria := 100.0; + SA[1].Config_EscaladoOffset := 0.0; + SA[1].Config_ErrorMinIngenieria := 0.0; + SA[1].Config_ErrorMaxIngenieria := 0.0; + SA[1].Aux_Estado := 2; + { S7_MLC := "MLC_4VS" } + SA[1] := (); + SA[2].Hmi_Estado := 1; + SA[2].Estado_ValorActual := 0.0; + SA[2].Estado_AutoMan := FALSE; + SA[2].Estado_Enclavado := FALSE; + SA[2].Alarmas_Min := FALSE; + SA[2].Alarmas_Max := FALSE; + SA[2].Alarmas_Escritura := FALSE; + SA[2].Alarmas_Parametros := FALSE; + SA[2].Alarmas_General := FALSE; + SA[2].Config_Habilitar := TRUE; + SA[2].Config_HabilitarAlarmaMin := FALSE; + SA[2].Config_HabilitarAlarmaMax := FALSE; + SA[2].Aux_oldAlarma := FALSE; + SA[2].Aux_oldAutoMan := FALSE; + SA[2].Estado_SeguridadOk := TRUE; + SA[2].Config_TipoAcceso := 0; + SA[2].Config_GrupoAlarma := 0; + SA[2].Estado_ValorTarjeta := 0; + SA[2].Estado_Escritura := 16#0000; + SA[2].Orden_ConsignaManual := 0.0; + SA[2].Orden_ConsignaAuto := 0.0; + SA[2].Orden_ConsignaEnclavado := 0.0; + SA[2].Config_DireccionSalidaByte := 2004; + SA[2].Config_EscaladoMinTarjeta := 0; + SA[2].Config_EscaladoMaxTarjeta := 27648; + SA[2].Config_EscaladoMinIngenieria := 0.0; + SA[2].Config_EscaladoMaxIngenieria := 100.0; + SA[2].Config_EscaladoOffset := 0.0; + SA[2].Config_ErrorMinIngenieria := 0.0; + SA[2].Config_ErrorMaxIngenieria := 0.0; + SA[2].Aux_Estado := 1; + { S7_MLC := "MLC_Rp" } + SA[2] := (); + SA[3].Hmi_Estado := 3; + SA[3].Estado_ValorActual := 100.0; + SA[3].Estado_AutoMan := TRUE; + SA[3].Estado_Enclavado := FALSE; + SA[3].Alarmas_Min := FALSE; + SA[3].Alarmas_Max := FALSE; + SA[3].Alarmas_Escritura := FALSE; + SA[3].Alarmas_Parametros := FALSE; + SA[3].Alarmas_General := FALSE; + SA[3].Config_Habilitar := TRUE; + SA[3].Config_HabilitarAlarmaMin := FALSE; + SA[3].Config_HabilitarAlarmaMax := FALSE; + SA[3].Aux_oldAlarma := FALSE; + SA[3].Aux_oldAutoMan := TRUE; + SA[3].Estado_SeguridadOk := TRUE; + SA[3].Config_TipoAcceso := 0; + SA[3].Config_GrupoAlarma := 0; + SA[3].Estado_ValorTarjeta := 27648; + SA[3].Estado_Escritura := 16#0000; + SA[3].Orden_ConsignaManual := 100.0; + SA[3].Orden_ConsignaAuto := 0.0; + SA[3].Orden_ConsignaEnclavado := 0.0; + SA[3].Config_DireccionSalidaByte := 2006; + SA[3].Config_EscaladoMinTarjeta := 0; + SA[3].Config_EscaladoMaxTarjeta := 27648; + SA[3].Config_EscaladoMinIngenieria := 0.0; + SA[3].Config_EscaladoMaxIngenieria := 100.0; + SA[3].Config_EscaladoOffset := 0.0; + SA[3].Config_ErrorMinIngenieria := 0.0; + SA[3].Config_ErrorMaxIngenieria := 0.0; + SA[3].Aux_Estado := 2; + { S7_MLC := "MLC_4DF" } + SA[3] := (); + SA[4].Hmi_Estado := 1; + SA[4].Estado_ValorActual := 0.0; + SA[4].Estado_AutoMan := FALSE; + SA[4].Estado_Enclavado := FALSE; + SA[4].Alarmas_Min := FALSE; + SA[4].Alarmas_Max := FALSE; + SA[4].Alarmas_Escritura := FALSE; + SA[4].Alarmas_Parametros := FALSE; + SA[4].Alarmas_General := FALSE; + SA[4].Config_Habilitar := TRUE; + SA[4].Config_HabilitarAlarmaMin := FALSE; + SA[4].Config_HabilitarAlarmaMax := FALSE; + SA[4].Aux_oldAlarma := FALSE; + SA[4].Aux_oldAutoMan := FALSE; + SA[4].Estado_SeguridadOk := TRUE; + SA[4].Config_TipoAcceso := 0; + SA[4].Config_GrupoAlarma := 0; + SA[4].Estado_ValorTarjeta := 0; + SA[4].Estado_Escritura := 16#0000; + SA[4].Orden_ConsignaManual := -0.166739; + SA[4].Orden_ConsignaAuto := -0.166739; + SA[4].Orden_ConsignaEnclavado := 0.0; + SA[4].Config_DireccionSalidaByte := 2008; + SA[4].Config_EscaladoMinTarjeta := 0; + SA[4].Config_EscaladoMaxTarjeta := 27648; + SA[4].Config_EscaladoMinIngenieria := 0.0; + SA[4].Config_EscaladoMaxIngenieria := 10.0; + SA[4].Config_EscaladoOffset := 0.0; + SA[4].Config_ErrorMinIngenieria := 0.0; + SA[4].Config_ErrorMaxIngenieria := 0.0; + SA[4].Aux_Estado := 1; + { S7_MLC := "MLC_3hb" } + SA[4] := (); + SA[5].Hmi_Estado := 0; + SA[5].Estado_ValorActual := 0.0; + SA[5].Estado_AutoMan := FALSE; + SA[5].Estado_Enclavado := FALSE; + SA[5].Alarmas_Min := FALSE; + SA[5].Alarmas_Max := FALSE; + SA[5].Alarmas_Escritura := FALSE; + SA[5].Alarmas_Parametros := FALSE; + SA[5].Alarmas_General := FALSE; + SA[5].Config_Habilitar := FALSE; + SA[5].Config_HabilitarAlarmaMin := FALSE; + SA[5].Config_HabilitarAlarmaMax := FALSE; + SA[5].Aux_oldAlarma := FALSE; + SA[5].Aux_oldAutoMan := FALSE; + SA[5].Estado_SeguridadOk := TRUE; + SA[5].Config_TipoAcceso := 0; + SA[5].Config_GrupoAlarma := 0; + SA[5].Estado_ValorTarjeta := 0; + SA[5].Estado_Escritura := 16#0000; + SA[5].Orden_ConsignaManual := 0.0; + SA[5].Orden_ConsignaAuto := 0.0; + SA[5].Orden_ConsignaEnclavado := 0.0; + SA[5].Config_DireccionSalidaByte := 0; + SA[5].Config_EscaladoMinTarjeta := 0; + SA[5].Config_EscaladoMaxTarjeta := 27648; + SA[5].Config_EscaladoMinIngenieria := 0.0; + SA[5].Config_EscaladoMaxIngenieria := 100.0; + SA[5].Config_EscaladoOffset := 0.0; + SA[5].Config_ErrorMinIngenieria := 0.0; + SA[5].Config_ErrorMaxIngenieria := 0.0; + SA[5].Aux_Estado := 0; + Agrup[0].AlgunaEnManual := TRUE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 10; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7res b/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7res index fdd4a21..b1afb46 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7res +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2006_SA.s7res @@ -7,3 +7,11 @@ 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 + - id: MLC_3hb + es-ES: Delta Presion diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7dcl index f51dd8a..6fdcd39 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7dcl @@ -23,12 +23,14 @@ DATA_BLOCK DB2010_V NumDispositivos : Int; END_VAR + V[0].Hmi_Estado := 0; V[0].Estado_AutoMan := FALSE; V[0].Estado_Activado := FALSE; V[0].Estado_Enclavado := FALSE; V[0].Estado_SeguridadOk := TRUE; V[0].Estado_EntradaRetornoReposo := FALSE; V[0].Estado_EntradaRetornoTrabajo := FALSE; + V[0].Estado_Salida := FALSE; V[0].Alarmas_Reposo := FALSE; V[0].Alarmas_Trabajo := FALSE; V[0].Alarmas_Mantenimiento := FALSE; @@ -46,6 +48,7 @@ DATA_BLOCK DB2010_V V[0].Aux_oldActivado := FALSE; V[0].Aux_oldAlarma := FALSE; V[0].Aux_oldAutoMan := FALSE; + V[0].Config_TipoAcceso := 0; V[0].Config_GrupoAlarma := 0; V[0].Config_DireccionSalidaByte := 0; V[0].Config_DireccionSalidaBit := 0; @@ -59,8 +62,204 @@ DATA_BLOCK DB2010_V V[0].Tiempos_Ciclos := 0; { S7_MLC := "MLC_k3" } V[0] := (); - Agrup[0].AlgunaEnManual := FALSE; - Agrup[0].AlgunaAlarma := FALSE; + V[1].Hmi_Estado := 3; + V[1].Estado_AutoMan := TRUE; + V[1].Estado_Activado := FALSE; + V[1].Estado_Enclavado := FALSE; + V[1].Estado_SeguridadOk := TRUE; + V[1].Estado_EntradaRetornoReposo := TRUE; + V[1].Estado_EntradaRetornoTrabajo := FALSE; + V[1].Estado_Salida := FALSE; + V[1].Alarmas_Reposo := FALSE; + V[1].Alarmas_Trabajo := FALSE; + V[1].Alarmas_Mantenimiento := FALSE; + V[1].Alarmas_Doble := FALSE; + V[1].Alarmas_General := FALSE; + V[1].Orden_ActivarManual := FALSE; + V[1].Orden_ActivarAuto := FALSE; + V[1].Orden_ResetCiclos := FALSE; + V[1].Config_Habilitar := TRUE; + V[1].Config_HabilitarRetornoReposo := TRUE; + V[1].Config_HabilitarInvertirReposo := FALSE; + V[1].Config_HabilitarRetornoTrabajo := TRUE; + V[1].Config_HabilitarInvertirTrabajo := FALSE; + V[1].Config_HabilitarMantenimiento := FALSE; + V[1].Aux_oldActivado := FALSE; + V[1].Aux_oldAlarma := FALSE; + V[1].Aux_oldAutoMan := TRUE; + V[1].Config_TipoAcceso := 0; + V[1].Config_GrupoAlarma := 0; + V[1].Config_DireccionSalidaByte := 12000; + V[1].Config_DireccionSalidaBit := 1; + V[1].Config_DireccionRetReposoByte := 12000; + V[1].Config_DireccionRetReposoBit := 0; + V[1].Config_DireccionRetTrabajoByte := 12000; + V[1].Config_DireccionRetTrabajoBit := 1; + V[1].Tiempos_SetPointTiempoAlarma := 10; + V[1].Tiempos_Alarma := 0; + V[1].Tiempos_SetPointCiclos := 1000; + V[1].Tiempos_Ciclos := 6; + { S7_MLC := "MLC_3HV" } + V[1] := (); + V[2].Hmi_Estado := 1; + V[2].Estado_AutoMan := FALSE; + V[2].Estado_Activado := FALSE; + V[2].Estado_Enclavado := FALSE; + V[2].Estado_SeguridadOk := TRUE; + V[2].Estado_EntradaRetornoReposo := TRUE; + V[2].Estado_EntradaRetornoTrabajo := FALSE; + V[2].Estado_Salida := FALSE; + V[2].Alarmas_Reposo := FALSE; + V[2].Alarmas_Trabajo := FALSE; + V[2].Alarmas_Mantenimiento := FALSE; + V[2].Alarmas_Doble := FALSE; + V[2].Alarmas_General := FALSE; + V[2].Orden_ActivarManual := FALSE; + V[2].Orden_ActivarAuto := FALSE; + V[2].Orden_ResetCiclos := FALSE; + V[2].Config_Habilitar := TRUE; + V[2].Config_HabilitarRetornoReposo := TRUE; + V[2].Config_HabilitarInvertirReposo := FALSE; + V[2].Config_HabilitarRetornoTrabajo := TRUE; + V[2].Config_HabilitarInvertirTrabajo := FALSE; + V[2].Config_HabilitarMantenimiento := FALSE; + V[2].Aux_oldActivado := FALSE; + V[2].Aux_oldAlarma := FALSE; + V[2].Aux_oldAutoMan := FALSE; + V[2].Config_TipoAcceso := 0; + V[2].Config_GrupoAlarma := 0; + V[2].Config_DireccionSalidaByte := 12001; + V[2].Config_DireccionSalidaBit := 5; + V[2].Config_DireccionRetReposoByte := 12001; + V[2].Config_DireccionRetReposoBit := 4; + V[2].Config_DireccionRetTrabajoByte := 12001; + V[2].Config_DireccionRetTrabajoBit := 5; + V[2].Tiempos_SetPointTiempoAlarma := 10; + V[2].Tiempos_Alarma := 0; + V[2].Tiempos_SetPointCiclos := 1000; + V[2].Tiempos_Ciclos := 6; + { S7_MLC := "MLC_3FJ" } + V[2] := (); + V[3].Hmi_Estado := 11; + V[3].Estado_AutoMan := TRUE; + V[3].Estado_Activado := TRUE; + V[3].Estado_Enclavado := FALSE; + V[3].Estado_SeguridadOk := TRUE; + V[3].Estado_EntradaRetornoReposo := FALSE; + V[3].Estado_EntradaRetornoTrabajo := TRUE; + V[3].Estado_Salida := TRUE; + V[3].Alarmas_Reposo := FALSE; + V[3].Alarmas_Trabajo := FALSE; + V[3].Alarmas_Mantenimiento := FALSE; + V[3].Alarmas_Doble := FALSE; + V[3].Alarmas_General := FALSE; + V[3].Orden_ActivarManual := TRUE; + V[3].Orden_ActivarAuto := FALSE; + V[3].Orden_ResetCiclos := FALSE; + V[3].Config_Habilitar := TRUE; + V[3].Config_HabilitarRetornoReposo := TRUE; + V[3].Config_HabilitarInvertirReposo := FALSE; + V[3].Config_HabilitarRetornoTrabajo := TRUE; + V[3].Config_HabilitarInvertirTrabajo := FALSE; + V[3].Config_HabilitarMantenimiento := FALSE; + V[3].Aux_oldActivado := TRUE; + V[3].Aux_oldAlarma := FALSE; + V[3].Aux_oldAutoMan := TRUE; + V[3].Config_TipoAcceso := 0; + V[3].Config_GrupoAlarma := 0; + V[3].Config_DireccionSalidaByte := 12001; + V[3].Config_DireccionSalidaBit := 1; + V[3].Config_DireccionRetReposoByte := 12001; + V[3].Config_DireccionRetReposoBit := 0; + V[3].Config_DireccionRetTrabajoByte := 12001; + V[3].Config_DireccionRetTrabajoBit := 1; + V[3].Tiempos_SetPointTiempoAlarma := 10; + V[3].Tiempos_Alarma := 0; + V[3].Tiempos_SetPointCiclos := 1000; + V[3].Tiempos_Ciclos := 3; + { S7_MLC := "MLC_33k" } + V[3] := (); + V[4].Hmi_Estado := 3; + V[4].Estado_AutoMan := TRUE; + V[4].Estado_Activado := FALSE; + V[4].Estado_Enclavado := FALSE; + V[4].Estado_SeguridadOk := TRUE; + V[4].Estado_EntradaRetornoReposo := TRUE; + V[4].Estado_EntradaRetornoTrabajo := FALSE; + V[4].Estado_Salida := FALSE; + V[4].Alarmas_Reposo := FALSE; + V[4].Alarmas_Trabajo := FALSE; + V[4].Alarmas_Mantenimiento := FALSE; + V[4].Alarmas_Doble := FALSE; + V[4].Alarmas_General := FALSE; + V[4].Orden_ActivarManual := FALSE; + V[4].Orden_ActivarAuto := FALSE; + V[4].Orden_ResetCiclos := FALSE; + V[4].Config_Habilitar := TRUE; + V[4].Config_HabilitarRetornoReposo := TRUE; + V[4].Config_HabilitarInvertirReposo := FALSE; + V[4].Config_HabilitarRetornoTrabajo := TRUE; + V[4].Config_HabilitarInvertirTrabajo := FALSE; + V[4].Config_HabilitarMantenimiento := FALSE; + V[4].Aux_oldActivado := FALSE; + V[4].Aux_oldAlarma := FALSE; + V[4].Aux_oldAutoMan := TRUE; + V[4].Config_TipoAcceso := 0; + V[4].Config_GrupoAlarma := 0; + V[4].Config_DireccionSalidaByte := 12002; + V[4].Config_DireccionSalidaBit := 5; + V[4].Config_DireccionRetReposoByte := 12002; + V[4].Config_DireccionRetReposoBit := 4; + V[4].Config_DireccionRetTrabajoByte := 12002; + V[4].Config_DireccionRetTrabajoBit := 5; + V[4].Tiempos_SetPointTiempoAlarma := 10; + V[4].Tiempos_Alarma := 0; + V[4].Tiempos_SetPointCiclos := 1000; + V[4].Tiempos_Ciclos := 4; + { S7_MLC := "MLC_3Jq" } + V[4] := (); + V[5].Hmi_Estado := 257; + V[5].Estado_AutoMan := FALSE; + V[5].Estado_Activado := FALSE; + V[5].Estado_Enclavado := FALSE; + V[5].Estado_SeguridadOk := TRUE; + V[5].Estado_EntradaRetornoReposo := FALSE; + V[5].Estado_EntradaRetornoTrabajo := FALSE; + V[5].Estado_Salida := FALSE; + V[5].Alarmas_Reposo := TRUE; + V[5].Alarmas_Trabajo := FALSE; + V[5].Alarmas_Mantenimiento := FALSE; + V[5].Alarmas_Doble := TRUE; + V[5].Alarmas_General := TRUE; + V[5].Orden_ActivarManual := FALSE; + V[5].Orden_ActivarAuto := FALSE; + V[5].Orden_ResetCiclos := FALSE; + V[5].Config_Habilitar := TRUE; + V[5].Config_HabilitarRetornoReposo := TRUE; + V[5].Config_HabilitarInvertirReposo := FALSE; + V[5].Config_HabilitarRetornoTrabajo := TRUE; + V[5].Config_HabilitarInvertirTrabajo := FALSE; + V[5].Config_HabilitarMantenimiento := FALSE; + V[5].Aux_oldActivado := FALSE; + V[5].Aux_oldAlarma := TRUE; + V[5].Aux_oldAutoMan := FALSE; + V[5].Config_TipoAcceso := 0; + V[5].Config_GrupoAlarma := 0; + V[5].Config_DireccionSalidaByte := 12002; + V[5].Config_DireccionSalidaBit := 1; + V[5].Config_DireccionRetReposoByte := 12002; + V[5].Config_DireccionRetReposoBit := 0; + V[5].Config_DireccionRetTrabajoByte := 12002; + V[5].Config_DireccionRetTrabajoBit := 1; + V[5].Tiempos_SetPointTiempoAlarma := 10; + V[5].Tiempos_Alarma := 0; + V[5].Tiempos_SetPointCiclos := 1000; + V[5].Tiempos_Ciclos := 0; + { S7_MLC := "MLC_4aj" } + V[5] := (); + Agrup[0].AlgunaEnManual := TRUE; + Agrup[0].AlgunaAlarma := TRUE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 40; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7res b/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7res index bf48948..b1082b2 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7res +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2010_V.s7res @@ -7,3 +7,13 @@ es-ES: . - id: MLC_k3 es-ES: NO SE USA + - id: MLC_3HV + es-ES: VA4-201 + - id: MLC_3FJ + es-ES: VA-202 + - id: MLC_33k + es-ES: VA4-203 + - id: MLC_3Jq + es-ES: VA-204 + - id: MLC_4aj + es-ES: VA-205 diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7dcl index 5aa7e95..e324bb5 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7dcl @@ -23,12 +23,14 @@ DATA_BLOCK DB2015_M NumDispositivos : Int; END_VAR + "M"[0].Hmi_Estado := 0; "M"[0].Estado_AutoMan := FALSE; "M"[0].Estado_Activado := FALSE; "M"[0].Estado_Enclavado := FALSE; "M"[0].Estado_SeguridadOk := TRUE; "M"[0].Estado_EntradaTermico := FALSE; "M"[0].Estado_EntradaConfMarcha := FALSE; + "M"[0].Estado_Salida := FALSE; "M"[0].Alarmas_Termico := FALSE; "M"[0].Alarmas_ConfirmacionMarcha := FALSE; "M"[0].Alarmas_Mantenimiento := FALSE; @@ -45,6 +47,7 @@ DATA_BLOCK DB2015_M "M"[0].Aux_oldActivado := FALSE; "M"[0].Aux_oldAlarma := FALSE; "M"[0].Aux_oldAutoMan := FALSE; + "M"[0].Config_TipoAcceso := 0; "M"[0].Config_GrupoAlarma := 0; "M"[0].Config_DireccionSalidaByte := 0; "M"[0].Config_DireccionSalidaBit := 0; @@ -58,8 +61,193 @@ DATA_BLOCK DB2015_M "M"[0].Tiempos_Mantenimiento := 0.0; { S7_MLC := "MLC_4mp" } M[0] := (); - Agrup[0].AlgunaEnManual := FALSE; + "M"[1].Hmi_Estado := 3; + "M"[1].Estado_AutoMan := TRUE; + "M"[1].Estado_Activado := FALSE; + "M"[1].Estado_Enclavado := FALSE; + "M"[1].Estado_SeguridadOk := TRUE; + "M"[1].Estado_EntradaTermico := FALSE; + "M"[1].Estado_EntradaConfMarcha := FALSE; + "M"[1].Estado_Salida := FALSE; + "M"[1].Alarmas_Termico := FALSE; + "M"[1].Alarmas_ConfirmacionMarcha := FALSE; + "M"[1].Alarmas_Mantenimiento := FALSE; + "M"[1].Alarmas_General := FALSE; + "M"[1].Orden_ActivarManual := FALSE; + "M"[1].Orden_ActivarAuto := FALSE; + "M"[1].Orden_ResetHoras := FALSE; + "M"[1].Config_Habilitar := TRUE; + "M"[1].Config_HabilitarRetornoTermico := FALSE; + "M"[1].Config_HabilitarInvertirTermico := FALSE; + "M"[1].Config_HabilitarRetornoConfMarcha := TRUE; + "M"[1].Config_HabilitarInvertirConfMarcha := FALSE; + "M"[1].Config_HabilitarMantenimiento := FALSE; + "M"[1].Aux_oldActivado := FALSE; + "M"[1].Aux_oldAlarma := FALSE; + "M"[1].Aux_oldAutoMan := TRUE; + "M"[1].Config_TipoAcceso := 0; + "M"[1].Config_GrupoAlarma := 0; + "M"[1].Config_DireccionSalidaByte := 200; + "M"[1].Config_DireccionSalidaBit := 1; + "M"[1].Config_DireccionRetTermicoByte := 0; + "M"[1].Config_DireccionRetTermicoBit := 0; + "M"[1].Config_DireccionRetConfMarchaByte := 200; + "M"[1].Config_DireccionRetConfMarchaBit := 2; + "M"[1].Tiempos_SetPointTiempoAlarma := 10; + "M"[1].Tiempos_Alarma := 0; + "M"[1].Tiempos_SetPointMantenimiento := 2000.0; + "M"[1].Tiempos_Mantenimiento := 0.03000024; + { S7_MLC := "MLC_YF" } + M[1] := (); + "M"[2].Hmi_Estado := 1; + "M"[2].Estado_AutoMan := FALSE; + "M"[2].Estado_Activado := FALSE; + "M"[2].Estado_Enclavado := FALSE; + "M"[2].Estado_SeguridadOk := TRUE; + "M"[2].Estado_EntradaTermico := FALSE; + "M"[2].Estado_EntradaConfMarcha := FALSE; + "M"[2].Estado_Salida := FALSE; + "M"[2].Alarmas_Termico := FALSE; + "M"[2].Alarmas_ConfirmacionMarcha := FALSE; + "M"[2].Alarmas_Mantenimiento := FALSE; + "M"[2].Alarmas_General := FALSE; + "M"[2].Orden_ActivarManual := FALSE; + "M"[2].Orden_ActivarAuto := FALSE; + "M"[2].Orden_ResetHoras := FALSE; + "M"[2].Config_Habilitar := TRUE; + "M"[2].Config_HabilitarRetornoTermico := FALSE; + "M"[2].Config_HabilitarInvertirTermico := FALSE; + "M"[2].Config_HabilitarRetornoConfMarcha := TRUE; + "M"[2].Config_HabilitarInvertirConfMarcha := FALSE; + "M"[2].Config_HabilitarMantenimiento := FALSE; + "M"[2].Aux_oldActivado := FALSE; + "M"[2].Aux_oldAlarma := FALSE; + "M"[2].Aux_oldAutoMan := FALSE; + "M"[2].Config_TipoAcceso := 0; + "M"[2].Config_GrupoAlarma := 0; + "M"[2].Config_DireccionSalidaByte := 200; + "M"[2].Config_DireccionSalidaBit := 2; + "M"[2].Config_DireccionRetTermicoByte := 0; + "M"[2].Config_DireccionRetTermicoBit := 0; + "M"[2].Config_DireccionRetConfMarchaByte := 200; + "M"[2].Config_DireccionRetConfMarchaBit := 3; + "M"[2].Tiempos_SetPointTiempoAlarma := 10; + "M"[2].Tiempos_Alarma := 0; + "M"[2].Tiempos_SetPointMantenimiento := 2000.0; + "M"[2].Tiempos_Mantenimiento := 0.0; + { S7_MLC := "MLC_4ph" } + M[2] := (); + "M"[3].Hmi_Estado := 0; + "M"[3].Estado_AutoMan := FALSE; + "M"[3].Estado_Activado := FALSE; + "M"[3].Estado_Enclavado := FALSE; + "M"[3].Estado_SeguridadOk := TRUE; + "M"[3].Estado_EntradaTermico := FALSE; + "M"[3].Estado_EntradaConfMarcha := FALSE; + "M"[3].Estado_Salida := FALSE; + "M"[3].Alarmas_Termico := FALSE; + "M"[3].Alarmas_ConfirmacionMarcha := FALSE; + "M"[3].Alarmas_Mantenimiento := FALSE; + "M"[3].Alarmas_General := FALSE; + "M"[3].Orden_ActivarManual := FALSE; + "M"[3].Orden_ActivarAuto := FALSE; + "M"[3].Orden_ResetHoras := FALSE; + "M"[3].Config_Habilitar := FALSE; + "M"[3].Config_HabilitarRetornoTermico := FALSE; + "M"[3].Config_HabilitarInvertirTermico := FALSE; + "M"[3].Config_HabilitarRetornoConfMarcha := FALSE; + "M"[3].Config_HabilitarInvertirConfMarcha := FALSE; + "M"[3].Config_HabilitarMantenimiento := FALSE; + "M"[3].Aux_oldActivado := FALSE; + "M"[3].Aux_oldAlarma := FALSE; + "M"[3].Aux_oldAutoMan := FALSE; + "M"[3].Config_TipoAcceso := 0; + "M"[3].Config_GrupoAlarma := 0; + "M"[3].Config_DireccionSalidaByte := 0; + "M"[3].Config_DireccionSalidaBit := 0; + "M"[3].Config_DireccionRetTermicoByte := 0; + "M"[3].Config_DireccionRetTermicoBit := 0; + "M"[3].Config_DireccionRetConfMarchaByte := 0; + "M"[3].Config_DireccionRetConfMarchaBit := 0; + "M"[3].Tiempos_SetPointTiempoAlarma := 10; + "M"[3].Tiempos_Alarma := 0; + "M"[3].Tiempos_SetPointMantenimiento := 2000.0; + "M"[3].Tiempos_Mantenimiento := 0.0; + "M"[4].Hmi_Estado := 0; + "M"[4].Estado_AutoMan := FALSE; + "M"[4].Estado_Activado := FALSE; + "M"[4].Estado_Enclavado := FALSE; + "M"[4].Estado_SeguridadOk := TRUE; + "M"[4].Estado_EntradaTermico := FALSE; + "M"[4].Estado_EntradaConfMarcha := FALSE; + "M"[4].Estado_Salida := FALSE; + "M"[4].Alarmas_Termico := FALSE; + "M"[4].Alarmas_ConfirmacionMarcha := FALSE; + "M"[4].Alarmas_Mantenimiento := FALSE; + "M"[4].Alarmas_General := FALSE; + "M"[4].Orden_ActivarManual := FALSE; + "M"[4].Orden_ActivarAuto := FALSE; + "M"[4].Orden_ResetHoras := FALSE; + "M"[4].Config_Habilitar := FALSE; + "M"[4].Config_HabilitarRetornoTermico := TRUE; + "M"[4].Config_HabilitarInvertirTermico := FALSE; + "M"[4].Config_HabilitarRetornoConfMarcha := TRUE; + "M"[4].Config_HabilitarInvertirConfMarcha := FALSE; + "M"[4].Config_HabilitarMantenimiento := FALSE; + "M"[4].Aux_oldActivado := FALSE; + "M"[4].Aux_oldAlarma := FALSE; + "M"[4].Aux_oldAutoMan := FALSE; + "M"[4].Config_TipoAcceso := 0; + "M"[4].Config_GrupoAlarma := 0; + "M"[4].Config_DireccionSalidaByte := 0; + "M"[4].Config_DireccionSalidaBit := 0; + "M"[4].Config_DireccionRetTermicoByte := 0; + "M"[4].Config_DireccionRetTermicoBit := 0; + "M"[4].Config_DireccionRetConfMarchaByte := 0; + "M"[4].Config_DireccionRetConfMarchaBit := 0; + "M"[4].Tiempos_SetPointTiempoAlarma := 10; + "M"[4].Tiempos_Alarma := 0; + "M"[4].Tiempos_SetPointMantenimiento := 2000.0; + "M"[4].Tiempos_Mantenimiento := 0.0; + "M"[5].Hmi_Estado := 0; + "M"[5].Estado_AutoMan := FALSE; + "M"[5].Estado_Activado := FALSE; + "M"[5].Estado_Enclavado := FALSE; + "M"[5].Estado_SeguridadOk := TRUE; + "M"[5].Estado_EntradaTermico := FALSE; + "M"[5].Estado_EntradaConfMarcha := FALSE; + "M"[5].Estado_Salida := FALSE; + "M"[5].Alarmas_Termico := FALSE; + "M"[5].Alarmas_ConfirmacionMarcha := FALSE; + "M"[5].Alarmas_Mantenimiento := FALSE; + "M"[5].Alarmas_General := FALSE; + "M"[5].Orden_ActivarManual := FALSE; + "M"[5].Orden_ActivarAuto := FALSE; + "M"[5].Orden_ResetHoras := FALSE; + "M"[5].Config_Habilitar := FALSE; + "M"[5].Config_HabilitarRetornoTermico := TRUE; + "M"[5].Config_HabilitarInvertirTermico := FALSE; + "M"[5].Config_HabilitarRetornoConfMarcha := TRUE; + "M"[5].Config_HabilitarInvertirConfMarcha := FALSE; + "M"[5].Config_HabilitarMantenimiento := FALSE; + "M"[5].Aux_oldActivado := FALSE; + "M"[5].Aux_oldAlarma := FALSE; + "M"[5].Aux_oldAutoMan := FALSE; + "M"[5].Config_TipoAcceso := 0; + "M"[5].Config_GrupoAlarma := 0; + "M"[5].Config_DireccionSalidaByte := 0; + "M"[5].Config_DireccionSalidaBit := 0; + "M"[5].Config_DireccionRetTermicoByte := 0; + "M"[5].Config_DireccionRetTermicoBit := 0; + "M"[5].Config_DireccionRetConfMarchaByte := 0; + "M"[5].Config_DireccionRetConfMarchaBit := 0; + "M"[5].Tiempos_SetPointTiempoAlarma := 10; + "M"[5].Tiempos_Alarma := 0; + "M"[5].Tiempos_SetPointMantenimiento := 2000.0; + "M"[5].Tiempos_Mantenimiento := 0.0; + Agrup[0].AlgunaEnManual := TRUE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 12; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7res b/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7res index 8ac3da4..1d275b1 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7res +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2015_M.s7res @@ -7,3 +7,7 @@ es-ES: . - id: MLC_4mp es-ES: NO SE USA + - id: MLC_YF + es-ES: P-201 + - id: MLC_4ph + es-ES: BD-201 diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7dcl index 29a59cd..401fca8 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7dcl @@ -23,12 +23,15 @@ DATA_BLOCK DB2016_M_VF NumDispositivos : Int; END_VAR + M_VF[0].Hmi_Estado := 0; + M_VF[0].Estado_ValorActual := 0.0; M_VF[0].Estado_AutoMan := FALSE; M_VF[0].Estado_Activado := FALSE; M_VF[0].Estado_Enclavado := FALSE; M_VF[0].Estado_SeguridadOk := TRUE; M_VF[0].Estado_EntradaTermico := FALSE; M_VF[0].Estado_EntradaConfMarcha := FALSE; + M_VF[0].Estado_Salida := FALSE; M_VF[0].Alarmas_Termico := FALSE; M_VF[0].Alarmas_ConfirmacionMarcha := FALSE; M_VF[0].Alarmas_Mantenimiento := FALSE; @@ -48,7 +51,9 @@ DATA_BLOCK DB2016_M_VF M_VF[0].Aux_oldActivado := FALSE; M_VF[0].Aux_oldAlarma := FALSE; M_VF[0].Aux_oldAutoMan := FALSE; + M_VF[0].Config_TipoAcceso := 0; M_VF[0].Estado_Escritura := 16#0000; + M_VF[0].Estado_ValorTarjeta := 0; M_VF[0].Config_GrupoAlarma := 0; M_VF[0].Orden_ConsignaManual := 0.0; M_VF[0].Orden_ConsignaAuto := 0.0; @@ -67,8 +72,246 @@ DATA_BLOCK DB2016_M_VF M_VF[0].Tiempos_Mantenimiento := 0.0; { S7_MLC := "MLC_4u6" } M_VF[0] := (); - Agrup[0].AlgunaEnManual := FALSE; + M_VF[1].Hmi_Estado := 3; + M_VF[1].Estado_ValorActual := 0.0; + M_VF[1].Estado_AutoMan := TRUE; + M_VF[1].Estado_Activado := FALSE; + M_VF[1].Estado_Enclavado := FALSE; + M_VF[1].Estado_SeguridadOk := TRUE; + M_VF[1].Estado_EntradaTermico := FALSE; + M_VF[1].Estado_EntradaConfMarcha := FALSE; + M_VF[1].Estado_Salida := FALSE; + M_VF[1].Alarmas_Termico := FALSE; + M_VF[1].Alarmas_ConfirmacionMarcha := FALSE; + M_VF[1].Alarmas_Mantenimiento := FALSE; + M_VF[1].Alarmas_Escritura := FALSE; + M_VF[1].Alarmas_Parametros := FALSE; + M_VF[1].Alarmas_General := FALSE; + M_VF[1].Orden_ActivarManual := FALSE; + M_VF[1].Orden_ActivarAuto := FALSE; + M_VF[1].Orden_ResetHoras := FALSE; + M_VF[1].Config_Habilitar := TRUE; + M_VF[1].Config_HabilitarRetornoTermico := TRUE; + M_VF[1].Config_HabilitarInvertirTermico := TRUE; + M_VF[1].Config_HabilitarRetornoConfMarcha := TRUE; + M_VF[1].Config_HabilitarInvertirConfMarcha := FALSE; + M_VF[1].Config_HabilitarMantenimiento := FALSE; + M_VF[1].Config_HabilitarAlarmaEscrituraSalida := FALSE; + M_VF[1].Aux_oldActivado := FALSE; + M_VF[1].Aux_oldAlarma := FALSE; + M_VF[1].Aux_oldAutoMan := TRUE; + M_VF[1].Config_TipoAcceso := 0; + M_VF[1].Estado_Escritura := 16#0000; + M_VF[1].Estado_ValorTarjeta := 0; + M_VF[1].Config_GrupoAlarma := 0; + M_VF[1].Orden_ConsignaManual := 75.0; + M_VF[1].Orden_ConsignaAuto := 0.0; + M_VF[1].Config_DireccionSalidaByte := 200; + M_VF[1].Config_DireccionSalidaBit := 0; + M_VF[1].Config_DireccionRetTermicoByte := 200; + M_VF[1].Config_DireccionRetTermicoBit := 1; + M_VF[1].Config_DireccionRetConfMarchaByte := 200; + M_VF[1].Config_DireccionRetConfMarchaBit := 0; + M_VF[1].Config_DireccionSalidaAnalogicaByte := 2000; + M_VF[1].Config_EscaladoMinIngenieria := 0.0; + M_VF[1].Config_EscaladoMaxIngenieria := 100.0; + M_VF[1].Tiempos_SetPointAlarma := 10; + M_VF[1].Tiempos_Alarma := 0; + M_VF[1].Tiempos_SetPointMantenimiento := 2000.0; + M_VF[1].Tiempos_Mantenimiento := 0.4722353; + { S7_MLC := "MLC_vi" } + M_VF[1] := (); + M_VF[2].Hmi_Estado := 0; + M_VF[2].Estado_ValorActual := 0.0; + M_VF[2].Estado_AutoMan := FALSE; + M_VF[2].Estado_Activado := FALSE; + M_VF[2].Estado_Enclavado := FALSE; + M_VF[2].Estado_SeguridadOk := TRUE; + M_VF[2].Estado_EntradaTermico := FALSE; + M_VF[2].Estado_EntradaConfMarcha := FALSE; + M_VF[2].Estado_Salida := FALSE; + M_VF[2].Alarmas_Termico := FALSE; + M_VF[2].Alarmas_ConfirmacionMarcha := FALSE; + M_VF[2].Alarmas_Mantenimiento := FALSE; + M_VF[2].Alarmas_Escritura := FALSE; + M_VF[2].Alarmas_Parametros := FALSE; + M_VF[2].Alarmas_General := FALSE; + M_VF[2].Orden_ActivarManual := FALSE; + M_VF[2].Orden_ActivarAuto := FALSE; + M_VF[2].Orden_ResetHoras := FALSE; + M_VF[2].Config_Habilitar := FALSE; + M_VF[2].Config_HabilitarRetornoTermico := FALSE; + M_VF[2].Config_HabilitarInvertirTermico := FALSE; + M_VF[2].Config_HabilitarRetornoConfMarcha := FALSE; + M_VF[2].Config_HabilitarInvertirConfMarcha := FALSE; + M_VF[2].Config_HabilitarMantenimiento := FALSE; + M_VF[2].Config_HabilitarAlarmaEscrituraSalida := FALSE; + M_VF[2].Aux_oldActivado := FALSE; + M_VF[2].Aux_oldAlarma := FALSE; + M_VF[2].Aux_oldAutoMan := FALSE; + M_VF[2].Config_TipoAcceso := 0; + M_VF[2].Estado_Escritura := 16#0000; + M_VF[2].Estado_ValorTarjeta := 0; + M_VF[2].Config_GrupoAlarma := 0; + M_VF[2].Orden_ConsignaManual := 0.0; + M_VF[2].Orden_ConsignaAuto := 0.0; + M_VF[2].Config_DireccionSalidaByte := 0; + M_VF[2].Config_DireccionSalidaBit := 0; + M_VF[2].Config_DireccionRetTermicoByte := 0; + M_VF[2].Config_DireccionRetTermicoBit := 0; + M_VF[2].Config_DireccionRetConfMarchaByte := 0; + M_VF[2].Config_DireccionRetConfMarchaBit := 0; + M_VF[2].Config_DireccionSalidaAnalogicaByte := 0; + M_VF[2].Config_EscaladoMinIngenieria := 0.0; + M_VF[2].Config_EscaladoMaxIngenieria := 100.0; + M_VF[2].Tiempos_SetPointAlarma := 10; + M_VF[2].Tiempos_Alarma := 0; + M_VF[2].Tiempos_SetPointMantenimiento := 2000.0; + M_VF[2].Tiempos_Mantenimiento := 0.0; + M_VF[3].Hmi_Estado := 0; + M_VF[3].Estado_ValorActual := 0.0; + M_VF[3].Estado_AutoMan := FALSE; + M_VF[3].Estado_Activado := FALSE; + M_VF[3].Estado_Enclavado := FALSE; + M_VF[3].Estado_SeguridadOk := TRUE; + M_VF[3].Estado_EntradaTermico := FALSE; + M_VF[3].Estado_EntradaConfMarcha := FALSE; + M_VF[3].Estado_Salida := FALSE; + M_VF[3].Alarmas_Termico := FALSE; + M_VF[3].Alarmas_ConfirmacionMarcha := FALSE; + M_VF[3].Alarmas_Mantenimiento := FALSE; + M_VF[3].Alarmas_Escritura := FALSE; + M_VF[3].Alarmas_Parametros := FALSE; + M_VF[3].Alarmas_General := FALSE; + M_VF[3].Orden_ActivarManual := FALSE; + M_VF[3].Orden_ActivarAuto := FALSE; + M_VF[3].Orden_ResetHoras := FALSE; + M_VF[3].Config_Habilitar := FALSE; + M_VF[3].Config_HabilitarRetornoTermico := FALSE; + M_VF[3].Config_HabilitarInvertirTermico := FALSE; + M_VF[3].Config_HabilitarRetornoConfMarcha := FALSE; + M_VF[3].Config_HabilitarInvertirConfMarcha := FALSE; + M_VF[3].Config_HabilitarMantenimiento := FALSE; + M_VF[3].Config_HabilitarAlarmaEscrituraSalida := FALSE; + M_VF[3].Aux_oldActivado := FALSE; + M_VF[3].Aux_oldAlarma := FALSE; + M_VF[3].Aux_oldAutoMan := FALSE; + M_VF[3].Config_TipoAcceso := 0; + M_VF[3].Estado_Escritura := 16#0000; + M_VF[3].Estado_ValorTarjeta := 0; + M_VF[3].Config_GrupoAlarma := 0; + M_VF[3].Orden_ConsignaManual := 0.0; + M_VF[3].Orden_ConsignaAuto := 0.0; + M_VF[3].Config_DireccionSalidaByte := 0; + M_VF[3].Config_DireccionSalidaBit := 0; + M_VF[3].Config_DireccionRetTermicoByte := 0; + M_VF[3].Config_DireccionRetTermicoBit := 0; + M_VF[3].Config_DireccionRetConfMarchaByte := 0; + M_VF[3].Config_DireccionRetConfMarchaBit := 0; + M_VF[3].Config_DireccionSalidaAnalogicaByte := 0; + M_VF[3].Config_EscaladoMinIngenieria := 0.0; + M_VF[3].Config_EscaladoMaxIngenieria := 100.0; + M_VF[3].Tiempos_SetPointAlarma := 10; + M_VF[3].Tiempos_Alarma := 0; + M_VF[3].Tiempos_SetPointMantenimiento := 2000.0; + M_VF[3].Tiempos_Mantenimiento := 0.0; + M_VF[4].Hmi_Estado := 0; + M_VF[4].Estado_ValorActual := 0.0; + M_VF[4].Estado_AutoMan := FALSE; + M_VF[4].Estado_Activado := FALSE; + M_VF[4].Estado_Enclavado := FALSE; + M_VF[4].Estado_SeguridadOk := TRUE; + M_VF[4].Estado_EntradaTermico := FALSE; + M_VF[4].Estado_EntradaConfMarcha := FALSE; + M_VF[4].Estado_Salida := FALSE; + M_VF[4].Alarmas_Termico := FALSE; + M_VF[4].Alarmas_ConfirmacionMarcha := FALSE; + M_VF[4].Alarmas_Mantenimiento := FALSE; + M_VF[4].Alarmas_Escritura := FALSE; + M_VF[4].Alarmas_Parametros := FALSE; + M_VF[4].Alarmas_General := FALSE; + M_VF[4].Orden_ActivarManual := FALSE; + M_VF[4].Orden_ActivarAuto := FALSE; + M_VF[4].Orden_ResetHoras := FALSE; + M_VF[4].Config_Habilitar := FALSE; + M_VF[4].Config_HabilitarRetornoTermico := TRUE; + M_VF[4].Config_HabilitarInvertirTermico := FALSE; + M_VF[4].Config_HabilitarRetornoConfMarcha := TRUE; + M_VF[4].Config_HabilitarInvertirConfMarcha := FALSE; + M_VF[4].Config_HabilitarMantenimiento := FALSE; + M_VF[4].Config_HabilitarAlarmaEscrituraSalida := FALSE; + M_VF[4].Aux_oldActivado := FALSE; + M_VF[4].Aux_oldAlarma := FALSE; + M_VF[4].Aux_oldAutoMan := FALSE; + M_VF[4].Config_TipoAcceso := 0; + M_VF[4].Estado_Escritura := 16#0000; + M_VF[4].Estado_ValorTarjeta := 0; + M_VF[4].Config_GrupoAlarma := 0; + M_VF[4].Orden_ConsignaManual := 0.0; + M_VF[4].Orden_ConsignaAuto := 0.0; + M_VF[4].Config_DireccionSalidaByte := 0; + M_VF[4].Config_DireccionSalidaBit := 0; + M_VF[4].Config_DireccionRetTermicoByte := 0; + M_VF[4].Config_DireccionRetTermicoBit := 0; + M_VF[4].Config_DireccionRetConfMarchaByte := 0; + M_VF[4].Config_DireccionRetConfMarchaBit := 0; + M_VF[4].Config_DireccionSalidaAnalogicaByte := 0; + M_VF[4].Config_EscaladoMinIngenieria := 0.0; + M_VF[4].Config_EscaladoMaxIngenieria := 100.0; + M_VF[4].Tiempos_SetPointAlarma := 10; + M_VF[4].Tiempos_Alarma := 0; + M_VF[4].Tiempos_SetPointMantenimiento := 2000.0; + M_VF[4].Tiempos_Mantenimiento := 0.0; + M_VF[5].Hmi_Estado := 0; + M_VF[5].Estado_ValorActual := 0.0; + M_VF[5].Estado_AutoMan := FALSE; + M_VF[5].Estado_Activado := FALSE; + M_VF[5].Estado_Enclavado := FALSE; + M_VF[5].Estado_SeguridadOk := TRUE; + M_VF[5].Estado_EntradaTermico := FALSE; + M_VF[5].Estado_EntradaConfMarcha := FALSE; + M_VF[5].Estado_Salida := FALSE; + M_VF[5].Alarmas_Termico := FALSE; + M_VF[5].Alarmas_ConfirmacionMarcha := FALSE; + M_VF[5].Alarmas_Mantenimiento := FALSE; + M_VF[5].Alarmas_Escritura := FALSE; + M_VF[5].Alarmas_Parametros := FALSE; + M_VF[5].Alarmas_General := FALSE; + M_VF[5].Orden_ActivarManual := FALSE; + M_VF[5].Orden_ActivarAuto := FALSE; + M_VF[5].Orden_ResetHoras := FALSE; + M_VF[5].Config_Habilitar := FALSE; + M_VF[5].Config_HabilitarRetornoTermico := TRUE; + M_VF[5].Config_HabilitarInvertirTermico := FALSE; + M_VF[5].Config_HabilitarRetornoConfMarcha := TRUE; + M_VF[5].Config_HabilitarInvertirConfMarcha := FALSE; + M_VF[5].Config_HabilitarMantenimiento := FALSE; + M_VF[5].Config_HabilitarAlarmaEscrituraSalida := FALSE; + M_VF[5].Aux_oldActivado := FALSE; + M_VF[5].Aux_oldAlarma := FALSE; + M_VF[5].Aux_oldAutoMan := FALSE; + M_VF[5].Config_TipoAcceso := 0; + M_VF[5].Estado_Escritura := 16#0000; + M_VF[5].Estado_ValorTarjeta := 0; + M_VF[5].Config_GrupoAlarma := 0; + M_VF[5].Orden_ConsignaManual := 0.0; + M_VF[5].Orden_ConsignaAuto := 0.0; + M_VF[5].Config_DireccionSalidaByte := 0; + M_VF[5].Config_DireccionSalidaBit := 0; + M_VF[5].Config_DireccionRetTermicoByte := 0; + M_VF[5].Config_DireccionRetTermicoBit := 0; + M_VF[5].Config_DireccionRetConfMarchaByte := 0; + M_VF[5].Config_DireccionRetConfMarchaBit := 0; + M_VF[5].Config_DireccionSalidaAnalogicaByte := 0; + M_VF[5].Config_EscaladoMinIngenieria := 0.0; + M_VF[5].Config_EscaladoMaxIngenieria := 100.0; + M_VF[5].Tiempos_SetPointAlarma := 10; + M_VF[5].Tiempos_Alarma := 0; + M_VF[5].Tiempos_SetPointMantenimiento := 2000.0; + M_VF[5].Tiempos_Mantenimiento := 0.0; + Agrup[0].AlgunaEnManual := TRUE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 10; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7res b/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7res index 17b77db..e450682 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7res +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2016_M_VF.s7res @@ -7,3 +7,5 @@ es-ES: . - id: MLC_4u6 es-ES: NO SE USA + - id: MLC_vi + es-ES: B-201 diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2017_M_SINA.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2017_M_SINA.s7dcl index c3c2612..4383eac 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2017_M_SINA.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2017_M_SINA.s7dcl @@ -23,6 +23,8 @@ DATA_BLOCK DB2017_M_SINA NumDispositivos : Int; END_VAR + M_SINA[0].Hmi_Estado := 0; + M_SINA[0].Estado_ValorActual := 0.0; M_SINA[0].Estado_AutoMan := FALSE; M_SINA[0].Estado_Activado := FALSE; M_SINA[0].Estado_Enclavado := FALSE; @@ -64,8 +66,9 @@ DATA_BLOCK DB2017_M_SINA M_SINA[0].Tiempos_Mantenimiento := 0.0; { S7_MLC := "MLC_4j9" } M_SINA[0] := (); - Agrup[0].AlgunaEnManual := TRUE; + Agrup[0].AlgunaEnManual := FALSE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 0; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2025_TOT.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2025_TOT.s7dcl index 8763e99..9b37017 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2025_TOT.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2025_TOT.s7dcl @@ -27,16 +27,20 @@ DATA_BLOCK DB2025_TOT TOT[0].Estado_Pulso := FALSE; TOT[0].Estado_Valor := 0.0; TOT[0].Orden_Activar := FALSE; + TOT[0].Orden_Usuario := FALSE; TOT[0].Orden_ResetParcial := FALSE; TOT[0].Orden_ResetTotal := FALSE; TOT[0].Orden_ResetProceso := FALSE; + TOT[0].Orden_ResetUsuario := FALSE; TOT[0].Config_Habilitar := FALSE; TOT[0].Config_Tipo := FALSE; TOT[0].Config_IncrDecr := FALSE; TOT[0].Aux_oldActivado := FALSE; TOT[0].Aux_oldAlarma := FALSE; + TOT[0].Config_TipoAcceso := 0; TOT[0].Estado_DesbordeTotal := 0; TOT[0].Estado_DesbordeParcial := 0; + TOT[0].Estado_DesbordeUsuario := 0; TOT[0].Config_DireccionEntradaByte := 0; TOT[0].Config_DireccionEntradaBit := 0; TOT[0].Config_LitroXPulso := 0.0; @@ -44,13 +48,150 @@ DATA_BLOCK DB2025_TOT TOT[0].Estado_Total := 0.0; TOT[0].Estado_Parcial := 0.0; TOT[0].Estado_Proceso := 0.0; + TOT[0].Estado_Usuario := 0.0; TOT[0].Aux_TotalizadorMem := 0.0; { S7_MLC := "MLC_54a" } TOT[0] := (); - TiempoCiclo.Actual := 28.50767; + TOT[1].Hmi_Estado := 0; + TOT[1].Estado_Pulso := FALSE; + TOT[1].Estado_Valor := 0.0; + TOT[1].Orden_Activar := TRUE; + TOT[1].Orden_Usuario := FALSE; + TOT[1].Orden_ResetParcial := FALSE; + TOT[1].Orden_ResetTotal := FALSE; + TOT[1].Orden_ResetProceso := FALSE; + TOT[1].Orden_ResetUsuario := FALSE; + TOT[1].Config_Habilitar := TRUE; + TOT[1].Config_Tipo := FALSE; + TOT[1].Config_IncrDecr := FALSE; + TOT[1].Aux_oldActivado := FALSE; + TOT[1].Aux_oldAlarma := FALSE; + TOT[1].Config_TipoAcceso := 0; + TOT[1].Estado_DesbordeTotal := 0; + TOT[1].Estado_DesbordeParcial := 0; + TOT[1].Estado_DesbordeUsuario := 0; + TOT[1].Config_DireccionEntradaByte := 201; + TOT[1].Config_DireccionEntradaBit := 5; + TOT[1].Config_LitroXPulso := 1.0; + TOT[1].Aux_AcuTiempo := 9.0; + TOT[1].Estado_Total := 2125.0; + TOT[1].Estado_Parcial := 2125.0; + TOT[1].Estado_Proceso := 2125.0; + TOT[1].Estado_Usuario := 0.0; + TOT[1].Aux_TotalizadorMem := 2125.0; + TOT[2].Hmi_Estado := 0; + TOT[2].Estado_Pulso := FALSE; + TOT[2].Estado_Valor := 0.0; + TOT[2].Orden_Activar := FALSE; + TOT[2].Orden_Usuario := FALSE; + TOT[2].Orden_ResetParcial := FALSE; + TOT[2].Orden_ResetTotal := FALSE; + TOT[2].Orden_ResetProceso := FALSE; + TOT[2].Orden_ResetUsuario := FALSE; + TOT[2].Config_Habilitar := FALSE; + TOT[2].Config_Tipo := FALSE; + TOT[2].Config_IncrDecr := FALSE; + TOT[2].Aux_oldActivado := FALSE; + TOT[2].Aux_oldAlarma := FALSE; + TOT[2].Config_TipoAcceso := 0; + TOT[2].Estado_DesbordeTotal := 0; + TOT[2].Estado_DesbordeParcial := 0; + TOT[2].Estado_DesbordeUsuario := 0; + TOT[2].Config_DireccionEntradaByte := 0; + TOT[2].Config_DireccionEntradaBit := 0; + TOT[2].Config_LitroXPulso := 0.0; + TOT[2].Aux_AcuTiempo := 0.0; + TOT[2].Estado_Total := 0.0; + TOT[2].Estado_Parcial := 0.0; + TOT[2].Estado_Proceso := 0.0; + TOT[2].Estado_Usuario := 0.0; + TOT[2].Aux_TotalizadorMem := 0.0; + TOT[3].Hmi_Estado := 0; + TOT[3].Estado_Pulso := FALSE; + TOT[3].Estado_Valor := 0.0; + TOT[3].Orden_Activar := FALSE; + TOT[3].Orden_Usuario := FALSE; + TOT[3].Orden_ResetParcial := FALSE; + TOT[3].Orden_ResetTotal := FALSE; + TOT[3].Orden_ResetProceso := FALSE; + TOT[3].Orden_ResetUsuario := FALSE; + TOT[3].Config_Habilitar := FALSE; + TOT[3].Config_Tipo := FALSE; + TOT[3].Config_IncrDecr := FALSE; + TOT[3].Aux_oldActivado := FALSE; + TOT[3].Aux_oldAlarma := FALSE; + TOT[3].Config_TipoAcceso := 0; + TOT[3].Estado_DesbordeTotal := 0; + TOT[3].Estado_DesbordeParcial := 0; + TOT[3].Estado_DesbordeUsuario := 0; + TOT[3].Config_DireccionEntradaByte := 0; + TOT[3].Config_DireccionEntradaBit := 0; + TOT[3].Config_LitroXPulso := 0.0; + TOT[3].Aux_AcuTiempo := 0.0; + TOT[3].Estado_Total := 0.0; + TOT[3].Estado_Parcial := 0.0; + TOT[3].Estado_Proceso := 0.0; + TOT[3].Estado_Usuario := 0.0; + TOT[3].Aux_TotalizadorMem := 0.0; + TOT[4].Hmi_Estado := 0; + TOT[4].Estado_Pulso := FALSE; + TOT[4].Estado_Valor := 0.0; + TOT[4].Orden_Activar := FALSE; + TOT[4].Orden_Usuario := FALSE; + TOT[4].Orden_ResetParcial := FALSE; + TOT[4].Orden_ResetTotal := FALSE; + TOT[4].Orden_ResetProceso := FALSE; + TOT[4].Orden_ResetUsuario := FALSE; + TOT[4].Config_Habilitar := FALSE; + TOT[4].Config_Tipo := FALSE; + TOT[4].Config_IncrDecr := FALSE; + TOT[4].Aux_oldActivado := FALSE; + TOT[4].Aux_oldAlarma := FALSE; + TOT[4].Config_TipoAcceso := 0; + TOT[4].Estado_DesbordeTotal := 0; + TOT[4].Estado_DesbordeParcial := 0; + TOT[4].Estado_DesbordeUsuario := 0; + TOT[4].Config_DireccionEntradaByte := 0; + TOT[4].Config_DireccionEntradaBit := 0; + TOT[4].Config_LitroXPulso := 0.0; + TOT[4].Aux_AcuTiempo := 0.0; + TOT[4].Estado_Total := 0.0; + TOT[4].Estado_Parcial := 0.0; + TOT[4].Estado_Proceso := 0.0; + TOT[4].Estado_Usuario := 0.0; + TOT[4].Aux_TotalizadorMem := 0.0; + TOT[5].Hmi_Estado := 0; + TOT[5].Estado_Pulso := FALSE; + TOT[5].Estado_Valor := 0.0; + TOT[5].Orden_Activar := FALSE; + TOT[5].Orden_Usuario := FALSE; + TOT[5].Orden_ResetParcial := FALSE; + TOT[5].Orden_ResetTotal := FALSE; + TOT[5].Orden_ResetProceso := FALSE; + TOT[5].Orden_ResetUsuario := FALSE; + TOT[5].Config_Habilitar := FALSE; + TOT[5].Config_Tipo := FALSE; + TOT[5].Config_IncrDecr := FALSE; + TOT[5].Aux_oldActivado := FALSE; + TOT[5].Aux_oldAlarma := FALSE; + TOT[5].Config_TipoAcceso := 0; + TOT[5].Estado_DesbordeTotal := 0; + TOT[5].Estado_DesbordeParcial := 0; + TOT[5].Estado_DesbordeUsuario := 0; + TOT[5].Config_DireccionEntradaByte := 0; + TOT[5].Config_DireccionEntradaBit := 0; + TOT[5].Config_LitroXPulso := 0.0; + TOT[5].Aux_AcuTiempo := 0.0; + TOT[5].Estado_Total := 0.0; + TOT[5].Estado_Parcial := 0.0; + TOT[5].Estado_Proceso := 0.0; + TOT[5].Estado_Usuario := 0.0; + TOT[5].Aux_TotalizadorMem := 0.0; + TiempoCiclo.Actual := 2.049256; TiempoCiclo."Min" := 150.0; TiempoCiclo."Max" := 0.0; - TiempoCiclo.auxMem := 3.12728198846045E-308; + TiempoCiclo.auxMem := 16#0000_1CBA_AF5D_83D8; TiempoCiclo.Reset := FALSE; + NumDispositivos := 10; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2026_FF.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2026_FF.s7dcl index 78bee29..b52b87e 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2026_FF.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2026_FF.s7dcl @@ -13,4 +13,18 @@ DATA_BLOCK DB2026_FF { S7_Setpoint := "False" } FF : Array[0.._.N_MAX_DISP_FF] of _.UDT_ZC_DISP_FF; END_VAR + + FF[0].Estado_Flip := FALSE; + FF[0].Estado_Flop := FALSE; + FF[0].Estado_Paro1 := FALSE; + FF[0].Estado_Paro2 := FALSE; + FF[0].Orden_Activar := FALSE; + FF[0].Orden_Pausa := FALSE; + FF[0].Aux_Inicializado := FALSE; + FF[0].Estado_Etapa := 0; + FF[0].Config_SetPointTiempoFlip := 0; + FF[0].Config_SetPointTiempoFlop := 0; + FF[0].Config_SetPointTiempoParo := 0; + FF[0].Aux_Tiempo := 0; + END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2027_FF_SEC.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2027_FF_SEC.s7dcl index 6aa1848..0cdc4c5 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2027_FF_SEC.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2027_FF_SEC.s7dcl @@ -13,4 +13,35 @@ DATA_BLOCK DB2027_FF_SEC { S7_Setpoint := "False" } FF_SEC : Array[0.._.N_MAX_DISP_FF_SEC] of _.UDT_ZC_DISP_FF_SEC; END_VAR + + FF_SEC[0].Estado_SalidaFlip[1] := FALSE; + FF_SEC[0].Estado_SalidaFlip[2] := FALSE; + FF_SEC[0].Estado_SalidaFlip[3] := FALSE; + FF_SEC[0].Estado_SalidaFlip[4] := FALSE; + FF_SEC[0].Estado_SalidaFlip[5] := FALSE; + FF_SEC[0].Estado_SalidaFlip[6] := FALSE; + FF_SEC[0].Estado_SalidaFlip[7] := FALSE; + FF_SEC[0].Estado_SalidaFlip[8] := FALSE; + FF_SEC[0].Estado_SalidaFlip[9] := FALSE; + FF_SEC[0].Estado_SalidaFlip[10] := FALSE; + FF_SEC[0].Estado_SalidaFlop := FALSE; + FF_SEC[0].Orden_Reset := FALSE; + FF_SEC[0].Orden_Activar := FALSE; + FF_SEC[0].Orden_Pausa := FALSE; + FF_SEC[0].Aux_Inicializacion := FALSE; + FF_SEC[0].Config_SetPointTiempoFlip[1] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[2] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[3] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[4] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[5] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[6] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[7] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[8] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[9] := 0; + FF_SEC[0].Config_SetPointTiempoFlip[10] := 0; + FF_SEC[0].Config_SetPointTiempoFlop := 20; + FF_SEC[0].Estado_Etapa := 0; + FF_SEC[0].Aux_Tiempo := 0; + FF_SEC[0].Aux_FlipActual := 0; + END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2028_TEMP.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2028_TEMP.s7dcl index 3ab6a62..256054e 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2028_TEMP.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2028_TEMP.s7dcl @@ -31,4 +31,126 @@ DATA_BLOCK DB2028_TEMP } TP : Array[0.._.N_MAX_DISP_TP] of _.UDT_ZC_DISP_TP; END_VAR + + TON[0].SP := 5; + TON[0].ET := 0; + TON[0].IN := FALSE; + TON[0].Q := FALSE; + TON[1].SP := 5; + TON[1].ET := 0; + TON[1].IN := FALSE; + TON[1].Q := FALSE; + TON[2].SP := 5; + TON[2].ET := 0; + TON[2].IN := FALSE; + TON[2].Q := FALSE; + TON[3].SP := 5; + TON[3].ET := 0; + TON[3].IN := FALSE; + TON[3].Q := FALSE; + TON[4].SP := 5; + TON[4].ET := 0; + TON[4].IN := FALSE; + TON[4].Q := FALSE; + TON[5].SP := 5; + TON[5].ET := 0; + TON[5].IN := FALSE; + TON[5].Q := FALSE; + TOF[0].SP := 5; + TOF[0].ET := 0; + TOF[0].IN := FALSE; + TOF[0].Q := FALSE; + TOF[0].OldActivar := FALSE; + TOF[1].SP := 5; + TOF[1].ET := 5; + TOF[1].IN := FALSE; + TOF[1].Q := FALSE; + TOF[1].OldActivar := FALSE; + TOF[2].SP := 5; + TOF[2].ET := 5; + TOF[2].IN := FALSE; + TOF[2].Q := FALSE; + TOF[2].OldActivar := FALSE; + TOF[3].SP := 5; + TOF[3].ET := 5; + TOF[3].IN := FALSE; + TOF[3].Q := FALSE; + TOF[3].OldActivar := FALSE; + TOF[4].SP := 5; + TOF[4].ET := 5; + TOF[4].IN := FALSE; + TOF[4].Q := FALSE; + TOF[4].OldActivar := FALSE; + TOF[5].SP := 5; + TOF[5].ET := 5; + TOF[5].IN := FALSE; + TOF[5].Q := FALSE; + TOF[5].OldActivar := FALSE; + TONR[0].SP := 5; + TONR[0].ET := 0; + TONR[0].RT := 0; + TONR[0].IN := FALSE; + TONR[0].Q := FALSE; + TONR[0].RESET := FALSE; + TONR[1].SP := 5; + TONR[1].ET := 0; + TONR[1].RT := 5; + TONR[1].IN := FALSE; + TONR[1].Q := FALSE; + TONR[1].RESET := FALSE; + TONR[2].SP := 5; + TONR[2].ET := 0; + TONR[2].RT := 5; + TONR[2].IN := FALSE; + TONR[2].Q := FALSE; + TONR[2].RESET := FALSE; + TONR[3].SP := 5; + TONR[3].ET := 0; + TONR[3].RT := 5; + TONR[3].IN := FALSE; + TONR[3].Q := FALSE; + TONR[3].RESET := FALSE; + TONR[4].SP := 5; + TONR[4].ET := 0; + TONR[4].RT := 5; + TONR[4].IN := FALSE; + TONR[4].Q := FALSE; + TONR[4].RESET := FALSE; + TONR[5].SP := 5; + TONR[5].ET := 0; + TONR[5].RT := 5; + TONR[5].IN := FALSE; + TONR[5].Q := FALSE; + TONR[5].RESET := FALSE; + TP[0].PT := 5; + TP[0].ET := 0; + TP[0].IN := FALSE; + TP[0].Q := FALSE; + TP[0].oldIN := FALSE; + TP[1].PT := 5; + TP[1].ET := 0; + TP[1].IN := FALSE; + TP[1].Q := FALSE; + TP[1].oldIN := FALSE; + TP[2].PT := 5; + TP[2].ET := 0; + TP[2].IN := FALSE; + TP[2].Q := FALSE; + TP[2].oldIN := FALSE; + TP[3].PT := 5; + TP[3].ET := 0; + TP[3].IN := FALSE; + TP[3].Q := FALSE; + TP[3].oldIN := FALSE; + TP[4].PT := 5; + TP[4].ET := 0; + TP[4].IN := FALSE; + TP[4].Q := FALSE; + TP[4].oldIN := FALSE; + TP[5].PT := 5; + TP[5].ET := 0; + TP[5].IN := FALSE; + TP[5].Q := FALSE; + TP[5].oldIN := FALSE; + END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2035_PID.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2035_PID.s7dcl index c4cc212..0bab8e8 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2035_PID.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2035_PID.s7dcl @@ -22,6 +22,7 @@ DATA_BLOCK DB2035_PID NumDispositivos : Int; END_VAR + "PID"[0].Hmi_Estado := 0; "PID"[0].Estado_AutoMan := TRUE; "PID"[0].Estado_ModeActivate := FALSE; "PID"[0].Orden_Forzar := FALSE; @@ -60,5 +61,6 @@ DATA_BLOCK DB2035_PID Agrup[0].AlgunaEnManual := TRUE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 0; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2037_MEDIA.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2037_MEDIA.s7dcl index b8b6b6a..f3f791b 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2037_MEDIA.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2037_MEDIA.s7dcl @@ -12,4 +12,17 @@ DATA_BLOCK DB2037_MEDIA { S7_Setpoint := "False" } MEDIA : Array[0.._.N_MAX_DISP_MEDIA] of _.UDT_ZC_DISP_MEDIA; END_VAR + + MEDIA[0].IniciarMedia := FALSE; + MEDIA[0].Inicializar := FALSE; + MEDIA[0].auxInicializar := FALSE; + MEDIA[0].TiempoMuestreo := 0; + MEDIA[0].auxTiempo := 0; + MEDIA[0].auxIndice := 0; + MEDIA[0].auxAcumulado := 0.0; + MEDIA[0].Media := 0.0; + MEDIA[0].ValorActual := 0.0; + MEDIA[0].ValorMinimo := 0.0; + MEDIA[0].ValorMaximo := 0.0; + END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2038_MEDIA_VOL.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2038_MEDIA_VOL.s7dcl index 88e54f5..5d22af5 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2038_MEDIA_VOL.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2038_MEDIA_VOL.s7dcl @@ -12,4 +12,19 @@ DATA_BLOCK DB2038_MEDIA_VOL { S7_Setpoint := "False" } MEDIA_VOL : Array[0.._.N_MAX_DISP_MEDIA_VOLUMEN] of _.UDT_ZC_DISP_MEDIA_VOLUMEN; END_VAR + + MEDIA_VOL[0].IniciarMedia := FALSE; + MEDIA_VOL[0].Inicializar := FALSE; + MEDIA_VOL[0].auxInicializar := FALSE; + MEDIA_VOL[0].TiempoMuestreo := 0; + MEDIA_VOL[0].auxTiempo := 0; + MEDIA_VOL[0].auxValorMedia := 0.0; + MEDIA_VOL[0].auxAcumulado := 0.0; + MEDIA_VOL[0].auxVolumen := 0.0; + MEDIA_VOL[0].Media := 0.0; + MEDIA_VOL[0].ValorActual := 0.0; + MEDIA_VOL[0].Volumen := 0.0; + MEDIA_VOL[0].ValorMinimo := 0.0; + MEDIA_VOL[0].ValorMaximo := 0.0; + END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2040_TQ.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2040_TQ.s7dcl index b289273..45c0b38 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2040_TQ.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2040_TQ.s7dcl @@ -23,11 +23,112 @@ DATA_BLOCK DB2040_TQ NumDispositivos : Int; END_VAR + TQ[0].Hmi_Estado := 0; + TQ[0].Estado_AutoMan := FALSE; + TQ[0].Estado_TanqueVacio := FALSE; + TQ[0].Estado_TanqueLleno := FALSE; + TQ[0].Estado_PocisionAltura := FALSE; + TQ[0].Estado_NivelBajo := FALSE; + TQ[0].Estado_NivelAlto := FALSE; + TQ[0].Estado_BocaHombre := FALSE; + TQ[0].Estado_Mezcla := FALSE; + TQ[0].Alarmas_NivelBajo := FALSE; + TQ[0].Alarmas_NivelAlto := FALSE; + TQ[0].Alarmas_BocaHombre := FALSE; + TQ[0].Alarmas_General := FALSE; + TQ[0].Alarmas_Capacidad := FALSE; + TQ[0].Orden_Temperatura := FALSE; + TQ[0].Orden_Agitacion := FALSE; + TQ[0].Orden_CIP := FALSE; + TQ[0].Orden_Producto := FALSE; + TQ[0].Orden_CambioEstado := FALSE; + TQ[0].Orden_CambioProd1 := FALSE; + TQ[0].Orden_CambioProd2 := FALSE; + TQ[0].Config_Habilitar := FALSE; TQ[0].Config_HabilitarControlTemp := TRUE; TQ[0].Config_HabilitarAgitador := TRUE; + TQ[0].Config_HabilitarFrecuenciaAgitacion := TRUE; + TQ[0].Config_HabilitarAlarmas := FALSE; + TQ[0].Config_HabilitarCalculoVol := FALSE; + TQ[0].Config_TipoControlTemperatura := FALSE; + TQ[0].Vis_ConsignaTemperatura := FALSE; + TQ[0].Aux_MemOrdenAgitador := FALSE; + TQ[0].Aux_MemOrdenTemperatura := FALSE; + TQ[0].Aux_MemOrdenProducto := FALSE; + TQ[0].Aux_MemEstadoCIP := FALSE; + TQ[0].Aux_CipOK := FALSE; + TQ[0].Orden_ParoControlAgitador := FALSE; + TQ[0].Orden_ParoControlTemp := FALSE; + TQ[0].R_Bool_6 := FALSE; + TQ[0].R_Bool_8 := FALSE; + TQ[0].Config_GrupoAlarma := 0; + TQ[0].Estado_Tanque := 0; + TQ[0].Estado_TanqueNuevo := 0; + TQ[0].Estado_Producto1 := 0; + TQ[0].Estado_Producto2 := 0; + TQ[0].Estado_ProductoNuevo := 0; + TQ[0].Estado_ValorNivelPresion := 0.0; + TQ[0].Estado_ValorTemperatura := 0.0; + TQ[0].Estado_Volumen := 0.0; + TQ[0].Estado_Presion := 0.0; + TQ[0].Estado_Altura := 0.0; + TQ[0].Orden_TipoProducto := 0; + TQ[0].Orden_ConsignaAgitador := 0.0; + TQ[0].Orden_ConsignaManualVolumen := 0.0; + TQ[0].Config_TipoAgitacionTiempo := 0; + TQ[0].Config_TipoAgitacionVelocidad := 0; + TQ[0].Config_ConsignaTemperatura := 0.0; + TQ[0].Config_HisteresisTemperatura := 0.0; + TQ[0].Config_VolumenMinControlTemp := 0.0; + TQ[0].Config_VolumenMaxControlTemp := 0.0; + TQ[0].Config_VolumenMinControlAgitador := 0.0; + TQ[0].Config_VolumenMaxControlAgitador := 0.0; + TQ[0].Config_VolumenTanqueVacio := 0.0; + TQ[0].Config_VolumenTanqueLleno := 0.0; + TQ[0].Config_VelocidadMinAgitador := 0.0; + TQ[0].Config_VelocidadMaxAgitador := 0.0; + TQ[0].Config_VelocidadFijaAgitador := 0.0; + TQ[0].Config_CapacidadTanque := 0.0; + TQ[0].Config_DiametroCilindro := 0.0; + TQ[0].Config_AlturaCilindro := 0.0; + TQ[0].Config_DiametroConoInferior := 0.0; + TQ[0].Config_AnguloCono := 0.0; + TQ[0].Config_AlturaCono := 0.0; + TQ[0].Tiempo_AgitadorONConsigna := 0; + TQ[0].Tiempo_AgitadorONActual := 0; + TQ[0].Tiempo_AgitadorOFFConsigna := 0; + TQ[0].Tiempo_AgitadorOFFActual := 0; + TQ[0].Tiempo_TiempoProducto.Hora := 0; + TQ[0].Tiempo_TiempoProducto.Minuto := 0; + TQ[0].Tiempo_TiempoProducto.Segundo := 0; + TQ[0].Tiempo_TiempoLimpio.Hora := 0; + TQ[0].Tiempo_TiempoLimpio.Minuto := 0; + TQ[0].Tiempo_TiempoLimpio.Segundo := 0; TQ[0].Tiempo_RetTanqueVacio.SP := 5; + TQ[0].Tiempo_RetTanqueVacio.ET := 0; + TQ[0].Tiempo_RetTanqueVacio.IN := FALSE; + TQ[0].Tiempo_RetTanqueVacio.Q := FALSE; + TQ[0].Tiempo_RetTanqueLleno.SP := 5; + TQ[0].Tiempo_RetTanqueLleno.ET := 0; + TQ[0].Tiempo_RetTanqueLleno.IN := FALSE; + TQ[0].Tiempo_RetTanqueLleno.Q := FALSE; + TQ[0].FlipAgitador.Estado_Flip := FALSE; + TQ[0].FlipAgitador.Estado_Flop := FALSE; + TQ[0].FlipAgitador.Estado_Paro1 := FALSE; + TQ[0].FlipAgitador.Estado_Paro2 := FALSE; + TQ[0].FlipAgitador.Orden_Activar := FALSE; + TQ[0].FlipAgitador.Orden_Pausa := FALSE; + TQ[0].FlipAgitador.Aux_Inicializado := FALSE; + TQ[0].FlipAgitador.Estado_Etapa := 0; + TQ[0].FlipAgitador.Config_SetPointTiempoFlip := 0; + TQ[0].FlipAgitador.Config_SetPointTiempoFlop := 0; + TQ[0].FlipAgitador.Config_SetPointTiempoParo := 0; + TQ[0].FlipAgitador.Aux_Tiempo := 0; { S7_MLC := "MLC_3Un" } TQ[0] := (); Agrup[0].AlgunaEnManual := FALSE; + Agrup[0].AlgunaAlarma := FALSE; + Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 0; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/2000_Dispositivos/DB2041_TQ_AE.s7dcl b/PLC/Bloques de programa/2000_Dispositivos/DB2041_TQ_AE.s7dcl index c6dd900..a1b0f30 100644 --- a/PLC/Bloques de programa/2000_Dispositivos/DB2041_TQ_AE.s7dcl +++ b/PLC/Bloques de programa/2000_Dispositivos/DB2041_TQ_AE.s7dcl @@ -22,6 +22,7 @@ DATA_BLOCK DB2041_TQ_AE NumDispositivos : Int; END_VAR + TQ_AE[0].Hmi_Estado := 0; TQ_AE[0].Estado_AutoMan := FALSE; TQ_AE[0].Orden_Manual := FALSE; TQ_AE[0].Orden_CIP := FALSE; @@ -58,8 +59,9 @@ DATA_BLOCK DB2041_TQ_AE TQ_AE[0].Tiempos_DuchaTiempoFlop := 0; { S7_MLC := "MLC_55Q" } TQ_AE[0] := (); - Agrup[0].AlgunaEnManual := TRUE; + Agrup[0].AlgunaEnManual := FALSE; Agrup[0].AlgunaAlarma := FALSE; Agrup[0].NuevaAlarma := FALSE; + NumDispositivos := 0; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/9_Gestor_Dispositivos/FC9_DISPOSITIVOS.s7dcl b/PLC/Bloques de programa/9_Gestor_Dispositivos/FC9_DISPOSITIVOS.s7dcl index a75b812..b59a3d5 100644 --- a/PLC/Bloques de programa/9_Gestor_Dispositivos/FC9_DISPOSITIVOS.s7dcl +++ b/PLC/Bloques de programa/9_Gestor_Dispositivos/FC9_DISPOSITIVOS.s7dcl @@ -99,7 +99,6 @@ FUNCTION "FC9_DISPOSITIVOS" : Void // Entrada Analogica // Traspaso de valores de entradas a los dispositivos configurados con tipo de acceso directo. // Ejemplo: "DB2001_EA".EA[TAG].Estado_Lectura := %IW100.0; - END_NETWORK { S7_Language := "SCL"; diff --git a/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7dcl b/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7dcl index 2940502..989b581 100644 --- a/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7dcl +++ b/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7dcl @@ -1,8 +1,7 @@ { S7_Author := "ABH"; - S7_BlockNumber := "51"; + S7_BlockNumber := "55"; S7_Family := "ZeusControl"; - S7_IECCheck := "TRUE"; S7_Optimized := "TRUE"; S7_PreferredLanguage := "LAD"; S7_Version := "1.0" @@ -14,6 +13,20 @@ FUNCTION "FC55_PROGRAMA_USUARIO" : Void } NETWORK + END_NETWORK + { + S7_Language := "SCL"; + S7_NetworkTitle := "MLC_43V" + } + NETWORK + + // ========================================================================================================== + // Identificador de red profinet + // Ejemplo: "DB1_SYS".RedProfinet.Identificador := "Local~PROFINET_IO-System"; + + // Seguridades Ok generales (dispositivos) + // Ejemplo: "DB1_SYS".SegOkGenerales := NOT "DB5000_GNR_ALM".ALM[1].Out; + END_NETWORK { S7_Language := "SCL"; @@ -21,6 +34,11 @@ FUNCTION "FC55_PROGRAMA_USUARIO" : Void } NETWORK + // ========================================================================================================== + // Llamadas a procesos + + + END_NETWORK { S7_Language := "SCL"; @@ -28,5 +46,9 @@ FUNCTION "FC55_PROGRAMA_USUARIO" : Void } NETWORK + // ========================================================================================================== + // Llamadas a otros bloques + + END_NETWORK END_FUNCTION diff --git a/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7res b/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7res index e101ff6..83b9903 100644 --- a/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7res +++ b/PLC/Bloques de programa/FC55_PROGRAMA_USUARIO.s7res @@ -1,6 +1,8 @@ MultiLingualTexts: - id: MLC_3ZS es-ES: DESCRIPCION + - id: MLC_43V + es-ES: MARCAS GENERALES - id: MLC_zw es-ES: LLAMADAS A PROCESOS - id: MLC_h6 diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB100_Startup.s7dcl b/PLC/Bloques de programa/OB/OB100_Startup.s7dcl similarity index 63% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB100_Startup.s7dcl rename to PLC/Bloques de programa/OB/OB100_Startup.s7dcl index f9ef9b9..c3d3825 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB100_Startup.s7dcl +++ b/PLC/Bloques de programa/OB/OB100_Startup.s7dcl @@ -5,4 +5,9 @@ S7_Version := "0.1" } ORGANIZATION_BLOCK "OB100_Startup" + { S7_Language := "LAD" } + NETWORK + RUNG wire#powerrail + END_RUNG + END_NETWORK END_ORGANIZATION_BLOCK diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB121_ProgrammingError.s7dcl b/PLC/Bloques de programa/OB/OB121_ProgrammingError.s7dcl similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB121_ProgrammingError.s7dcl rename to PLC/Bloques de programa/OB/OB121_ProgrammingError.s7dcl diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB122_IO_AccessError.s7dcl b/PLC/Bloques de programa/OB/OB122_IO_AccessError.s7dcl similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB122_IO_AccessError.s7dcl rename to PLC/Bloques de programa/OB/OB122_IO_AccessError.s7dcl diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB40_HardwareInterrupt.s7dcl b/PLC/Bloques de programa/OB/OB40_HardwareInterrupt.s7dcl similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB40_HardwareInterrupt.s7dcl rename to PLC/Bloques de programa/OB/OB40_HardwareInterrupt.s7dcl diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB80_TimeErrorInterrupt.s7dcl b/PLC/Bloques de programa/OB/OB80_TimeErrorInterrupt.s7dcl similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB80_TimeErrorInterrupt.s7dcl rename to PLC/Bloques de programa/OB/OB80_TimeErrorInterrupt.s7dcl diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB83_PullOrPlugOfModules.s7dcl b/PLC/Bloques de programa/OB/OB83_PullOrPlugOfModules.s7dcl similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB83_PullOrPlugOfModules.s7dcl rename to PLC/Bloques de programa/OB/OB83_PullOrPlugOfModules.s7dcl diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB86_RackOrStationFailure.s7dcl b/PLC/Bloques de programa/OB/OB86_RackOrStationFailure.s7dcl similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_DiagnosticoHardware/OB86_RackOrStationFailure.s7dcl rename to PLC/Bloques de programa/OB/OB86_RackOrStationFailure.s7dcl diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/OB1_MAIN.s7dcl b/PLC/Bloques de programa/OB1_MAIN.s7dcl similarity index 76% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/OB1_MAIN.s7dcl rename to PLC/Bloques de programa/OB1_MAIN.s7dcl index cb10450..3470c6b 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/OB1_MAIN.s7dcl +++ b/PLC/Bloques de programa/OB1_MAIN.s7dcl @@ -8,6 +8,7 @@ ORGANIZATION_BLOCK "OB1_MAIN" VAR_TEMP for_i : Int; + t_HW_IOSYSTEM : HW_IOSYSTEM; END_VAR { @@ -18,9 +19,7 @@ ORGANIZATION_BLOCK "OB1_MAIN" RUNG wire#powerrail "FC50_MAIN"( CPU_MarcasCiclo := "Clock_Byte", - CPU_MarcasSistema := "System_Byte", - RedProfinet := "Local~PROFINET_IO-System", - SegGeneralDisp := TRUE + CPU_MarcasSistema := "System_Byte" ) END_RUNG END_NETWORK diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/OB1_MAIN.s7res b/PLC/Bloques de programa/OB1_MAIN.s7res similarity index 100% rename from PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/OB1_MAIN.s7res rename to PLC/Bloques de programa/OB1_MAIN.s7res diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7dcl index c935023..f807277 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7dcl @@ -18,6 +18,8 @@ DATA_BLOCK DB1_SYS ACK : Bool; { S7_MLC := "MLC_52i" } ARRANQUE : Bool; + { S7_MLC := "MLC_4s3" } + SegOkGenerales : Bool; { S7_MLC := "MLC_3vb" } Pulso100ms : Bool; { S7_MLC := "MLC_4uy" } @@ -88,7 +90,12 @@ DATA_BLOCK DB1_SYS END_VAR VAR - RedProfinet : Array[0..1023] of Bool; + { S7_MLC := "MLC_38Q" } + RedProfinet : STRUCT + { S7_MLC := "MLC_4XV" } + Identificador : HW_IOSYSTEM; + Status : Array[0..1023] of Bool; + END_STRUCT; END_VAR VAR RETAIN diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7res index e5f9fe0..246b972 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/DB1_SYS.s7res @@ -11,6 +11,8 @@ es-ES: Acuse general de errores - id: MLC_52i es-ES: Marca de primer arranque del sistema + - id: MLC_4s3 + es-ES: Seguridades Ok Generales - id: MLC_3vb es-ES: Pulso 100 ms - id: MLC_4uy @@ -91,6 +93,10 @@ es-ES: '-' - id: MLC_3JT es-ES: Usuario actual + - id: MLC_38Q + es-ES: Estado de red profinet + - id: MLC_4XV + es-ES: Identificador - id: MLC_45G es-ES: P_TRIG Pulso 100 ms - id: MLC_3zd diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7dcl index 19d6ae6..86ca1c9 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7dcl @@ -14,8 +14,6 @@ FUNCTION "FC1_ZC_SISTEMA" : Void CPU_MarcasCiclo : Byte; { S7_MLC := "MLC_4Mc" } CPU_MarcasSistema : Byte; - { S7_MLC := "MLC_3B7" } - RedProfinet : HW_IOSYSTEM; END_VAR VAR_TEMP { S7_MLC := "MLC_3bT" } @@ -423,7 +421,7 @@ FUNCTION "FC1_ZC_SISTEMA" : Void REGION RED_PROFINET // Comprobacion de red profinet - #t_RetVal := DeviceStates(LADDR := #RedProfinet, MODE := 4, STATE := "DB1_SYS".RedProfinet); + #t_RetVal := DeviceStates(LADDR := "DB1_SYS".RedProfinet.Identificador, MODE := 4, STATE := "DB1_SYS".RedProfinet.Status); END_REGION RED_PROFINET diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7res index f810b36..6362d76 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Datos/FC1_ZC_SISTEMA.s7res @@ -7,8 +7,6 @@ es-ES: Byte Marca de ciclo CPU - id: MLC_4Mc es-ES: Byte Marcas de sistema - - id: MLC_3B7 - es-ES: ID Profinet IO System - id: MLC_3bT es-ES: Variable para bucles FOR - id: MLC_4GP diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7dcl index 361e02d..dfb4915 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7dcl @@ -11,10 +11,6 @@ FUNCTION "FC50_MAIN" : Void CPU_MarcasCiclo : Byte; { S7_MLC := "MLC_3Se" } CPU_MarcasSistema : Byte; - { S7_MLC := "MLC_4gv" } - RedProfinet : HW_IOSYSTEM; - { S7_MLC := "MLC_45H" } - SegGeneralDisp : Bool; END_VAR { S7_Language := "SCL" } @@ -70,8 +66,7 @@ FUNCTION "FC50_MAIN" : Void // Llamada a marcas de sistema "FC1_ZC_SISTEMA"(CPU_MarcasCiclo := "Clock_Byte", - CPU_MarcasSistema := "System_Byte", - RedProfinet := "Local~PROFINET_IO-System"); + CPU_MarcasSistema := "System_Byte"); // Llamada a utilizades "DB15994_ZC_INICIALIZAR_DISP"(); @@ -110,8 +105,7 @@ FUNCTION "FC50_MAIN" : Void END_REGION LLAMADA_GESTOR_DISPOSITIVOS - - // ========================================================================================================== + // ========================================================================================================== REGION LLAMADA_ED // Gestion multiplexado @@ -139,6 +133,7 @@ FUNCTION "FC50_MAIN" : Void Ack := "DB1_SYS".ACK, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); + END_REGION LLAMADA_EA @@ -153,7 +148,7 @@ FUNCTION "FC50_MAIN" : Void Simulacion := "DB1_SYS".SIM, Arranque := "DB1_SYS".ARRANQUE, Ack := "DB1_SYS".ACK, - SeguridadesOK := #SegGeneralDisp, + SeguridadesOK := "DB1_SYS".SegOkGenerales, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); @@ -168,7 +163,7 @@ FUNCTION "FC50_MAIN" : Void // Gestion dispositivo "FC2006_ZC_SA"(Ack := "DB1_SYS".ACK, - SeguridadesOK := #SegGeneralDisp, + SeguridadesOK := "DB1_SYS".SegOkGenerales, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); @@ -187,7 +182,7 @@ FUNCTION "FC50_MAIN" : Void Simulacion := "DB1_SYS".SIM, Arranque := "DB1_SYS".ARRANQUE, Ack := "DB1_SYS".ACK, - SeguridadesOK := #SegGeneralDisp, + SeguridadesOK := "DB1_SYS".SegOkGenerales, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); @@ -205,7 +200,7 @@ FUNCTION "FC50_MAIN" : Void "FC2015_ZC_M"(Pulso1seg := "DB1_SYS".Pulso1seg, Simulacion := "DB1_SYS".SIM, Ack := "DB1_SYS".ACK, - SeguridadesOK := #SegGeneralDisp, + SeguridadesOK := "DB1_SYS".SegOkGenerales, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); @@ -224,7 +219,7 @@ FUNCTION "FC50_MAIN" : Void Simulacion := "DB1_SYS".SIM, Arranque := "DB1_SYS".ARRANQUE, Ack := "DB1_SYS".ACK, - SeguridadesOK := #SegGeneralDisp, + SeguridadesOK := "DB1_SYS".SegOkGenerales, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); @@ -243,7 +238,7 @@ FUNCTION "FC50_MAIN" : Void Simulacion := "DB1_SYS".SIM, Arranque := "DB1_SYS".ARRANQUE, Ack := "DB1_SYS".ACK, - SeguridadesOK := #SegGeneralDisp, + SeguridadesOK := "DB1_SYS".SegOkGenerales, UsuarioActual := "DB1_SYS".Usuario.Actual, FechaHoraActual := "DB1_SYS".FechaHoraActual); diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7res index 0299e32..08a55db 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/000_Sistema_Gestor/FC50_MAIN.s7res @@ -3,7 +3,3 @@ es-ES: Byte Marca de ciclo CPU - id: MLC_3Se es-ES: Byte Marcas de sistema - - id: MLC_4gv - es-ES: ID Profinet IO System - - id: MLC_45H - es-ES: Seguridad general dispositivos diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/FC2000_ZC_ED.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/FC2000_ZC_ED.s7dcl index e402f48..a11217e 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/FC2000_ZC_ED.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/FC2000_ZC_ED.s7dcl @@ -148,10 +148,10 @@ FUNCTION "FC2000_ZC_ED" : Void byteOffset := "DB2000_ED".ED[#for_i].Config_DirEntradaByte, bitOffset := "DB2000_ED".ED[#for_i].Config_DirEntradaBit); - IF NOT "DB2000_ED".ED[#for_i].Config_HabilitarInvertir THEN - "DB2000_ED".ED[#for_i].Estado_EntradaCanal := #t_ValorEntrada; - ELSE + IF "DB2000_ED".ED[#for_i].Config_HabilitarInvertir THEN "DB2000_ED".ED[#for_i].Estado_EntradaCanal := NOT #t_ValorEntrada; + ELSE + "DB2000_ED".ED[#for_i].Estado_EntradaCanal := #t_ValorEntrada; END_IF; END_IF; diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Multiplexado/FC2806_ZC_SA_MUX.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Multiplexado/FC2806_ZC_SA_MUX.s7dcl index d9a63a4..fd804dd 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Multiplexado/FC2806_ZC_SA_MUX.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/200_Dispositivos_Multiplexado/FC2806_ZC_SA_MUX.s7dcl @@ -248,7 +248,8 @@ FUNCTION "FC2806_ZC_SA_MUX" : Void OR ("DB2806_SA_MUX".Mux.Scada[#for_mux].SA.Config_Habilitar <> "DB2806_SA_MUX".Mux.Scada[#for_mux].oldSA.Config_Habilitar) OR ("DB2806_SA_MUX".Mux.Scada[#for_mux].SA.Config_HabilitarAlarmaMax <> "DB2806_SA_MUX".Mux.Scada[#for_mux].oldSA.Config_HabilitarAlarmaMax) OR ("DB2806_SA_MUX".Mux.Scada[#for_mux].SA.Config_HabilitarAlarmaMin <> "DB2806_SA_MUX".Mux.Scada[#for_mux].oldSA.Config_HabilitarAlarmaMin) - OR ("DB2806_SA_MUX".Mux.Scada[#for_mux].SA.Config_TipoAcceso <> "DB2806_SA_MUX".Mux.Scada[#for_mux].oldSA.Config_TipoAcceso); + OR ("DB2806_SA_MUX".Mux.Scada[#for_mux].SA.Config_TipoAcceso <> "DB2806_SA_MUX".Mux.Scada[#for_mux].oldSA.Config_TipoAcceso) + OR ("DB2806_SA_MUX".Mux.Scada[#for_mux].SA.Orden_ConsignaManual <> "DB2806_SA_MUX".Mux.Scada[#for_mux].oldSA.Orden_ConsignaManual); END_REGION GESTION_CAMBIOS_CONFIG diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/DB11_INF.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/DB11_INF.s7dcl index 66e4312..c5cd3e6 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/DB11_INF.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/DB11_INF.s7dcl @@ -19,7 +19,7 @@ DATA_BLOCK DB11_INF Gestion.EstadoConexion := TRUE; Gestion.OrdenIniciar := FALSE; Gestion.Etapa := 0; - Gestion.SP_Tiempo := 10; + Gestion.SP_TiempoOrden := 10; Gestion.TiempoActual := 0; Gestion.NumeroMaxIntentos := 3; diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7dcl index 723b0ee..c8a3c79 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7dcl @@ -23,6 +23,11 @@ FUNCTION "FC11_ZC_INF_GESTOR" : Void t_RegistroEncontrado : Bool; { S7_MLC := "MLC_3wk" } t_RetVal : Int; + { S7_MLC := "MLC_4uy" } + t_IndiceSuperiorBuffer : Int; + { S7_MLC := "MLC_43x" } + t_IndiceInferiorBuffer : Int; + t_InformeVacio : _.UDT_ZC_INF_DATOS; END_VAR VAR CONSTANT { S7_MLC := "MLC_PN" } @@ -90,402 +95,223 @@ FUNCTION "FC11_ZC_INF_GESTOR" : Void END_REGION DESCRIPCION + // ========================================================================================================== + REGION COMPROBACION_N_MAX + + // Si no hay buffer habilitado salimos inmediatamente + IF "N_MAX_INF_BUFFER" <= 0 THEN + RETURN; + END_IF; + + // Traspaso de N_MAX a variable temporal para evitar fallos de compilacion + #t_IndiceInferiorBuffer := 1; + #t_IndiceSuperiorBuffer := "N_MAX_INF_BUFFER"; + + END_REGION COMPROBACION_N_MAX + + // ========================================================================================================== REGION GESTION_INFORMES - // ============================================================================= - // COPIAMOS EL ULTIMO REGISTRO (El mas antiguo) A LA VARIABLE REGISTRO QUE ES LA - // ENCARGADA DE COMUNICARLA CON EL SCADA/HMI - IF "DB11_INF".Gestion.HabilitacionGeneral AND "DB11_INF".Gestion.Datos.Registrar = 0 AND #Pulso1Seg THEN + // ========================================================================================================== + REGION GESTION_ULTIMO_REGISTRO - // ============================================================================= - // Buscamos el ultimo registro - FOR #for_i := "N_MAX_INF_BUFFER" TO 0 BY -1 DO + // Si la gestion esta habilitada, se busca el ultimo registro y se mueve a la variable de gestion de avisos para + // los sistemas de supervision + IF "DB11_INF".Gestion.HabilitacionGeneral AND "DB11_INF".Gestion.Etapa = #REPOSO THEN // ============================================================================= - // Registro encontrado - IF "DB11_INF".Buffer[#for_i].Registrar = 1 THEN - #t_PosicionRegistro := #for_i; - #t_RegistroEncontrado := TRUE; - EXIT; + // Buscamos el ultimo registro + FOR #for_i := #t_IndiceSuperiorBuffer TO #t_IndiceInferiorBuffer BY -1 DO + + // ============================================================================= + // Registro encontrado + IF "DB11_INF".Buffer[#for_i].Registrar = 1 THEN + #t_PosicionRegistro := #for_i; + #t_RegistroEncontrado := TRUE; + EXIT; + END_IF; + + END_FOR; + + // ============================================================================= + // Si hemos encontrado el registro, copiamos a variable estatica + IF #t_RegistroEncontrado THEN + + // ============================================================================= + // Copiamos el los datos de la traza a variable estatica para tratarla + "DB11_INF".Gestion.Datos := "DB11_INF".Buffer[#t_PosicionRegistro]; + "DB11_INF".Gestion.Datos.Id := "FC15006_ZC_DTL_TO_STRING"(FechaDTL := "DB1_SYS".FechaHoraActual, Formato := 3); + + // ============================================================================= + // Quitamos el registro del buffer + "DB11_INF".Buffer[#t_PosicionRegistro] := #t_InformeVacio; + END_IF; - END_FOR; - - // ============================================================================= - // Si hemos encontrado el registro, copiamos a variable estatica - IF #t_RegistroEncontrado THEN - - // ============================================================================= - // Copiamos el los datos de la traza a variable estatica para tratarla - "DB11_INF".Gestion.Datos := "DB11_INF".Buffer[#t_PosicionRegistro]; - "DB11_INF".Gestion.Datos.Id := "FC15006_ZC_DTL_TO_STRING"(FechaDTL := "DB1_SYS".FechaHoraActual, Formato := 3); - - // ============================================================================= - // Quitamos el registro del buffer - "DB11_INF".Buffer[#t_PosicionRegistro].Registrar := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Id := ''; - "DB11_INF".Buffer[#t_PosicionRegistro].Tipo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Codigo := ''; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.Ano := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.Mes := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.Dia := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.DiaSemana := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.Hora := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.Minuto := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.Segundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_1.NanoSegundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.Ano := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.Mes := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.Dia := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.DiaSemana := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.Hora := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.Minuto := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.Segundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_2.NanoSegundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.Ano := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.Mes := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.Dia := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.DiaSemana := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.Hora := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.Minuto := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.Segundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Fecha_3.NanoSegundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_1 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_2 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_3 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_4 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_5 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_6 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_7 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_8 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_9 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_10 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_11 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_12 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_13 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_14 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_15 := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_1 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_2 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_3 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_4 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_5 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_6 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_7 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_8 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_9 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_10 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_11 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_12 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_13 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_14 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_15 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_16 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_17 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_18 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_19 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_20 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_21 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_22 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_23 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_24 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_25 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_26 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_27 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_28 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_29 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_30 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_31 := - "DB11_INF".Buffer[#t_PosicionRegistro].Bool_32 := FALSE; - "DB11_INF".Buffer[#t_PosicionRegistro].Real_1 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_2 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_3 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_4 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_5 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_6 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_7 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_8 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_9 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_10 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_11 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_12 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_13 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_14 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_15 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_16 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_17 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_18 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_19 := - "DB11_INF".Buffer[#t_PosicionRegistro].Real_20 := 0.0; - "DB11_INF".Buffer[#t_PosicionRegistro].Int_1 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_2 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_3 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_4 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_5 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_6 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_7 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_8 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_9 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_10 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_11 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_12 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_13 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_14 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_15 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_16 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_17 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_18 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_19 := - "DB11_INF".Buffer[#t_PosicionRegistro].Int_20 := 0; - END_IF; - END_IF; + END_REGION GESTION_ULTIMO_REGISTRO - // ============================================================================= - // Si existe registro a trazar, lanzamos la orden de iniciar la secuencia - IF "DB11_INF".Gestion.Datos.Registrar = 1 AND "DB11_INF".Gestion.Etapa = #REPOSO AND "DB11_INF".Gestion.EstadoConexion THEN + // ========================================================================================================== + REGION GESTION_ORDEN_INICIAR - // Lanzamos la orden de iniciar la secuencia de registro - "DB11_INF".Gestion.OrdenIniciar := TRUE; + // ============================================================================= + // Si existe registro a trazar, lanzamos la orden de iniciar la secuencia + IF "DB11_INF".Gestion.Datos.Registrar = 1 AND "DB11_INF".Gestion.Etapa = #REPOSO AND "DB11_INF".Gestion.EstadoConexion THEN + + // Lanzamos la orden de iniciar la secuencia de registro + "DB11_INF".Gestion.OrdenIniciar := TRUE; + + END_IF; - END_IF; + END_REGION GESTION_ORDEN_INICIAR - - END_REGION + END_REGION GESTION_INFORMES // ========================================================================================================== REGION SECUENCIA_INFORME - + // En caso de deshabilitar los informes, ponemos el estado en borrar datos. IF NOT "DB11_INF".Gestion.HabilitacionGeneral AND "DB11_INF".Gestion.Etapa <> #REPOSO THEN "DB11_INF".Gestion.Etapa := #BORRAR_DATOS; END_IF; - + // Gestion informes CASE "DB11_INF".Gestion.Etapa OF - // ============================================================================= + // ============================================================================= + // Etapa reposo #REPOSO: - IF "DB11_INF".Gestion.OrdenIniciar THEN - "DB11_INF".Gestion.Etapa := #LANZAR_AVISO; - "DB11_INF".Gestion.OrdenIniciar := FALSE; - "DB11_INF".Gestion.Aviso.Registrar := 0; - "DB11_INF".Gestion.TiempoActual := 0; - "DB11_INF".Gestion.Aviso.NumeroIntentosActual := 0; - END_IF; + REGION REPOSO + + // Con orden de iniciar, vamos a etapa Lanzar aviso + IF "DB11_INF".Gestion.OrdenIniciar THEN + "DB11_INF".Gestion.Etapa := #LANZAR_AVISO; + "DB11_INF".Gestion.OrdenIniciar := FALSE; + "DB11_INF".Gestion.Aviso.Registrar := 0; + "DB11_INF".Gestion.TiempoActual := 0; + "DB11_INF".Gestion.Aviso.NumeroIntentosActual := 0; + END_IF; + + END_REGION REPOSO - - - // ============================================================================= + // ============================================================================= + // Etapa espera entre avisos #ESPERA_ENTRE_AVISOS: - // Contador de tiempo de etapa - IF #Pulso1Seg THEN - "DB11_INF".Gestion.TiempoActual += 1; - END_IF; - // Tiempo maximo de espera - IF ("DB11_INF".Gestion.TiempoActual >= "DB11_INF".Gestion.SP_Tiempo) THEN - "DB11_INF".Gestion.TiempoActual := 0; - "DB11_INF".Gestion.Etapa := #LANZAR_AVISO; - END_IF; + REGION #ESPERA_ENTRE_AVISOS + + // Contador de tiempo de etapa + IF #Pulso1Seg THEN + "DB11_INF".Gestion.TiempoActual += 1; + END_IF; + // Tiempo maximo de espera + IF ("DB11_INF".Gestion.TiempoActual >= "DB11_INF".Gestion.SP_TiempoEspera) THEN + "DB11_INF".Gestion.TiempoActual := 0; + "DB11_INF".Gestion.Etapa := #LANZAR_AVISO; + END_IF; + + END_REGION ESPERA_ENTRE_AVISOS - // Si ya se ha alcanzado el numero maximo de intentos, generamos la traza - IF "DB11_INF".Gestion.Aviso.NumeroIntentosActual >= "DB11_INF".Gestion.NumeroMaxIntentos THEN - "DB11_INF".Gestion.Etapa := #FALLO; - "DB11_INF".Gestion.Aviso.Registrar := 0; - END_IF; - - - - // ============================================================================= + // ============================================================================= + // Etapa lanzar aviso #LANZAR_AVISO: + REGION LANZAR_AVISO + + // Activamos temporizador + IF #Pulso1Seg THEN + "DB11_INF".Gestion.TiempoActual += 1; + END_IF; + + // Activamos orden de lanzar el aviso + "DB11_INF".Gestion.Aviso.Registrar := TRUE; + + // Espera tiempo de seguridad + IF ("DB11_INF".Gestion.TiempoActual >= "DB11_INF".Gestion.SP_TiempoOrden) THEN + "DB11_INF".Gestion.TiempoActual := 0; + "DB11_INF".Gestion.Etapa := #ESPERA_CONFIRMACION; + END_IF; + + END_REGION LANZAR_AVISO - IF #Pulso1Seg THEN - "DB11_INF".Gestion.TiempoActual += 1; - END_IF; - "DB11_INF".Gestion.Aviso.Registrar := TRUE; - - - - IF ("DB11_INF".Gestion.TiempoActual >= "DB11_INF".Gestion.SP_Tiempo) THEN - "DB11_INF".Gestion.Etapa := #ESPERA_CONFIRMACION; - END_IF; - - - // ============================================================================= + // ============================================================================= + // Etapa espera confirmacion #ESPERA_CONFIRMACION: + REGION ESPERA_CONFIRMACION + + // Activamos temporizador + IF #Pulso1Seg THEN + "DB11_INF".Gestion.TiempoActual += 1; + END_IF; + + // Confirmacion desde SCADA OK + IF "DB11_INF".Gestion.Aviso.Estado = 4 THEN + "DB11_INF".Gestion.TiempoActual := 0; + "DB11_INF".Gestion.Aviso.Estado := 0; + "DB11_INF".Gestion.Aviso.Registrar := FALSE; + "DB11_INF".Gestion.Etapa := #BORRAR_DATOS; + END_IF; + + // Tiempo maximo de espera + IF ("DB11_INF".Gestion.TiempoActual >= "DB11_INF".Gestion.SP_TiempoEspera) + OR + ("DB11_INF".Gestion.Aviso.Estado = 12) + THEN + "DB11_INF".Gestion.TiempoActual := 0; + "DB11_INF".Gestion.Aviso.Estado := 0; + "DB11_INF".Gestion.Aviso.Registrar := FALSE; + "DB11_INF".Gestion.Aviso.NumeroIntentosActual += 1; + + // Si ya se ha alcanzado el numero maximo de intentos, generamos la traza + IF "DB11_INF".Gestion.Aviso.NumeroIntentosActual >= "DB11_INF".Gestion.NumeroMaxIntentos THEN + "DB11_INF".Gestion.Etapa := #FALLO; + ELSE + "DB11_INF".Gestion.Etapa := #ESPERA_ENTRE_AVISOS; + END_IF; + + END_IF; + + END_REGION ESPERA_CONFIRMACION - IF #Pulso1Seg THEN - "DB11_INF".Gestion.TiempoActual += 1; - END_IF; - - // Confirmacion desde SCADA OK - IF "DB11_INF".Gestion.Aviso.Estado = 4 THEN - "DB11_INF".Gestion.TiempoActual := 0; - "DB11_INF".Gestion.Aviso.Estado := 0; - "DB11_INF".Gestion.Aviso.Registrar := FALSE; - "DB11_INF".Gestion.Etapa := #BORRAR_DATOS; - END_IF; - - // Tiempo maximo de espera - IF ("DB11_INF".Gestion.TiempoActual >= "DB11_INF".Gestion.SP_Tiempo) - OR - ("DB11_INF".Gestion.Aviso.Estado = 12) - THEN - "DB11_INF".Gestion.TiempoActual := 0; - "DB11_INF".Gestion.Aviso.Estado := 0; - "DB11_INF".Gestion.Aviso.Registrar := FALSE; - "DB11_INF".Gestion.Etapa := #ESPERA_ENTRE_AVISOS; - "DB11_INF".Gestion.Aviso.NumeroIntentosActual += 1; - END_IF; - - - // ============================================================================= + // ============================================================================= + // Etapa borrar datos #BORRAR_DATOS: - - "DB11_INF".Gestion.Datos.Registrar := 0; - "DB11_INF".Gestion.Datos.Id := ''; - "DB11_INF".Gestion.Datos.Tipo := 0; - "DB11_INF".Gestion.Datos.Codigo := ''; - "DB11_INF".Gestion.Datos.Fecha_1.Ano := 0; - "DB11_INF".Gestion.Datos.Fecha_1.Mes := 0; - "DB11_INF".Gestion.Datos.Fecha_1.Dia := 0; - "DB11_INF".Gestion.Datos.Fecha_1.DiaSemana := 0; - "DB11_INF".Gestion.Datos.Fecha_1.Hora := 0; - "DB11_INF".Gestion.Datos.Fecha_1.Minuto := 0; - "DB11_INF".Gestion.Datos.Fecha_1.Segundo := 0; - "DB11_INF".Gestion.Datos.Fecha_1.NanoSegundo := 0; - "DB11_INF".Gestion.Datos.Fecha_2.Ano := 0; - "DB11_INF".Gestion.Datos.Fecha_2.Mes := 0; - "DB11_INF".Gestion.Datos.Fecha_2.Dia := 0; - "DB11_INF".Gestion.Datos.Fecha_2.DiaSemana := 0; - "DB11_INF".Gestion.Datos.Fecha_2.Hora := 0; - "DB11_INF".Gestion.Datos.Fecha_2.Minuto := 0; - "DB11_INF".Gestion.Datos.Fecha_2.Segundo := 0; - "DB11_INF".Gestion.Datos.Fecha_2.NanoSegundo := 0; - "DB11_INF".Gestion.Datos.Fecha_3.Ano := 0; - "DB11_INF".Gestion.Datos.Fecha_3.Mes := 0; - "DB11_INF".Gestion.Datos.Fecha_3.Dia := 0; - "DB11_INF".Gestion.Datos.Fecha_3.DiaSemana := 0; - "DB11_INF".Gestion.Datos.Fecha_3.Hora := 0; - "DB11_INF".Gestion.Datos.Fecha_3.Minuto := 0; - "DB11_INF".Gestion.Datos.Fecha_3.Segundo := 0; - "DB11_INF".Gestion.Datos.Fecha_3.NanoSegundo := 0; - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_1 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_2 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_3 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_4 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_5 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_6 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_7 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_8 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_9 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_10 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_11 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_12 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_13 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_14 := - "DB11_INF".Buffer[#t_PosicionRegistro].CodString_15 := 0; - "DB11_INF".Gestion.Datos.Bool_1 := - "DB11_INF".Gestion.Datos.Bool_2 := - "DB11_INF".Gestion.Datos.Bool_3 := - "DB11_INF".Gestion.Datos.Bool_4 := - "DB11_INF".Gestion.Datos.Bool_5 := - "DB11_INF".Gestion.Datos.Bool_6 := - "DB11_INF".Gestion.Datos.Bool_7 := - "DB11_INF".Gestion.Datos.Bool_8 := - "DB11_INF".Gestion.Datos.Bool_9 := - "DB11_INF".Gestion.Datos.Bool_10 := - "DB11_INF".Gestion.Datos.Bool_11 := - "DB11_INF".Gestion.Datos.Bool_12 := - "DB11_INF".Gestion.Datos.Bool_13 := - "DB11_INF".Gestion.Datos.Bool_14 := - "DB11_INF".Gestion.Datos.Bool_15 := - "DB11_INF".Gestion.Datos.Bool_16 := - "DB11_INF".Gestion.Datos.Bool_17 := - "DB11_INF".Gestion.Datos.Bool_18 := - "DB11_INF".Gestion.Datos.Bool_19 := - "DB11_INF".Gestion.Datos.Bool_20 := - "DB11_INF".Gestion.Datos.Bool_21 := - "DB11_INF".Gestion.Datos.Bool_22 := - "DB11_INF".Gestion.Datos.Bool_23 := - "DB11_INF".Gestion.Datos.Bool_24 := - "DB11_INF".Gestion.Datos.Bool_25 := - "DB11_INF".Gestion.Datos.Bool_26 := - "DB11_INF".Gestion.Datos.Bool_27 := - "DB11_INF".Gestion.Datos.Bool_28 := - "DB11_INF".Gestion.Datos.Bool_29 := - "DB11_INF".Gestion.Datos.Bool_30 := - "DB11_INF".Gestion.Datos.Bool_31 := - "DB11_INF".Gestion.Datos.Bool_32 := FALSE; - "DB11_INF".Gestion.Datos.Real_1 := - "DB11_INF".Gestion.Datos.Real_2 := - "DB11_INF".Gestion.Datos.Real_3 := - "DB11_INF".Gestion.Datos.Real_4 := - "DB11_INF".Gestion.Datos.Real_5 := - "DB11_INF".Gestion.Datos.Real_6 := - "DB11_INF".Gestion.Datos.Real_7 := - "DB11_INF".Gestion.Datos.Real_8 := - "DB11_INF".Gestion.Datos.Real_9 := - "DB11_INF".Gestion.Datos.Real_10 := - "DB11_INF".Gestion.Datos.Real_11 := - "DB11_INF".Gestion.Datos.Real_12 := - "DB11_INF".Gestion.Datos.Real_13 := - "DB11_INF".Gestion.Datos.Real_14 := - "DB11_INF".Gestion.Datos.Real_15 := - "DB11_INF".Gestion.Datos.Real_16 := - "DB11_INF".Gestion.Datos.Real_17 := - "DB11_INF".Gestion.Datos.Real_18 := - "DB11_INF".Gestion.Datos.Real_19 := - "DB11_INF".Gestion.Datos.Real_20 := 0.0; - "DB11_INF".Gestion.Datos.Int_1 := - "DB11_INF".Gestion.Datos.Int_2 := - "DB11_INF".Gestion.Datos.Int_3 := - "DB11_INF".Gestion.Datos.Int_4 := - "DB11_INF".Gestion.Datos.Int_5 := - "DB11_INF".Gestion.Datos.Int_6 := - "DB11_INF".Gestion.Datos.Int_7 := - "DB11_INF".Gestion.Datos.Int_8 := - "DB11_INF".Gestion.Datos.Int_9 := - "DB11_INF".Gestion.Datos.Int_10 := - "DB11_INF".Gestion.Datos.Int_11 := - "DB11_INF".Gestion.Datos.Int_12 := - "DB11_INF".Gestion.Datos.Int_13 := - "DB11_INF".Gestion.Datos.Int_14 := - "DB11_INF".Gestion.Datos.Int_15 := - "DB11_INF".Gestion.Datos.Int_16 := - "DB11_INF".Gestion.Datos.Int_17 := - "DB11_INF".Gestion.Datos.Int_18 := - "DB11_INF".Gestion.Datos.Int_19 := - "DB11_INF".Gestion.Datos.Int_20 := 0; - "DB11_INF".Gestion.Aviso.Registrar := 0; - "DB11_INF".Gestion.Etapa := #REPOSO; - - // ============================================================================= + REGION BORRAR_DATOS + + "DB11_INF".Gestion.Datos := #t_InformeVacio; + + "DB11_INF".Gestion.Aviso.Registrar := 0; + "DB11_INF".Gestion.Etapa := #REPOSO; + + END_REGION BORRAR_DATOS + + // ============================================================================= + // Etapa fallo #FALLO: - - "FC8_ZC_TRZ_REGISTRO"(FechaHora := "DB1_SYS".FechaHoraActual, - Registrar := 1, - Categoria := "TRZ_CAT_1_SYS", - User := '', - CodInt_1 := "TRZ_SYS_INF_ERR", - CodInt_2 := 0, - CodInt_3 := 0, - CodInt_4 := 0, - CodInt_5 := 0, - CodReal_1 := 0.0, - CodReal_2 := 0.0); - "DB11_INF".Gestion.Datos.Registrar := 0; - "DB11_INF".Gestion.Etapa := #REPOSO; - + REGION FALLO + + // Registramos en trazabilidad el fallo de escritura de informe + "FC8_ZC_TRZ_REGISTRO"(FechaHora := "DB1_SYS".FechaHoraActual, + Registrar := 1, + Categoria := "TRZ_CAT_1_SYS", + User := '', + CodInt_1 := "TRZ_SYS_INF_ERR", + CodInt_2 := 0, + CodInt_3 := 0, + CodInt_4 := 0, + CodInt_5 := 0, + CodReal_1 := 0.0, + CodReal_2 := 0.0); + "DB11_INF".Gestion.Etapa := #BORRAR_DATOS; + + END_REGION FALLO + END_CASE; END_REGION - END_NETWORK END_FUNCTION diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7res index 7c42ca7..fa80ba2 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC11_ZC_INF_GESTOR.s7res @@ -13,6 +13,10 @@ es-ES: Indicador de registro encontrado - id: MLC_3wk es-ES: Variable para su uso en programa + - id: MLC_4uy + es-ES: Indice superior de Buffer + - id: MLC_43x + es-ES: Indice inferior de Buffer - id: MLC_PN es-ES: Etapa reposo - id: MLC_339 diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7dcl index 9d7ae5a..16e21bd 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7dcl @@ -10,255 +10,15 @@ S7_Version := "1.0" } FUNCTION "FC12_ZC_INF_REGISTRO" : Void - VAR_INPUT - { S7_MLC := "MLC_4KF" } - Registrar : USInt; - { S7_MLC := "MLC_3nx" } - Tipo : Int; - { S7_MLC := "MLC_55V" } - Codigo : String; - { S7_MLC := "MLC_45d" } - Fecha_1_Ano : UInt; - { S7_MLC := "MLC_3rV" } - Fecha_1_Mes : USInt; - { S7_MLC := "MLC_42U" } - Fecha_1_Dia : USInt; - { S7_MLC := "MLC_3AZ" } - Fecha_1_DiaSemana : USInt; - { S7_MLC := "MLC_3eG" } - Fecha_1_Hora : USInt; - { S7_MLC := "MLC_P8" } - Fecha_1_Minuto : USInt; - { S7_MLC := "MLC_x5" } - Fecha_1_Segundo : USInt; - { S7_MLC := "MLC_3nt" } - Fecha_1_NanoSegundo : UDInt; - { S7_MLC := "MLC_hh" } - Fecha_2_Ano : UInt; - { S7_MLC := "MLC_4Jz" } - Fecha_2_Mes : USInt; - { S7_MLC := "MLC_3As" } - Fecha_2_Dia : USInt; - { S7_MLC := "MLC_pv" } - Fecha_2_DiaSemana : USInt; - { S7_MLC := "MLC_4aA" } - Fecha_2_Hora : USInt; - { S7_MLC := "MLC_4qf" } - Fecha_2_Minuto : USInt; - { S7_MLC := "MLC_4dU" } - Fecha_2_Segundo : USInt; - { S7_MLC := "MLC_3j8" } - Fecha_2_NanoSegundo : UDInt; - { S7_MLC := "MLC_4H3" } - Fecha_3_Ano : UInt; - { S7_MLC := "MLC_4km" } - Fecha_3_Mes : USInt; - { S7_MLC := "MLC_5C7" } - Fecha_3_Dia : USInt; - { S7_MLC := "MLC_49X" } - Fecha_3_DiaSemana : USInt; - { S7_MLC := "MLC_Kx" } - Fecha_3_Hora : USInt; - { S7_MLC := "MLC_vZ" } - Fecha_3_Minuto : USInt; - { S7_MLC := "MLC_3cA" } - Fecha_3_Segundo : USInt; - { S7_MLC := "MLC_4JV" } - Fecha_3_NanoSegundo : UDInt; - { S7_MLC := "MLC_4gG" } - Fecha_4_Ano : UInt; - { S7_MLC := "MLC_WV" } - Fecha_4_Mes : USInt; - { S7_MLC := "MLC_4b5" } - Fecha_4_Dia : USInt; - { S7_MLC := "MLC_45b" } - Fecha_4_DiaSemana : USInt; - { S7_MLC := "MLC_3mF" } - Fecha_4_Hora : USInt; - { S7_MLC := "MLC_Qx" } - Fecha_4_Minuto : USInt; - { S7_MLC := "MLC_3Yc" } - Fecha_4_Segundo : USInt; - { S7_MLC := "MLC_3mw" } - Fecha_4_NanoSegundo : UDInt; - { S7_MLC := "MLC_4ix" } - CodString_1 : Int; - { S7_MLC := "MLC_Wm" } - CodString_2 : Int; - { S7_MLC := "MLC_4Sm" } - CodString_3 : Int; - { S7_MLC := "MLC_4x7" } - CodString_4 : Int; - { S7_MLC := "MLC_3PX" } - CodString_5 : Int; - { S7_MLC := "MLC_3HC" } - CodString_6 : Int; - { S7_MLC := "MLC_3zx" } - CodString_7 : Int; - { S7_MLC := "MLC_L7" } - CodString_8 : Int; - { S7_MLC := "MLC_Pv" } - CodString_9 : Int; - { S7_MLC := "MLC_4jC" } - CodString_10 : Int; - { S7_MLC := "MLC_3G3" } - CodString_11 : Int; - { S7_MLC := "MLC_43E" } - CodString_12 : Int; - { S7_MLC := "MLC_Rx" } - CodString_13 : Int; - { S7_MLC := "MLC_4rE" } - CodString_14 : Int; - { S7_MLC := "MLC_4bw" } - CodString_15 : Int; - { S7_MLC := "MLC_3mu" } - Bool_1 : Bool; - { S7_MLC := "MLC_fQ" } - Bool_2 : Bool; - { S7_MLC := "MLC_XW" } - Bool_3 : Bool; - { S7_MLC := "MLC_4kf" } - Bool_4 : Bool; - { S7_MLC := "MLC_Rc" } - Bool_5 : Bool; - { S7_MLC := "MLC_4Kg" } - Bool_6 : Bool; - { S7_MLC := "MLC_4ry" } - Bool_7 : Bool; - { S7_MLC := "MLC_55Q" } - Bool_8 : Bool; - { S7_MLC := "MLC_3Tv" } - Bool_9 : Bool; - { S7_MLC := "MLC_ZC" } - Bool_10 : Bool; - { S7_MLC := "MLC_4uY" } - Bool_11 : Bool; - { S7_MLC := "MLC_3es" } - Bool_12 : Bool; - { S7_MLC := "MLC_3Td" } - Bool_13 : Bool; - { S7_MLC := "MLC_yc" } - Bool_14 : Bool; - { S7_MLC := "MLC_462" } - Bool_15 : Bool; - { S7_MLC := "MLC_MV" } - Bool_16 : Bool; - { S7_MLC := "MLC_cc" } - Bool_17 : Bool; - { S7_MLC := "MLC_36E" } - Bool_18 : Bool; - { S7_MLC := "MLC_4ZV" } - Bool_19 : Bool; - { S7_MLC := "MLC_3HX" } - Bool_20 : Bool; - { S7_MLC := "MLC_4PE" } - Bool_21 : Bool; - { S7_MLC := "MLC_hj" } - Bool_22 : Bool; - { S7_MLC := "MLC_4sw" } - Bool_23 : Bool; - { S7_MLC := "MLC_fS" } - Bool_24 : Bool; - { S7_MLC := "MLC_3Kg" } - Bool_25 : Bool; - { S7_MLC := "MLC_36g" } - Bool_26 : Bool; - { S7_MLC := "MLC_5Br" } - Bool_27 : Bool; - { S7_MLC := "MLC_45U" } - Bool_28 : Bool; - { S7_MLC := "MLC_mK" } - Bool_29 : Bool; - { S7_MLC := "MLC_4s7" } - Bool_30 : Bool; - { S7_MLC := "MLC_4mU" } - Bool_31 : Bool; - { S7_MLC := "MLC_4CP" } - Bool_32 : Bool; - { S7_MLC := "MLC_53a" } - Real_1 : Real; - { S7_MLC := "MLC_378" } - Real_2 : Real; - { S7_MLC := "MLC_392" } - Real_3 : Real; - { S7_MLC := "MLC_3i5" } - Real_4 : Real; - { S7_MLC := "MLC_3Zb" } - Real_5 : Real; - { S7_MLC := "MLC_qq" } - Real_6 : Real; - { S7_MLC := "MLC_3Sr" } - Real_7 : Real; - { S7_MLC := "MLC_4en" } - Real_8 : Real; - { S7_MLC := "MLC_55Y" } - Real_9 : Real; - { S7_MLC := "MLC_dw" } - Real_10 : Real; - { S7_MLC := "MLC_3Ji" } - Real_11 : Real; - { S7_MLC := "MLC_4hk" } - Real_12 : Real; - { S7_MLC := "MLC_3fY" } - Real_13 : Real; - { S7_MLC := "MLC_4nt" } - Real_14 : Real; - { S7_MLC := "MLC_sC" } - Real_15 : Real; - { S7_MLC := "MLC_4Y3" } - Real_16 : Real; - { S7_MLC := "MLC_3WU" } - Real_17 : Real; - { S7_MLC := "MLC_4hZ" } - Real_18 : Real; - { S7_MLC := "MLC_xG" } - Real_19 : Real; - { S7_MLC := "MLC_3Gr" } - Real_20 : Real; - { S7_MLC := "MLC_353" } - Int_1 : Int; - { S7_MLC := "MLC_3tZ" } - Int_2 : Int; - { S7_MLC := "MLC_YZ" } - Int_3 : Int; - { S7_MLC := "MLC_3Q2" } - Int_4 : Int; - { S7_MLC := "MLC_z3" } - Int_5 : Int; - { S7_MLC := "MLC_54d" } - Int_6 : Int; - { S7_MLC := "MLC_3kq" } - Int_7 : Int; - { S7_MLC := "MLC_4XV" } - Int_8 : Int; - { S7_MLC := "MLC_4LQ" } - Int_9 : Int; - { S7_MLC := "MLC_38N" } - Int_10 : Int; - { S7_MLC := "MLC_3nN" } - Int_11 : Int; - { S7_MLC := "MLC_yH" } - Int_12 : Int; - { S7_MLC := "MLC_342" } - Int_13 : Int; - { S7_MLC := "MLC_3pr" } - Int_14 : Int; - { S7_MLC := "MLC_gN" } - Int_15 : Int; - { S7_MLC := "MLC_54B" } - Int_16 : Int; - { S7_MLC := "MLC_fn" } - Int_17 : Int; - { S7_MLC := "MLC_3yS" } - Int_18 : Int; - { S7_MLC := "MLC_4yL" } - Int_19 : Int; - { S7_MLC := "MLC_4pv" } - Int_20 : Int; + VAR_IN_OUT + Datos : _.UDT_ZC_INF_DATOS; END_VAR VAR_TEMP t_dummy : Int; t_fecha_vacia : DTL; + t_IndiceInferior : Int; + t_IndiceSuperior : Int; + t_NuevoInforme : _.UDT_ZC_INF_DATOS; END_VAR { S7_Language := "SCL" } @@ -314,21 +74,28 @@ FUNCTION "FC12_ZC_INF_REGISTRO" : Void // ========================================================================================================== - REGION COMPROBACION_HABILITACION + REGION COMPROBACION_N_MAX - // Si no esta habilitado los informes, salimos de la funcion. - IF NOT "DB11_INF".Gestion.HabilitacionGeneral THEN + // Si no hay buffer habilitado salimos inmediatamente + IF "N_MAX_INF_BUFFER" <= 0 OR NOT "DB11_INF".Gestion.HabilitacionGeneral THEN RETURN; END_IF; - END_REGION COMPROBACION_HABILITACION + // Traspaso de N_MAX a variable temporal para evitar fallos de compilacion + #t_IndiceInferior := 1; + #t_IndiceSuperior := "N_MAX_INF_BUFFER"; + + END_REGION COMPROBACION_N_MAX // ========================================================================================================== REGION DESPLAZAMIENTO_DE_DATOS - // Desplazamos los datos del buffer una posicion hacia abajo - #t_dummy := MOVE_BLK_VARIANT(SRC := "DB11_INF".Buffer, COUNT := INT_TO_UDINT(("N_MAX_INF_BUFFER")), SRC_INDEX := 0, DEST_INDEX := 1, DEST => "DB11_INF".Buffer); + // Desplazamiento de datos solo si el tamaño del buffer lo permite (N > 1) + IF #t_IndiceSuperior > 1 THEN + // Desplazamos los datos una posicion hacia abajo + #t_dummy := MOVE_BLK_VARIANT(SRC := "DB11_INF".Buffer, COUNT := INT_TO_UDINT(#t_IndiceSuperior - 1), SRC_INDEX := 1, DEST_INDEX := 2, DEST => "DB11_INF".Buffer); + END_IF; END_REGION DESPLAZAMIENTO_DE_DATOS @@ -337,153 +104,160 @@ FUNCTION "FC12_ZC_INF_REGISTRO" : Void REGION GESTION_REGISTRO_INFORME // Grabamos el nuevo registro - "DB11_INF".Buffer[0].Registrar := #Registrar; - "DB11_INF".Buffer[0].Id := "FC15006_ZC_DTL_TO_STRING"(FechaDTL := "DB1_SYS".FechaHoraActual, Formato := 3); - "DB11_INF".Buffer[0].Tipo := #Tipo; - "DB11_INF".Buffer[0].Codigo := #Codigo; - IF #Fecha_1_Ano = 0 THEN - "DB11_INF".Buffer[0].Fecha_1.Ano := 1970; - "DB11_INF".Buffer[0].Fecha_1.Mes := 1; - "DB11_INF".Buffer[0].Fecha_1.Dia := 1; - "DB11_INF".Buffer[0].Fecha_1.DiaSemana := 5; + #t_NuevoInforme.Registrar := #Datos.Registrar; + #t_NuevoInforme.Id := 'POR DEFINIR'; + #t_NuevoInforme.Tipo := #Datos.Tipo; + #t_NuevoInforme.Codigo := #Datos.Codigo; + IF #Datos.Fecha_1.Ano = 0 THEN + #t_NuevoInforme.Fecha_1.Ano := 1970; + #t_NuevoInforme.Fecha_1.Mes := 1; + #t_NuevoInforme.Fecha_1.Dia := 1; + #t_NuevoInforme.Fecha_1.DiaSemana := 5; ELSE - "DB11_INF".Buffer[0].Fecha_1.Ano := #Fecha_1_Ano; - "DB11_INF".Buffer[0].Fecha_1.Mes := #Fecha_1_Mes; - "DB11_INF".Buffer[0].Fecha_1.Dia := #Fecha_1_Dia; - "DB11_INF".Buffer[0].Fecha_1.DiaSemana := #Fecha_1_DiaSemana; + #t_NuevoInforme.Fecha_1.Ano := #Datos.#Fecha_1.Ano; + #t_NuevoInforme.Fecha_1.Mes := #Datos.#Fecha_1.Mes; + #t_NuevoInforme.Fecha_1.Dia := #Datos.#Fecha_1.Dia; + #t_NuevoInforme.Fecha_1.DiaSemana := #Datos.#Fecha_1.DiaSemana; END_IF; - "DB11_INF".Buffer[0].Fecha_1.Hora := #Fecha_1_Hora; - "DB11_INF".Buffer[0].Fecha_1.Minuto := #Fecha_1_Minuto; - "DB11_INF".Buffer[0].Fecha_1.Segundo := #Fecha_1_Segundo; - "DB11_INF".Buffer[0].Fecha_1.NanoSegundo := #Fecha_1_NanoSegundo; - IF #Fecha_2_Ano = 0 THEN - "DB11_INF".Buffer[0].Fecha_2.Ano := 1970; - "DB11_INF".Buffer[0].Fecha_2.Mes := 1; - "DB11_INF".Buffer[0].Fecha_2.Dia := 1; - "DB11_INF".Buffer[0].Fecha_2.DiaSemana := 5; + #t_NuevoInforme.Fecha_1.Hora := #Datos.#Fecha_1.Hora; + #t_NuevoInforme.Fecha_1.Minuto := #Datos.#Fecha_1.Minuto; + #t_NuevoInforme.Fecha_1.Segundo := #Datos.#Fecha_1.Segundo; + #t_NuevoInforme.Fecha_1.NanoSegundo := #Datos.#Fecha_1.NanoSegundo; + IF #Datos.#Fecha_2.Ano = 0 THEN + #t_NuevoInforme.Fecha_2.Ano := 1970; + #t_NuevoInforme.Fecha_2.Mes := 1; + #t_NuevoInforme.Fecha_2.Dia := 1; + #t_NuevoInforme.Fecha_2.DiaSemana := 5; ELSE - "DB11_INF".Buffer[0].Fecha_2.Ano := #Fecha_2_Ano; - "DB11_INF".Buffer[0].Fecha_2.Mes := #Fecha_2_Mes; - "DB11_INF".Buffer[0].Fecha_2.Dia := #Fecha_2_Dia; - "DB11_INF".Buffer[0].Fecha_2.DiaSemana := #Fecha_2_DiaSemana; + #t_NuevoInforme.Fecha_2.Ano := #Datos.Fecha_2.Ano; + #t_NuevoInforme.Fecha_2.Mes := #Datos.Fecha_2.Mes; + #t_NuevoInforme.Fecha_2.Dia := #Datos.Fecha_2.Dia; + #t_NuevoInforme.Fecha_2.DiaSemana := #Datos.Fecha_2.DiaSemana; END_IF; - "DB11_INF".Buffer[0].Fecha_2.Hora := #Fecha_2_Hora; - "DB11_INF".Buffer[0].Fecha_2.Minuto := #Fecha_2_Minuto; - "DB11_INF".Buffer[0].Fecha_2.Segundo := #Fecha_2_Segundo; - "DB11_INF".Buffer[0].Fecha_2.NanoSegundo := #Fecha_2_NanoSegundo; - IF #Fecha_3_Ano = 0 THEN - "DB11_INF".Buffer[0].Fecha_3.Ano := 1970; - "DB11_INF".Buffer[0].Fecha_3.Mes := 1; - "DB11_INF".Buffer[0].Fecha_3.Dia := 1; - "DB11_INF".Buffer[0].Fecha_3.DiaSemana := 5; + #t_NuevoInforme.Fecha_2.Hora := #Datos.Fecha_2.Hora; + #t_NuevoInforme.Fecha_2.Minuto := #Datos.Fecha_2.Minuto; + #t_NuevoInforme.Fecha_2.Segundo := #Datos.Fecha_2.Segundo; + #t_NuevoInforme.Fecha_2.NanoSegundo := #Datos.Fecha_2.NanoSegundo; + IF #Datos.#Fecha_3.Ano = 0 THEN + #t_NuevoInforme.Fecha_3.Ano := 1970; + #t_NuevoInforme.Fecha_3.Mes := 1; + #t_NuevoInforme.Fecha_3.Dia := 1; + #t_NuevoInforme.Fecha_3.DiaSemana := 5; ELSE - "DB11_INF".Buffer[0].Fecha_3.Ano := #Fecha_3_Ano; - "DB11_INF".Buffer[0].Fecha_3.Mes := #Fecha_3_Mes; - "DB11_INF".Buffer[0].Fecha_3.Dia := #Fecha_3_Dia; - "DB11_INF".Buffer[0].Fecha_3.DiaSemana := #Fecha_3_DiaSemana; + #t_NuevoInforme.Fecha_3.Ano := #Datos.Fecha_3.Ano; + #t_NuevoInforme.Fecha_3.Mes := #Datos.Fecha_3.Mes; + #t_NuevoInforme.Fecha_3.Dia := #Datos.Fecha_3.Dia; + #t_NuevoInforme.Fecha_3.DiaSemana := #Datos.Fecha_3.DiaSemana; END_IF; - IF #Fecha_4_Ano = 0 THEN - "DB11_INF".Buffer[0].Fecha_4.Ano := 1970; - "DB11_INF".Buffer[0].Fecha_4.Mes := 1; - "DB11_INF".Buffer[0].Fecha_4.Dia := 1; - "DB11_INF".Buffer[0].Fecha_4.DiaSemana := 5; + #t_NuevoInforme.Fecha_3.Hora := #Datos.Fecha_3.Hora; + #t_NuevoInforme.Fecha_3.Minuto := #Datos.Fecha_3.Minuto; + #t_NuevoInforme.Fecha_3.Segundo := #Datos.Fecha_3.Segundo; + #t_NuevoInforme.Fecha_3.NanoSegundo := #Datos.Fecha_3.NanoSegundo; + IF #Datos.Fecha_4.Ano = 0 THEN + #t_NuevoInforme.Fecha_4.Ano := 1970; + #t_NuevoInforme.Fecha_4.Mes := 1; + #t_NuevoInforme.Fecha_4.Dia := 1; + #t_NuevoInforme.Fecha_4.DiaSemana := 5; ELSE - "DB11_INF".Buffer[0].Fecha_4.Ano := #Fecha_4_Ano; - "DB11_INF".Buffer[0].Fecha_4.Mes := #Fecha_4_Mes; - "DB11_INF".Buffer[0].Fecha_4.Dia := #Fecha_4_Dia; - "DB11_INF".Buffer[0].Fecha_4.DiaSemana := #Fecha_4_DiaSemana; + #t_NuevoInforme.Fecha_4.Ano := #Datos.Fecha_4.Ano; + #t_NuevoInforme.Fecha_4.Mes := #Datos.Fecha_4.Mes; + #t_NuevoInforme.Fecha_4.Dia := #Datos.Fecha_4.Dia; + #t_NuevoInforme.Fecha_4.DiaSemana := #Datos.Fecha_4.DiaSemana; END_IF; - "DB11_INF".Buffer[0].Fecha_3.Hora := #Fecha_3_Hora; - "DB11_INF".Buffer[0].Fecha_3.Minuto := #Fecha_3_Minuto; - "DB11_INF".Buffer[0].Fecha_3.Segundo := #Fecha_3_Segundo; - "DB11_INF".Buffer[0].Fecha_3.NanoSegundo := #Fecha_3_NanoSegundo; - "DB11_INF".Buffer[0].CodString_1 := #CodString_1; - "DB11_INF".Buffer[0].CodString_2 := #CodString_2; - "DB11_INF".Buffer[0].CodString_3 := #CodString_3; - "DB11_INF".Buffer[0].CodString_4 := #CodString_4; - "DB11_INF".Buffer[0].CodString_5 := #CodString_5; - "DB11_INF".Buffer[0].CodString_6 := #CodString_6; - "DB11_INF".Buffer[0].CodString_7 := #CodString_7; - "DB11_INF".Buffer[0].CodString_8 := #CodString_8; - "DB11_INF".Buffer[0].CodString_9 := #CodString_9; - "DB11_INF".Buffer[0].CodString_10 := #CodString_10; - "DB11_INF".Buffer[0].CodString_11 := #CodString_11; - "DB11_INF".Buffer[0].CodString_12 := #CodString_12; - "DB11_INF".Buffer[0].CodString_13 := #CodString_13; - "DB11_INF".Buffer[0].CodString_14 := #CodString_14; - "DB11_INF".Buffer[0].CodString_15 := #CodString_15; - "DB11_INF".Buffer[0].Bool_1 := #Bool_1; - "DB11_INF".Buffer[0].Bool_2 := #Bool_2; - "DB11_INF".Buffer[0].Bool_3 := #Bool_3; - "DB11_INF".Buffer[0].Bool_4 := #Bool_4; - "DB11_INF".Buffer[0].Bool_5 := #Bool_5; - "DB11_INF".Buffer[0].Bool_6 := #Bool_6; - "DB11_INF".Buffer[0].Bool_7 := #Bool_7; - "DB11_INF".Buffer[0].Bool_8 := #Bool_8; - "DB11_INF".Buffer[0].Bool_9 := #Bool_9; - "DB11_INF".Buffer[0].Bool_10 := #Bool_10; - "DB11_INF".Buffer[0].Bool_11 := #Bool_11; - "DB11_INF".Buffer[0].Bool_12 := #Bool_12; - "DB11_INF".Buffer[0].Bool_13 := #Bool_13; - "DB11_INF".Buffer[0].Bool_14 := #Bool_14; - "DB11_INF".Buffer[0].Bool_15 := #Bool_15; - "DB11_INF".Buffer[0].Bool_16 := #Bool_16; - "DB11_INF".Buffer[0].Bool_17 := #Bool_17; - "DB11_INF".Buffer[0].Bool_18 := #Bool_18; - "DB11_INF".Buffer[0].Bool_19 := #Bool_19; - "DB11_INF".Buffer[0].Bool_20 := #Bool_20; - "DB11_INF".Buffer[0].Bool_21 := #Bool_21; - "DB11_INF".Buffer[0].Bool_22 := #Bool_22; - "DB11_INF".Buffer[0].Bool_23 := #Bool_23; - "DB11_INF".Buffer[0].Bool_24 := #Bool_24; - "DB11_INF".Buffer[0].Bool_25 := #Bool_25; - "DB11_INF".Buffer[0].Bool_26 := #Bool_26; - "DB11_INF".Buffer[0].Bool_27 := #Bool_27; - "DB11_INF".Buffer[0].Bool_28 := #Bool_28; - "DB11_INF".Buffer[0].Bool_29 := #Bool_29; - "DB11_INF".Buffer[0].Bool_30 := #Bool_30; - "DB11_INF".Buffer[0].Bool_31 := #Bool_31; - "DB11_INF".Buffer[0].Bool_32 := #Bool_32; - "DB11_INF".Buffer[0].Real_1 := #Real_1; - "DB11_INF".Buffer[0].Real_2 := #Real_2; - "DB11_INF".Buffer[0].Real_3 := #Real_3; - "DB11_INF".Buffer[0].Real_4 := #Real_4; - "DB11_INF".Buffer[0].Real_5 := #Real_5; - "DB11_INF".Buffer[0].Real_6 := #Real_6; - "DB11_INF".Buffer[0].Real_7 := #Real_7; - "DB11_INF".Buffer[0].Real_8 := #Real_8; - "DB11_INF".Buffer[0].Real_9 := #Real_9; - "DB11_INF".Buffer[0].Real_10 := #Real_10; - "DB11_INF".Buffer[0].Real_11 := #Real_11; - "DB11_INF".Buffer[0].Real_12 := #Real_12; - "DB11_INF".Buffer[0].Real_13 := #Real_13; - "DB11_INF".Buffer[0].Real_14 := #Real_14; - "DB11_INF".Buffer[0].Real_15 := #Real_15; - "DB11_INF".Buffer[0].Real_16 := #Real_16; - "DB11_INF".Buffer[0].Real_17 := #Real_17; - "DB11_INF".Buffer[0].Real_18 := #Real_18; - "DB11_INF".Buffer[0].Real_19 := #Real_19; - "DB11_INF".Buffer[0].Real_20 := #Real_20; - "DB11_INF".Buffer[0].Int_1 := #Int_1; - "DB11_INF".Buffer[0].Int_2 := #Int_2; - "DB11_INF".Buffer[0].Int_3 := #Int_3; - "DB11_INF".Buffer[0].Int_4 := #Int_4; - "DB11_INF".Buffer[0].Int_5 := #Int_5; - "DB11_INF".Buffer[0].Int_6 := #Int_6; - "DB11_INF".Buffer[0].Int_7 := #Int_7; - "DB11_INF".Buffer[0].Int_8 := #Int_8; - "DB11_INF".Buffer[0].Int_9 := #Int_9; - "DB11_INF".Buffer[0].Int_10 := #Int_10; - "DB11_INF".Buffer[0].Int_11 := #Int_11; - "DB11_INF".Buffer[0].Int_12 := #Int_12; - "DB11_INF".Buffer[0].Int_13 := #Int_13; - "DB11_INF".Buffer[0].Int_14 := #Int_14; - "DB11_INF".Buffer[0].Int_15 := #Int_15; - "DB11_INF".Buffer[0].Int_16 := #Int_16; - "DB11_INF".Buffer[0].Int_17 := #Int_17; - "DB11_INF".Buffer[0].Int_18 := #Int_18; - "DB11_INF".Buffer[0].Int_19 := #Int_19; - "DB11_INF".Buffer[0].Int_20 := #Int_20; + #t_NuevoInforme.Fecha_4.Hora := #Datos.Fecha_4.Hora; + #t_NuevoInforme.Fecha_4.Minuto := #Datos.Fecha_4.Minuto; + #t_NuevoInforme.Fecha_4.Segundo := #Datos.Fecha_4.Segundo; + #t_NuevoInforme.Fecha_4.NanoSegundo := #Datos.Fecha_4.NanoSegundo; + #t_NuevoInforme.CodString_1 := #Datos.CodString_1; + #t_NuevoInforme.CodString_2 := #Datos.CodString_2; + #t_NuevoInforme.CodString_3 := #Datos.CodString_3; + #t_NuevoInforme.CodString_4 := #Datos.CodString_4; + #t_NuevoInforme.CodString_5 := #Datos.CodString_5; + #t_NuevoInforme.CodString_6 := #Datos.CodString_6; + #t_NuevoInforme.CodString_7 := #Datos.CodString_7; + #t_NuevoInforme.CodString_8 := #Datos.CodString_8; + #t_NuevoInforme.CodString_9 := #Datos.CodString_9; + #t_NuevoInforme.CodString_10 := #Datos.CodString_10; + #t_NuevoInforme.CodString_11 := #Datos.CodString_11; + #t_NuevoInforme.CodString_12 := #Datos.CodString_12; + #t_NuevoInforme.CodString_13 := #Datos.CodString_13; + #t_NuevoInforme.CodString_14 := #Datos.CodString_14; + #t_NuevoInforme.CodString_15 := #Datos.CodString_15; + #t_NuevoInforme.Bool_1 := #Datos.Bool_1; + #t_NuevoInforme.Bool_2 := #Datos.Bool_2; + #t_NuevoInforme.Bool_3 := #Datos.Bool_3; + #t_NuevoInforme.Bool_4 := #Datos.Bool_4; + #t_NuevoInforme.Bool_5 := #Datos.Bool_5; + #t_NuevoInforme.Bool_6 := #Datos.Bool_6; + #t_NuevoInforme.Bool_7 := #Datos.Bool_7; + #t_NuevoInforme.Bool_8 := #Datos.Bool_8; + #t_NuevoInforme.Bool_9 := #Datos.Bool_9; + #t_NuevoInforme.Bool_10 := #Datos.Bool_10; + #t_NuevoInforme.Bool_11 := #Datos.Bool_11; + #t_NuevoInforme.Bool_12 := #Datos.Bool_12; + #t_NuevoInforme.Bool_13 := #Datos.Bool_13; + #t_NuevoInforme.Bool_14 := #Datos.Bool_14; + #t_NuevoInforme.Bool_15 := #Datos.Bool_15; + #t_NuevoInforme.Bool_16 := #Datos.Bool_16; + #t_NuevoInforme.Bool_17 := #Datos.Bool_17; + #t_NuevoInforme.Bool_18 := #Datos.Bool_18; + #t_NuevoInforme.Bool_19 := #Datos.Bool_19; + #t_NuevoInforme.Bool_20 := #Datos.Bool_20; + #t_NuevoInforme.Bool_21 := #Datos.Bool_21; + #t_NuevoInforme.Bool_22 := #Datos.Bool_22; + #t_NuevoInforme.Bool_23 := #Datos.Bool_23; + #t_NuevoInforme.Bool_24 := #Datos.Bool_24; + #t_NuevoInforme.Bool_25 := #Datos.Bool_25; + #t_NuevoInforme.Bool_26 := #Datos.Bool_26; + #t_NuevoInforme.Bool_27 := #Datos.Bool_27; + #t_NuevoInforme.Bool_28 := #Datos.Bool_28; + #t_NuevoInforme.Bool_29 := #Datos.Bool_29; + #t_NuevoInforme.Bool_30 := #Datos.Bool_30; + #t_NuevoInforme.Bool_31 := #Datos.Bool_31; + #t_NuevoInforme.Bool_32 := #Datos.Bool_32; + #t_NuevoInforme.Real_1 := #Datos.Real_1; + #t_NuevoInforme.Real_2 := #Datos.Real_2; + #t_NuevoInforme.Real_3 := #Datos.Real_3; + #t_NuevoInforme.Real_4 := #Datos.Real_4; + #t_NuevoInforme.Real_5 := #Datos.Real_5; + #t_NuevoInforme.Real_6 := #Datos.Real_6; + #t_NuevoInforme.Real_7 := #Datos.Real_7; + #t_NuevoInforme.Real_8 := #Datos.Real_8; + #t_NuevoInforme.Real_9 := #Datos.Real_9; + #t_NuevoInforme.Real_10 := #Datos.Real_10; + #t_NuevoInforme.Real_11 := #Datos.Real_11; + #t_NuevoInforme.Real_12 := #Datos.Real_12; + #t_NuevoInforme.Real_13 := #Datos.Real_13; + #t_NuevoInforme.Real_14 := #Datos.Real_14; + #t_NuevoInforme.Real_15 := #Datos.Real_15; + #t_NuevoInforme.Real_16 := #Datos.Real_16; + #t_NuevoInforme.Real_17 := #Datos.Real_17; + #t_NuevoInforme.Real_18 := #Datos.Real_18; + #t_NuevoInforme.Real_19 := #Datos.Real_19; + #t_NuevoInforme.Real_20 := #Datos.Real_20; + #t_NuevoInforme.Int_1 := #Datos.Int_1; + #t_NuevoInforme.Int_2 := #Datos.Int_2; + #t_NuevoInforme.Int_3 := #Datos.Int_3; + #t_NuevoInforme.Int_4 := #Datos.Int_4; + #t_NuevoInforme.Int_5 := #Datos.Int_5; + #t_NuevoInforme.Int_6 := #Datos.Int_6; + #t_NuevoInforme.Int_7 := #Datos.Int_7; + #t_NuevoInforme.Int_8 := #Datos.Int_8; + #t_NuevoInforme.Int_9 := #Datos.Int_9; + #t_NuevoInforme.Int_10 := #Datos.Int_10; + #t_NuevoInforme.Int_11 := #Datos.Int_11; + #t_NuevoInforme.Int_12 := #Datos.Int_12; + #t_NuevoInforme.Int_13 := #Datos.Int_13; + #t_NuevoInforme.Int_14 := #Datos.Int_14; + #t_NuevoInforme.Int_15 := #Datos.Int_15; + #t_NuevoInforme.Int_16 := #Datos.Int_16; + #t_NuevoInforme.Int_17 := #Datos.Int_17; + #t_NuevoInforme.Int_18 := #Datos.Int_18; + #t_NuevoInforme.Int_19 := #Datos.Int_19; + #t_NuevoInforme.Int_20 := #Datos.Int_20; + + // Traspaso de datos al DB + "DB11_INF".Buffer[#t_IndiceInferior] := #t_NuevoInforme; END_REGION GESTION_REGISTRO_INFORME diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7res index bb0b3e9..c092437 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Informes/FC12_ZC_INF_REGISTRO.s7res @@ -3,247 +3,3 @@ es-ES: FC12_ZC_INFORME_REGISTRO - id: MLC_4sY es-ES: Funcion para almacenar una traza en el buffer de informes - - id: MLC_4KF - es-ES: Orden registrar (0= no registrar / 1= registrar) - - id: MLC_3nx - es-ES: Tipo - - id: MLC_55V - es-ES: Codigo produccion - - id: MLC_45d - es-ES: Fecha 1 Año - - id: MLC_3rV - es-ES: Fecha 1 Mes - - id: MLC_42U - es-ES: Fecha 1 Dia - - id: MLC_3AZ - es-ES: Fecha 1 Dia de la semana - - id: MLC_3eG - es-ES: Fecha 1 Hora - - id: MLC_P8 - es-ES: Fecha 1 Minuto - - id: MLC_x5 - es-ES: Fecha 1 Segundo - - id: MLC_3nt - es-ES: Fecha 1 Nanosegundo - - id: MLC_hh - es-ES: Fecha 2 Año - - id: MLC_4Jz - es-ES: Fecha 2 Mes - - id: MLC_3As - es-ES: Fecha 2 Dia - - id: MLC_pv - es-ES: Fecha 2 Dia de la semana - - id: MLC_4aA - es-ES: Fecha 2 Hora - - id: MLC_4qf - es-ES: Fecha 2 Minuto - - id: MLC_4dU - es-ES: Fecha 2 Segundo - - id: MLC_3j8 - es-ES: Fecha 2 Nanosegundo - - id: MLC_4H3 - es-ES: Fecha 3 Año - - id: MLC_4km - es-ES: Fecha 3 Mes - - id: MLC_5C7 - es-ES: Fecha 3 Dia - - id: MLC_49X - es-ES: Fecha 3 Dia de la semana - - id: MLC_Kx - es-ES: Fecha 3 Hora - - id: MLC_vZ - es-ES: Fecha 3 Minuto - - id: MLC_3cA - es-ES: Fecha 3 Segundo - - id: MLC_4JV - es-ES: Fecha 3 Nanosegundo - - id: MLC_4gG - es-ES: Fecha 4 Año - - id: MLC_WV - es-ES: Fecha 4 Mes - - id: MLC_4b5 - es-ES: Fecha 4 Dia - - id: MLC_45b - es-ES: Fecha 4 Dia de la semana - - id: MLC_3mF - es-ES: Fecha 4 Hora - - id: MLC_Qx - es-ES: Fecha 4 Minuto - - id: MLC_3Yc - es-ES: Fecha 4 Segundo - - id: MLC_3mw - es-ES: Fecha 4 Nanosegundo - - id: MLC_4ix - es-ES: Codigo string 1 - - id: MLC_Wm - es-ES: Codigo string 2 - - id: MLC_4Sm - es-ES: Codigo string 3 - - id: MLC_4x7 - es-ES: Codigo string 4 - - id: MLC_3PX - es-ES: Codigo string 5 - - id: MLC_3HC - es-ES: Codigo string 6 - - id: MLC_3zx - es-ES: Codigo string 7 - - id: MLC_L7 - es-ES: Codigo string 8 - - id: MLC_Pv - es-ES: Codigo string 9 - - id: MLC_4jC - es-ES: Codigo string 10 - - id: MLC_3G3 - es-ES: Codigo string 11 - - id: MLC_43E - es-ES: Codigo string 12 - - id: MLC_Rx - es-ES: Codigo string 13 - - id: MLC_4rE - es-ES: Codigo string 14 - - id: MLC_4bw - es-ES: Codigo string 15 - - id: MLC_3mu - es-ES: Valor booleano 1 - - id: MLC_fQ - es-ES: Valor booleano 2 - - id: MLC_XW - es-ES: Valor booleano 3 - - id: MLC_4kf - es-ES: Valor booleano 4 - - id: MLC_Rc - es-ES: Valor booleano 5 - - id: MLC_4Kg - es-ES: Valor booleano 6 - - id: MLC_4ry - es-ES: Valor booleano 7 - - id: MLC_55Q - es-ES: Valor booleano 8 - - id: MLC_3Tv - es-ES: Valor booleano 9 - - id: MLC_ZC - es-ES: Valor booleano 10 - - id: MLC_4uY - es-ES: Valor booleano 11 - - id: MLC_3es - es-ES: Valor booleano 12 - - id: MLC_3Td - es-ES: Valor booleano 13 - - id: MLC_yc - es-ES: Valor booleano 14 - - id: MLC_462 - es-ES: Valor booleano 15 - - id: MLC_MV - es-ES: Valor booleano 16 - - id: MLC_cc - es-ES: Valor booleano 17 - - id: MLC_36E - es-ES: Valor booleano 18 - - id: MLC_4ZV - es-ES: Valor booleano 19 - - id: MLC_3HX - es-ES: Valor booleano 20 - - id: MLC_4PE - es-ES: Valor booleano 21 - - id: MLC_hj - es-ES: Valor booleano 22 - - id: MLC_4sw - es-ES: Valor booleano 23 - - id: MLC_fS - es-ES: Valor booleano 24 - - id: MLC_3Kg - es-ES: Valor booleano 25 - - id: MLC_36g - es-ES: Valor booleano 26 - - id: MLC_5Br - es-ES: Valor booleano 27 - - id: MLC_45U - es-ES: Valor booleano 28 - - id: MLC_mK - es-ES: Valor booleano 29 - - id: MLC_4s7 - es-ES: Valor booleano 30 - - id: MLC_4mU - es-ES: Valor booleano 31 - - id: MLC_4CP - es-ES: Valor booleano 32 - - id: MLC_53a - es-ES: Valor real 1 - - id: MLC_378 - es-ES: Valor real 2 - - id: MLC_392 - es-ES: Valor real 3 - - id: MLC_3i5 - es-ES: Valor real 4 - - id: MLC_3Zb - es-ES: Valor real 5 - - id: MLC_qq - es-ES: Valor real 6 - - id: MLC_3Sr - es-ES: Valor real 7 - - id: MLC_4en - es-ES: Valor real 8 - - id: MLC_55Y - es-ES: Valor real 9 - - id: MLC_dw - es-ES: Valor real 10 - - id: MLC_3Ji - es-ES: Valor real 11 - - id: MLC_4hk - es-ES: Valor real 12 - - id: MLC_3fY - es-ES: Valor real 13 - - id: MLC_4nt - es-ES: Valor real 14 - - id: MLC_sC - es-ES: Valor real 15 - - id: MLC_4Y3 - es-ES: Valor real 16 - - id: MLC_3WU - es-ES: Valor real 17 - - id: MLC_4hZ - es-ES: Valor real 18 - - id: MLC_xG - es-ES: Valor real 19 - - id: MLC_3Gr - es-ES: Valor real 20 - - id: MLC_353 - es-ES: Valor entero 1 - - id: MLC_3tZ - es-ES: Valor entero 2 - - id: MLC_YZ - es-ES: Valor entero 3 - - id: MLC_3Q2 - es-ES: Valor entero 4 - - id: MLC_z3 - es-ES: Valor entero 5 - - id: MLC_54d - es-ES: Valor entero 6 - - id: MLC_3kq - es-ES: Valor entero 7 - - id: MLC_4XV - es-ES: Valor entero 8 - - id: MLC_4LQ - es-ES: Valor entero 9 - - id: MLC_38N - es-ES: Valor entero 10 - - id: MLC_3nN - es-ES: Valor entero 11 - - id: MLC_yH - es-ES: Valor entero 12 - - id: MLC_342 - es-ES: Valor entero 13 - - id: MLC_3pr - es-ES: Valor entero 14 - - id: MLC_gN - es-ES: Valor entero 15 - - id: MLC_54B - es-ES: Valor entero 16 - - id: MLC_fn - es-ES: Valor entero 17 - - id: MLC_3yS - es-ES: Valor entero 18 - - id: MLC_4yL - es-ES: Valor entero 19 - - id: MLC_4pv - es-ES: Valor entero 20 diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7dcl index 1f41845..ce10afd 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7dcl @@ -19,7 +19,6 @@ DATA_BLOCK DB7_TRZ Gestion.HabilitacionGeneral := TRUE; Gestion.EstadoConexion := TRUE; Gestion.OrdenIniciar := FALSE; - Gestion.HabilitarCategoria[0] := TRUE; Gestion.HabilitarCategoria[1] := TRUE; Gestion.HabilitarCategoria[2] := TRUE; Gestion.HabilitarCategoria[3] := TRUE; @@ -54,11 +53,20 @@ DATA_BLOCK DB7_TRZ Gestion.Etapa := 0; Gestion.SP_Tiempo := 2; Gestion.TiempoActual := 0; + { S7_MLC := "MLC_4Ur" } + Gestion.Aviso.HabilitarHmiScada[0] := (); + { S7_MLC := "MLC_46L" } + Gestion.Aviso.HabilitarHmiScada[1] := (); + { S7_MLC := "MLC_Qi" } + Gestion.Aviso.GenerarTexto[0] := (); + { S7_MLC := "MLC_4MW" } + Gestion.Aviso.GenerarTexto[1] := (); + { S7_MLC := "MLC_QH" } + Gestion.Aviso.TextoGenerado[0] := (); + { S7_MLC := "MLC_3wc" } + Gestion.Aviso.TextoGenerado[1] := (); Buffer[0].Registrar := 0; Buffer[0].Categoria := 0; Buffer[0].User := ''; - Buffer[1].Registrar := 0; - Buffer[1].Categoria := 0; - Buffer[1].User := ''; END_DATA_BLOCK diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7res index 87ea03e..0fc2485 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/DB7_TRZ.s7res @@ -3,3 +3,15 @@ es-ES: DB7_TRAZA - id: MLC_4Jb es-ES: Bloque de datos encargado de la trazabilidad. + - id: MLC_4Ur + es-ES: NO USAR + - id: MLC_46L + es-ES: . + - id: MLC_Qi + es-ES: NO USAR + - id: MLC_4MW + es-ES: . + - id: MLC_QH + es-ES: NO USAR + - id: MLC_3wc + es-ES: . diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7dcl index 82510ec..b8c58ca 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7dcl @@ -23,6 +23,16 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void t_RegistroEncontrado : Bool; { S7_MLC := "MLC_4Rw" } t_TextoGenerado : Bool; + { S7_MLC := "MLC_4NM" } + t_IndiceSuperiorBuffer : Int; + { S7_MLC := "MLC_pi" } + t_IndiceInferiorBuffer : Int; + { S7_MLC := "MLC_3R4" } + t_IndiceSuperiorScada : Int; + { S7_MLC := "MLC_4T7" } + t_IndiceInferiorScada : Int; + t_TrazaVacia : _.UDT_ZC_TRZ_DATOS; + t_Avisos : Array[0..31] of Bool; END_VAR VAR CONSTANT { S7_MLC := "MLC_3jc" } @@ -83,7 +93,7 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void |------|-----------| | FC | - | | FB | - | - | DB | `DB7_TRAZA` | + | DB | `DB7_TRZ` | | UDT | - | --- @@ -97,6 +107,23 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void END_REGION DESCRIPCION + // ========================================================================================================== + REGION COMPROBACION_N_MAX + + // Si no hay buffer habilitado salimos inmediatamente + IF "N_MAX_TRAZA_BUFFER" <= 0 THEN + RETURN; + END_IF; + + // Traspaso de N_MAX a variable temporal para evitar fallos de compilacion + #t_IndiceInferiorBuffer := 1; + #t_IndiceSuperiorBuffer := "N_MAX_TRAZA_BUFFER"; + #t_IndiceInferiorScada := 1; + #t_IndiceSuperiorScada := "N_MAX_SCADA"; + + END_REGION COMPROBACION_N_MAX + + // ========================================================================================================== REGION GESTION_TRAZA @@ -105,10 +132,10 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void // Si la gestion esta habilitada, se busca el ultimo registro y se mueve a la variable de gestion de avisos para // los sistemas de supervision - IF "DB7_TRZ".Gestion.HabilitacionGeneral AND #Pulso1Seg AND "DB7_TRZ".Gestion.Etapa = #REPOSO THEN + IF "DB7_TRZ".Gestion.HabilitacionGeneral AND "DB7_TRZ".Gestion.Etapa = #REPOSO THEN // Buscamos el ultimo registro - FOR #for_i := "N_MAX_TRAZA_BUFFER" TO 0 BY -1 DO + FOR #for_i := #t_IndiceSuperiorBuffer TO #t_IndiceInferiorBuffer BY -1 DO // Registro encontrado IF "DB7_TRZ".Buffer[#for_i].Registrar = 1 THEN @@ -119,7 +146,6 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void END_FOR; - // Si hemos encontrado el registro, copiamos a variable estatica IF #t_RegistroEncontrado THEN @@ -127,17 +153,7 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void "DB7_TRZ".Gestion.Aviso.Datos := "DB7_TRZ".Buffer[#t_PosicionRegistro]; // Quitamos el registro del buffer - "DB7_TRZ".Buffer[#t_PosicionRegistro].Registrar := 0; - "DB7_TRZ".Buffer[#t_PosicionRegistro].Categoria := - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodInt_1 := - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodInt_2 := - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodInt_3 := - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodInt_4 := - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodInt_5 := 0; - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodReal_1 := - "DB7_TRZ".Buffer[#t_PosicionRegistro].CodReal_2 := 0.0; - "DB7_TRZ".Buffer[#t_PosicionRegistro].TimeStamp := DTL#1970-01-01-00:00:00; - "DB7_TRZ".Buffer[#t_PosicionRegistro].User := ''; + "DB7_TRZ".Buffer[#t_PosicionRegistro] := #t_TrazaVacia; END_IF; @@ -177,7 +193,7 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void // ============================================================================= // Etapa reposo #REPOSO: - REGION #REPOSO + REGION REPOSO // Con orden de iniciar, vamos a etapa comprobaciones iniciales IF "DB7_TRZ".Gestion.OrdenIniciar THEN @@ -185,12 +201,12 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void "DB7_TRZ".Gestion.OrdenIniciar := FALSE; END_IF; - END_REGION + END_REGION REPOSO // ============================================================================= // Etapa comprobaciones iniciales #COMPROBACION_INICIAL: - REGION #COMPROBACION_INICIAL + REGION COMPROBACION_INICIAL // Si el registro actual no tiene orden de registrar, lo borramos yendo a etapa borrar datos IF "DB7_TRZ".Gestion.Aviso.Datos.Registrar = 0 THEN @@ -207,37 +223,48 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void "DB7_TRZ".Gestion.Aviso.Datos.Categoria := "TRZ_CAT_32_USER"; END_IF; - // Limpiamos las confirmaciones de texto generado por seguridad antes de esperar - FOR #for_i := 0 TO "N_MAX_SCADA" DO - "DB7_TRZ".Gestion.Aviso.TextoGenerado[#for_i] := FALSE; - END_FOR; - + // Comprobamos si tenemos scadas declarados + IF #t_IndiceSuperiorScada > 0 THEN + // Limpiamos las confirmaciones de texto generado por seguridad antes de esperar + FOR #for_i := #t_IndiceInferiorScada TO #t_IndiceSuperiorScada DO + "DB7_TRZ".Gestion.Aviso.TextoGenerado[#for_i] := FALSE; + END_FOR; + END_IF; "DB7_TRZ".Gestion.Etapa := #GENERAR_TEXTO; END_IF; END_IF; END_IF; - END_REGION + END_REGION COMPROBACION_INICIAL // ============================================================================= // Etapa generar texto #GENERAR_TEXTO: - REGION #GENERAR_TEXTO - - // Lanzamos la orden de generar textos a sistemas scada que esten habilitados - FOR #for_i := 0 TO "N_MAX_SCADA" DO - "DB7_TRZ".Gestion.Aviso.GenerarTexto[#for_i] := "DB7_TRZ".Gestion.Aviso.HabilitarHmiScada[#for_i]; - END_FOR; + REGION GENERAR_TEXTO // Activamos marca de texto generado OK desde Scada, antes de realizar las comprobaciones. #t_TextoGenerado := TRUE; - // Comprobamos si los Scadas estan habilitados y tenemos confirmacion de que el texto se ha generado correctamente - FOR #for_i := 0 TO "N_MAX_SCADA" DO - IF "DB7_TRZ".Gestion.Aviso.HabilitarHmiScada[#for_i] AND NOT "DB7_TRZ".Gestion.Aviso.TextoGenerado[#for_i] THEN - #t_TextoGenerado := FALSE; - END_IF; - END_FOR; + // Comprobamos si tenemos scadas declarados + IF #t_IndiceSuperiorScada > 0 THEN + + // Lanzamos la orden de generar textos a sistemas scada que esten habilitados + FOR #for_i := #t_IndiceInferiorScada TO #t_IndiceSuperiorScada DO + "DB7_TRZ".Gestion.Aviso.GenerarTexto[#for_i] := "DB7_TRZ".Gestion.Aviso.HabilitarHmiScada[#for_i]; + END_FOR; + + + + // Comprobamos si los Scadas estan habilitados y tenemos confirmacion de que el texto se ha generado correctamente + FOR #for_i := #t_IndiceInferiorScada TO #t_IndiceSuperiorScada DO + IF "DB7_TRZ".Gestion.Aviso.HabilitarHmiScada[#for_i] AND NOT "DB7_TRZ".Gestion.Aviso.TextoGenerado[#for_i] THEN + #t_TextoGenerado := FALSE; + END_IF; + END_FOR; + ELSE + // En caso de que no haya Scadas declarados, esperamos el tiempo por defecto + #t_TextoGenerado := FALSE; + END_IF; // Comprobacion de fin etapa @@ -247,10 +274,13 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void "DB7_TRZ".Gestion.TiempoActual := 0; "DB7_TRZ".Gestion.Etapa := #LANZAR_AVISO; - // Reseteamos las ordenes de generar texto - FOR #for_i := 0 TO "N_MAX_SCADA" DO - "DB7_TRZ".Gestion.Aviso.GenerarTexto[#for_i] := FALSE; - END_FOR; + // Comprobamos si tenemos scadas declarados + IF #t_IndiceSuperiorScada > 0 THEN + // Reseteamos las ordenes de generar texto + FOR #for_i := #t_IndiceInferiorScada TO #t_IndiceSuperiorScada DO + "DB7_TRZ".Gestion.Aviso.GenerarTexto[#for_i] := FALSE; + END_FOR; + END_IF; ELSE @@ -262,10 +292,13 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void "DB7_TRZ".Gestion.TiempoActual := 0; - // Reseteamos las ordenes de generar texto - FOR #for_i := 0 TO "N_MAX_SCADA" DO - "DB7_TRZ".Gestion.Aviso.GenerarTexto[#for_i] := FALSE; - END_FOR; + // Comprobamos si tenemos scadas declarados + IF #t_IndiceSuperiorScada > 0 THEN + // Reseteamos las ordenes de generar texto + FOR #for_i := #t_IndiceInferiorScada TO #t_IndiceSuperiorScada DO + "DB7_TRZ".Gestion.Aviso.GenerarTexto[#for_i] := FALSE; + END_FOR; + END_IF; "DB7_TRZ".Gestion.Etapa := #LANZAR_AVISO; END_IF; @@ -274,23 +307,23 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void END_IF; - END_REGION + END_REGION GENERAR_TEXTO // ============================================================================= // Etapa lanzar aviso #LANZAR_AVISO: - REGION #LANZAR_AVISO + REGION LANZAR_AVISO // Activamos orden de lanzar el aviso "DB7_TRZ".Gestion.Aviso.Aviso["DB7_TRZ".Gestion.Aviso.Datos.Categoria] := TRUE; "DB7_TRZ".Gestion.Etapa := #ESPERA; - END_REGION + END_REGION LANZAR_AVISO // ============================================================================= // Etapa espera #ESPERA: - REGION #ESPERA + REGION ESPERA // Esperamos un tiempo para que el aviso se haya registrado en todos los sistemas de supervision IF #Pulso1Seg THEN @@ -301,28 +334,19 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void END_IF; END_IF; - END_REGION + END_REGION ESPERA // ============================================================================= // Etapa borrar texto #BORRAR_TEXTO: - REGION #BORRAR_TEXTO + REGION BORRAR_TEXTO // Lanzamos orden de borrar texto a todos los Scadas "DB7_TRZ".Gestion.Aviso.BorrarTexto := TRUE; // Reseteamos los valores del aviso actual - "DB7_TRZ".Gestion.Aviso.Datos.Registrar := 0; - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_1 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_2 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_3 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_4 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_5 := 0; - "DB7_TRZ".Gestion.Aviso.Datos.CodReal_1 := - "DB7_TRZ".Gestion.Aviso.Datos.CodReal_2 := 0.0; - "DB7_TRZ".Gestion.Aviso.Datos.User := ''; - "DB7_TRZ".Gestion.Aviso.Datos.TimeStamp := DTL#1970-01-01-00:00:00; + "DB7_TRZ".Gestion.Aviso.Datos := #t_TrazaVacia; // Saltamos de etapa tras un tiempo IF #Pulso1Seg THEN @@ -333,13 +357,13 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void "DB7_TRZ".Gestion.Etapa := #QUITAR_AVISO; END_IF; END_IF; - - END_REGION + + END_REGION BORRAR_TEXTO // ============================================================================= // Etapa quitar aviso #QUITAR_AVISO: - REGION #QUITAR_AVISO + REGION QUITAR_AVISO // Desactivamos el aviso "DB7_TRZ".Gestion.Aviso.Aviso["DB7_TRZ".Gestion.Aviso.Datos.Categoria] := FALSE; @@ -353,30 +377,20 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void END_IF; END_IF; - END_REGION + END_REGION QUITAR_AVISO // ============================================================================= // Etapa borrar datos #BORRAR_DATOS: - REGION #BORRAR_DATOS + REGION BORRAR_DATOS // Reseteamos los valores del aviso actual - "DB7_TRZ".Gestion.Aviso.Datos.Registrar := 0; - "DB7_TRZ".Gestion.Aviso.Datos.Categoria := 0; - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_1 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_2 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_3 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_4 := - "DB7_TRZ".Gestion.Aviso.Datos.CodInt_5 := 0; - "DB7_TRZ".Gestion.Aviso.Datos.CodReal_1 := - "DB7_TRZ".Gestion.Aviso.Datos.CodReal_2 := 0.0; - "DB7_TRZ".Gestion.Aviso.Datos.User := ''; - "DB7_TRZ".Gestion.Aviso.Datos.TimeStamp := DTL#1970-01-01-00:00:00; + "DB7_TRZ".Gestion.Aviso.Datos := #t_TrazaVacia; "DB7_TRZ".Gestion.Etapa := #REPOSO; - END_REGION + END_REGION BORRAR_DATOS END_CASE; @@ -387,38 +401,14 @@ FUNCTION "FC7_ZC_TRZ_GESTOR" : Void REGION ACTIVACION_ALARMAS // Activamos los avisos en WORD segun la categoria y su habilitacion - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X0 := "DB7_TRZ".Gestion.HabilitarCategoria[0] AND "DB7_TRZ".Gestion.Aviso.Aviso[0]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X1 := "DB7_TRZ".Gestion.HabilitarCategoria[1] AND "DB7_TRZ".Gestion.Aviso.Aviso[1]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X2 := "DB7_TRZ".Gestion.HabilitarCategoria[2] AND "DB7_TRZ".Gestion.Aviso.Aviso[2]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X3 := "DB7_TRZ".Gestion.HabilitarCategoria[3] AND "DB7_TRZ".Gestion.Aviso.Aviso[3]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X4 := "DB7_TRZ".Gestion.HabilitarCategoria[4] AND "DB7_TRZ".Gestion.Aviso.Aviso[4]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X5 := "DB7_TRZ".Gestion.HabilitarCategoria[5] AND "DB7_TRZ".Gestion.Aviso.Aviso[5]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X6 := "DB7_TRZ".Gestion.HabilitarCategoria[6] AND "DB7_TRZ".Gestion.Aviso.Aviso[6]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X7 := "DB7_TRZ".Gestion.HabilitarCategoria[7] AND "DB7_TRZ".Gestion.Aviso.Aviso[7]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X8 := "DB7_TRZ".Gestion.HabilitarCategoria[8] AND "DB7_TRZ".Gestion.Aviso.Aviso[8]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X9 := "DB7_TRZ".Gestion.HabilitarCategoria[9] AND "DB7_TRZ".Gestion.Aviso.Aviso[9]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X10 := "DB7_TRZ".Gestion.HabilitarCategoria[10] AND "DB7_TRZ".Gestion.Aviso.Aviso[10]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X11 := "DB7_TRZ".Gestion.HabilitarCategoria[11] AND "DB7_TRZ".Gestion.Aviso.Aviso[11]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X12 := "DB7_TRZ".Gestion.HabilitarCategoria[12] AND "DB7_TRZ".Gestion.Aviso.Aviso[12]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X13 := "DB7_TRZ".Gestion.HabilitarCategoria[13] AND "DB7_TRZ".Gestion.Aviso.Aviso[13]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X14 := "DB7_TRZ".Gestion.HabilitarCategoria[14] AND "DB7_TRZ".Gestion.Aviso.Aviso[14]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[0].%X15 := "DB7_TRZ".Gestion.HabilitarCategoria[15] AND "DB7_TRZ".Gestion.Aviso.Aviso[15]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X0 := "DB7_TRZ".Gestion.HabilitarCategoria[16] AND "DB7_TRZ".Gestion.Aviso.Aviso[16]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X1 := "DB7_TRZ".Gestion.HabilitarCategoria[17] AND "DB7_TRZ".Gestion.Aviso.Aviso[17]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X2 := "DB7_TRZ".Gestion.HabilitarCategoria[18] AND "DB7_TRZ".Gestion.Aviso.Aviso[18]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X3 := "DB7_TRZ".Gestion.HabilitarCategoria[19] AND "DB7_TRZ".Gestion.Aviso.Aviso[19]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X4 := "DB7_TRZ".Gestion.HabilitarCategoria[20] AND "DB7_TRZ".Gestion.Aviso.Aviso[20]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X5 := "DB7_TRZ".Gestion.HabilitarCategoria[21] AND "DB7_TRZ".Gestion.Aviso.Aviso[21]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X6 := "DB7_TRZ".Gestion.HabilitarCategoria[22] AND "DB7_TRZ".Gestion.Aviso.Aviso[22]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X7 := "DB7_TRZ".Gestion.HabilitarCategoria[23] AND "DB7_TRZ".Gestion.Aviso.Aviso[23]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X8 := "DB7_TRZ".Gestion.HabilitarCategoria[24] AND "DB7_TRZ".Gestion.Aviso.Aviso[24]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X9 := "DB7_TRZ".Gestion.HabilitarCategoria[25] AND "DB7_TRZ".Gestion.Aviso.Aviso[25]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X10 := "DB7_TRZ".Gestion.HabilitarCategoria[26] AND "DB7_TRZ".Gestion.Aviso.Aviso[26]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X11 := "DB7_TRZ".Gestion.HabilitarCategoria[27] AND "DB7_TRZ".Gestion.Aviso.Aviso[27]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X12 := "DB7_TRZ".Gestion.HabilitarCategoria[28] AND "DB7_TRZ".Gestion.Aviso.Aviso[28]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X13 := "DB7_TRZ".Gestion.HabilitarCategoria[29] AND "DB7_TRZ".Gestion.Aviso.Aviso[29]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X14 := "DB7_TRZ".Gestion.HabilitarCategoria[30] AND "DB7_TRZ".Gestion.Aviso.Aviso[30]; - "DB7_TRZ".Gestion.Aviso.AvisoWord[1].%X15 := "DB7_TRZ".Gestion.HabilitarCategoria[31] AND "DB7_TRZ".Gestion.Aviso.Aviso[31]; + FOR #for_i := 0 TO 31 DO + #t_Avisos[#for_i] := "DB7_TRZ".Gestion.HabilitarCategoria[#for_i] AND "DB7_TRZ".Gestion.Aviso.Aviso[#for_i]; + END_FOR; + + // Taspaso a word + GATHER_BLK(IN:=#t_Avisos[0], + COUNT_OUT:=2, + OUT=>"DB7_TRZ".Gestion.Aviso.AvisoWord[0]); END_REGION ACTIVACION_ALARMAS diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7res b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7res index d9994ff..fe76040 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7res +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC7_ZC_TRZ_GESTOR.s7res @@ -13,6 +13,14 @@ es-ES: Indicador de registro encontrado - id: MLC_4Rw es-ES: Indicador de texto generado en todos los Scadas + - id: MLC_4NM + es-ES: Indice superior de Buffer + - id: MLC_pi + es-ES: Indice inferior de Buffer + - id: MLC_3R4 + es-ES: Indice superior de Scada + - id: MLC_4T7 + es-ES: Indice inferior de Scada - id: MLC_3jc es-ES: ETAPA EN REPOSO - id: MLC_3rR diff --git a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC8_ZC_TRZ_REGISTRO.s7dcl b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC8_ZC_TRZ_REGISTRO.s7dcl index 39e1bdd..f369d9f 100644 --- a/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC8_ZC_TRZ_REGISTRO.s7dcl +++ b/PLC/Bloques de programa/ZC_Estandar_Alimentacion/500_Datos_Trazabilidad/FC8_ZC_TRZ_REGISTRO.s7dcl @@ -37,6 +37,9 @@ FUNCTION "FC8_ZC_TRZ_REGISTRO" : Void VAR_TEMP { S7_MLC := "MLC_569" } t_dummy : Int; + t_IndiceInferior : Int; + t_IndiceSuperior : Int; + t_NuevaTraza : _.UDT_ZC_TRZ_DATOS; END_VAR { S7_Language := "SCL" } @@ -87,34 +90,58 @@ FUNCTION "FC8_ZC_TRZ_REGISTRO" : Void END_REGION DESCRIPCION + // ========================================================================================================== + REGION COMPROBACION_N_MAX + + // Si no hay buffer habilitado salimos inmediatamente + IF "N_MAX_TRAZA_BUFFER" <= 0 OR NOT "DB7_TRZ".Gestion.HabilitacionGeneral THEN + RETURN; + END_IF; + + // Traspaso de N_MAX a variable temporal para evitar fallos de compilacion + #t_IndiceInferior := 1; + #t_IndiceSuperior := "N_MAX_TRAZA_BUFFER"; + + END_REGION COMPROBACION_N_MAX + + + // ========================================================================================================== + REGION DESPLAZAMIENTO_DE_DATOS + + // Desplazamiento de datos solo si el tamaño del buffer lo permite (N > 1) + IF #t_IndiceSuperior > 1 THEN + // Desplazamos los datos una posicion hacia abajo + #t_dummy := MOVE_BLK_VARIANT(SRC := "DB7_TRZ".Buffer, COUNT := INT_TO_UDINT(#t_IndiceSuperior - 1), SRC_INDEX := 1, DEST_INDEX := 2, DEST => "DB7_TRZ".Buffer); + END_IF; + + END_REGION DESPLAZAMIENTO_DE_DATOS + + // ========================================================================================================== REGION GESTION_REGISTRO_TRAZA - // Si la trazabilidad esta habilitada - IF "DB7_TRZ".Gestion.HabilitacionGeneral THEN - - // Desplazamos los datos una posicion hacia abajo - #t_dummy := MOVE_BLK_VARIANT(SRC := "DB7_TRZ".Buffer, COUNT := INT_TO_UDINT(("N_MAX_TRAZA_BUFFER")), SRC_INDEX := 0, DEST_INDEX := 1, DEST => "DB7_TRZ".Buffer); - - // Guardamos el nuevo registro en la primera posicion - "DB7_TRZ".Buffer[0].Registrar := #Registrar; - "DB7_TRZ".Buffer[0].TimeStamp := #FechaHora; - "DB7_TRZ".Buffer[0].Categoria := #Categoria; - "DB7_TRZ".Buffer[0].CodInt_1 := #CodInt_1; - "DB7_TRZ".Buffer[0].CodInt_2 := #CodInt_2; - "DB7_TRZ".Buffer[0].CodInt_3 := #CodInt_3; - "DB7_TRZ".Buffer[0].CodInt_4 := #CodInt_4; - "DB7_TRZ".Buffer[0].CodInt_5 := #CodInt_5; - "DB7_TRZ".Buffer[0].CodReal_1 := #CodReal_1; - "DB7_TRZ".Buffer[0].CodReal_2 := #CodReal_2; - IF #User = '' THEN - "DB7_TRZ".Buffer[0].User := ' '; - ELSE - "DB7_TRZ".Buffer[0].User := #User; - END_IF; - + + // Guardamos el nuevo registro en variable temporal + #t_NuevaTraza.Registrar := #Registrar; + #t_NuevaTraza.TimeStamp := #FechaHora; + #t_NuevaTraza.Categoria := #Categoria; + #t_NuevaTraza.CodInt_1 := #CodInt_1; + #t_NuevaTraza.CodInt_2 := #CodInt_2; + #t_NuevaTraza.CodInt_3 := #CodInt_3; + #t_NuevaTraza.CodInt_4 := #CodInt_4; + #t_NuevaTraza.CodInt_5 := #CodInt_5; + #t_NuevaTraza.CodReal_1 := #CodReal_1; + #t_NuevaTraza.CodReal_2 := #CodReal_2; + + IF #User = '' THEN + #t_NuevaTraza.User := ' --- '; + ELSE + #t_NuevaTraza.User := #User; END_IF; + // Traspaso de datos al DB + "DB7_TRZ".Buffer[#t_IndiceInferior] := #t_NuevaTraza; + END_REGION GESTION_REGISTRO_TRAZA diff --git a/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/UDT_ZC_DISP_TOT.s7dcl b/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/UDT_ZC_DISP_TOT.s7dcl index 26f8207..0570dab 100644 --- a/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/UDT_ZC_DISP_TOT.s7dcl +++ b/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/200_Dispositivos_Estandar/UDT_ZC_DISP_TOT.s7dcl @@ -5,7 +5,7 @@ } UDT_ZC_DISP_TOT : STRUCT { S7_MLC := "MLC_4La" } - Hmi_Estado : UInt; + Hmi_Estado : Int; { S7_MLC := "MLC_4dr" } Estado_Pulso : Bool := FALSE; { S7_MLC := "MLC_4iV" } diff --git a/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7dcl b/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7dcl index fd9193d..6048b93 100644 --- a/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7dcl +++ b/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7dcl @@ -13,7 +13,9 @@ { S7_MLC := "MLC_q8" } Etapa : Int := 0; { S7_MLC := "MLC_3Wx" } - SP_Tiempo : Int := 0; + SP_TiempoOrden : Int := 2; + { S7_MLC := "MLC_uM" } + SP_TiempoEspera : Int := 10; { S7_MLC := "MLC_4nF" } TiempoActual : Int := 3; { S7_MLC := "MLC_gR" } diff --git a/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7res b/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7res index 75e4dd3..2a0496d 100644 --- a/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7res +++ b/PLC/Tipos de datos PLC/ZC_Estandar_Alimentacion/500_Datos_Informes/UDT_ZC_INF_GESTION.s7res @@ -12,7 +12,9 @@ - id: MLC_q8 es-ES: Etapa actual - id: MLC_3Wx - es-ES: SP Tiempo retardo + es-ES: SP Tiempo retardo orden registrar + - id: MLC_uM + es-ES: SP Tiempo retardo espera confirmacion - id: MLC_4nF es-ES: Tiempo retardo actual - id: MLC_gR diff --git a/PLC/Variables PLC/000_Sistema/000_Config_Dispositivos.xml b/PLC/Variables PLC/000_Sistema/000_Config_Dispositivos.xml index fb6da1a..d07aeb1 100644 --- a/PLC/Variables PLC/000_Sistema/000_Config_Dispositivos.xml +++ b/PLC/Variables PLC/000_Sistema/000_Config_Dispositivos.xml @@ -29,7 +29,7 @@ Int N_MAX_DISP_EA - 5 + 30 @@ -48,7 +48,7 @@ Int N_MAX_DISP_ED - 5 + 24 @@ -67,7 +67,7 @@ Int N_MAX_DISP_FF - 5 + 0 @@ -86,7 +86,7 @@ Int N_MAX_DISP_FF_SEC - 5 + 0 @@ -105,7 +105,7 @@ Int N_MAX_DISP_M - 5 + 12 @@ -124,7 +124,7 @@ Int N_MAX_DISP_M_SINA - 5 + 0 @@ -143,7 +143,7 @@ Int N_MAX_DISP_M_VF - 5 + 10 @@ -162,7 +162,7 @@ Int N_MAX_DISP_MEDIA - 5 + 0 @@ -181,7 +181,7 @@ Int N_MAX_DISP_MEDIA_VOLUMEN - 5 + 0 @@ -200,7 +200,7 @@ Int N_MAX_DISP_PID - 5 + 0 @@ -219,7 +219,7 @@ Int N_MAX_DISP_SA - 5 + 10 @@ -238,7 +238,7 @@ Int N_MAX_DISP_SD - 5 + 0 @@ -257,7 +257,7 @@ Int N_MAX_DISP_TOT - 5 + 10 @@ -276,7 +276,7 @@ Int N_MAX_DISP_TQ - 5 + 0 @@ -295,7 +295,7 @@ Int N_MAX_DISP_TQ_AE - 5 + 0 @@ -314,7 +314,7 @@ Int N_MAX_DISP_V - 5 + 40 @@ -333,7 +333,7 @@ Int N_MAX_DISP_VD - 5 + 0 @@ -352,7 +352,7 @@ Int N_MAX_DISP_TOF - 5 + 10 @@ -371,7 +371,7 @@ Int N_MAX_DISP_TON - 5 + 10