Calib_ResetToFactoryCalibration

Overview

The Calib_ResetToFactoryCalibration function block restores the factory calibration parameters for each individual mode of a specific channel on the Analog Output (AO) module.

💡 Factory settings

The AO module is factory calibrated during production, and the calibration parameters are stored in non-volatile FLASH memory. The module can be re-calibrated if needed, but factory calibration data cannot be overwritten.

Module_ID                           :=  (USINT)
Channel_Number                      :=  (USINT)
Channel_Mode                        :=  (BOOL)
CMD_Reset_To_Factory_Calibration    :=  (BOOL)
STS_Done                            =>  (BOOL)
STS_Failed                          =>  (BOOL)
STS_Fault_Code                      =>  (USINT)

Interface

Inputs

NameTypeRange / UnitsDescription
Module_IDUSINT1 - 15Unique identifier of the AO module.
Channel_NumberUSINT0 - 3Specifies which AO channel to reset.
Channel_ModeBOOL0 / 1Channel mode for which the reset is done:
1 = 0-10 V 0 = 4-20 mA.
CMD_Reset_To_Factory_CalibrationBOOLTRUE / FALSEReset on a rising edge (input goes from FALSE to TRUE).

Outputs

NameTypeDescription
STS_DoneBOOLTRUE when the factory calibration reset completes successfully.
STS_FailedBOOLTRUE if the reset process fails.
STS_Fault_CodeUSINTDiagnostic code indicating the reason for failure.

Fault Codes

CodeMeaningDescription
93Reset FailedThe factory calibration reset command failed.
97Module FaultedThe AO module reported an internal fault.
98Module MismatchThe detected module type does not match the expected AO module.
99Module Not FoundThe specified Module_ID is not part of the current hardware configuration.

Example

PROGRAM PROG_AO_Calib_ResetToFactoryCalibration
    VAR
        AO_Calib_Reset : Calib_ResetToFactoryCalibration;
        Trigger_Tag    : BOOL := FALSE;  (* Internal toggling trigger *)
    END_VAR

    (* Trigger the factory calibration reset for channel 2 (4-20 mA mode) on module 5 *)
    AO_Calib_Reset(
        Module_ID := 5,
        Channel_Number := 2,
        Channel_Mode := 0, (* 4-20mA *)
        CMD_Reset_To_Factory_Calibration := Trigger_Tag
    );
END_PROGRAM

CONFIGURATION Config0
    RESOURCE Res0 ON PLC
        TASK task1_20ms(INTERVAL := T#20ms, PRIORITY := 1);
        PROGRAM Prog_Instance_AO_Calib_Reset WITH task1_20ms : PROG_AO_Calib_ResetToFactoryCalibration;
    END_RESOURCE
END_CONFIGURATION