{
    S7_Author := "ABH";
    S7_BlockComment := "MLC_z4";
    S7_BlockNumber := "15990";
    S7_BlockTitle := "MLC_53k";
    S7_EditorMode := "SCL";
    S7_Family := "ZeusControl";
    S7_IECCheck := "TRUE";
    S7_Optimized := "TRUE";
    S7_Version := "1.0"
}
FUNCTION_BLOCK "FB15990_ZC_FAT_DI"
    VAR_INPUT
        { S7_MLC := "MLC_4Jr" }
        ByteEntrada : DInt := 0;
        { S7_MLC := "MLC_hD" }
        Area : Int := 0;
    END_VAR
    VAR_OUTPUT
        { S7_MLC := "MLC_44r" }
        Input_0 : Bool;
        { S7_MLC := "MLC_4YS" }
        Input_1 : Bool;
        { S7_MLC := "MLC_3Hi" }
        Input_2 : Bool;
        { S7_MLC := "MLC_3X6" }
        Input_3 : Bool;
        { S7_MLC := "MLC_Zt" }
        Input_4 : Bool;
        { S7_MLC := "MLC_a6" }
        Input_5 : Bool;
        { S7_MLC := "MLC_p4" }
        Input_6 : Bool;
        { S7_MLC := "MLC_Xp" }
        Input_7 : Bool;
    END_VAR
    VAR_TEMP
        t_Area : Byte;
        t_Input : Byte;
    END_VAR
    VAR CONSTANT
        { S7_MLC := "MLC_mF" }
        INPUT : Byte := 16#81;
        { S7_MLC := "MLC_4ht" }
        OUTPUT : Byte := 16#82;
        { S7_MLC := "MLC_4PB" }
        MARCAS : Byte := 16#83;
        { S7_MLC := "MLC_dZ" }
        "DB" : Byte := 16#84;
        { S7_MLC := "MLC_536" }
        PERIFERIA : Byte := 16#01;
    END_VAR

    { S7_Language := "SCL" }
    NETWORK
        REGION DESCRIPCION
        (*
        ###### (C)Copyright ZeusControl 2023 - 2023
        
        ---
        ### Información del Sistema
        | Hardware Compatible | Entorno de Ingeniería |
        |---------------------|-----------------------|
        | PLC serie 1200/1500 | TIA Portal 18         |
        
        ---
        > **Restricciones:** Ninguna.
        
        ---
        ### Descripción Funcional
        
        Función para el forzado de las entradas digitales para las pruebas FAT de los cuadros.
        
        ---
        ### Dependencias Requeridas
        | Tipo | Elementos |
        |------|-----------|
        | FC   | - |
        | FB   | - |
        | DB   | - |
        | UDT  | - |
        
        ---
        ### Historial de Cambios
        | Versión  | Fecha      | Técnico | Cambios |
        |----------|------------|---------|---------|
        | 01.00.00 | 12.09.2023 | (ABH)   | Primera version. |
        *)
        END_REGION DESCRIPCION
        
        
        //  ==========================================================================================================
        REGION GESTION_TIPO
            
            //  Gestion de tipo
            CASE #Area OF
                0:
                    #t_Area := #INPUT;
                1:
                    #t_Area := #OUTPUT;
                2:
                    #t_Area := #MARCAS;
                3:
                    #t_Area := #DB;
                4:
                    #t_Area := #PERIFERIA;
                    
                ELSE
                    #t_Area := #INPUT;
            END_CASE;
            
        END_REGION GESTION_TIPO
        
        
        //  ==========================================================================================================
        REGION LECTURA
            
            //  Lectura de BYTE de entradas
            #t_Input := PEEK_BYTE(area := #t_Area, dbNumber := 0, byteOffset := #ByteEntrada);
            
        END_REGION LECTURA
        
        
        //  ==========================================================================================================
        REGION SALIDAS
            
            //  Gestion de salidas
            #Input_0 := #t_Input.%X0;
            #Input_1 := #t_Input.%X1;
            #Input_2 := #t_Input.%X2;
            #Input_3 := #t_Input.%X3;
            #Input_4 := #t_Input.%X4;
            #Input_5 := #t_Input.%X5;
            #Input_6 := #t_Input.%X6;
            #Input_7 := #t_Input.%X7;
            
        END_REGION SALIDAS
        
    END_NETWORK
END_FUNCTION_BLOCK
