Get_FactoryCalibration

Overview

The Get_FactoryCalibration function block retrieves the factory calibration parameters (gain and offset) for a specific channel and mode 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_Get_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 get factory calibration parameters for.
Channel_ModeBOOL0 / 1Channel mode for which the factory calibration parameters are retrieved:
1 = 0-10 V 0 = 4-20 mA.
CMD_Get_Factory_CalibrationBOOLTRUE / FALSEGet factory calibration parameters on a rising edge (input goes from FALSE to TRUE).

Outputs

NameTypeDescription
STS_DoneBOOLTRUE when the factory calibration parameters are retrieved successfully.
STS_FailedBOOLTRUE if the get factory calibration process fails.
STS_Fault_CodeUSINTDiagnostic code indicating the reason for failure.

Fault Codes

CodeMeaningDescription
94Get Factory Calibration FailedThe factory calibration get 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_GetFactoryCalibration
    VAR
        AO_Get_FactoryCalibration : Get_FactoryCalibration;
        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_Get_FactoryCalibration(
        Module_ID := 5,
        Channel_Number := 2,
        Channel_Mode := 0, (* 4-20mA *)
        CMD_Get_Factory_Calibration := Trigger_Tag
    );
END_PROGRAM

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