Get_CurrentCalibration

Overview

The Get_CurrentCalibration function block retrieves the currently configured calibration parameters (gain and offset) for a specific channel and mode on the Analog Output (AO) module.

💡 Current settings

Factory calibration data is permanently stored in non-volatile FLASH memory and is write-protected.
Each subsequent calibration procedure generates a new calibration dataset, and the module’s operation is based on the latest valid calibration set.

Module_ID                       :=  (USINT)
Channel_Number                  :=  (USINT)
Channel_Mode                    :=  (BOOL)
CMD_Get_Current_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 current calibration parameters for.
Channel_ModeBOOL0 / 1Channel mode for which the current calibration parameters are retrieved:
1 = 0-10 V 0 = 4-20 mA.
CMD_Get_Current_CalibrationBOOLTRUE / FALSEGet current calibration parameters on a rising edge (input goes from FALSE to TRUE).

Outputs

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

Fault Codes

CodeMeaningDescription
95Get Current Calibration FailedThe current 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_GetCurrentCalibration
    VAR
        AO_Get_CurrentCalibration : Get_CurrentCalibration;
        Trigger_Tag    : BOOL := FALSE;  (* Internal toggling trigger *)
    END_VAR

    (* Trigger the current calibration retrieval for channel 2 (4-20 mA mode) on module 5 *)
    AO_Get_CurrentCalibration(
        Module_ID := 5,
        Channel_Number := 2,
        Channel_Mode := 0, (* 4-20mA *)
        CMD_Get_Current_Calibration := Trigger_Tag
    );
END_PROGRAM

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