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
| Name | Type | Range / Units | Description |
|---|---|---|---|
| Module_ID | USINT | 1 - 15 | Unique identifier of the AO module. |
| Channel_Number | USINT | 0 - 3 | Specifies which AO channel to reset. |
| Channel_Mode | BOOL | 0 / 1 | Channel mode for which the reset is done:1 = 0-10 V 0 = 4-20 mA. |
| CMD_Reset_To_Factory_Calibration | BOOL | TRUE / FALSE | Reset on a rising edge (input goes from FALSE to TRUE). |
Outputs
| Name | Type | Description |
|---|---|---|
| STS_Done | BOOL | TRUE when the factory calibration reset completes successfully. |
| STS_Failed | BOOL | TRUE if the reset process fails. |
| STS_Fault_Code | USINT | Diagnostic code indicating the reason for failure. |
Fault Codes
| Code | Meaning | Description |
|---|---|---|
| 93 | Reset Failed | The factory calibration reset command failed. |
| 97 | Module Faulted | The AO module reported an internal fault. |
| 98 | Module Mismatch | The detected module type does not match the expected AO module. |
| 99 | Module Not Found | The 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