Skip to main content

handle

Short summary

This method throws an alarm and waits for it to be confirmed. When the alarm was confirmed the cyclemanager will proceed to next configured step. If the current step is the result of an evaluated error state and the input 'resumeWithLastStep' is set to true, the cyclemanager will proceed to the last step. Warning: The 'resumeWithLastStep' flag will be ignored if the last step was successful.

Purpose and usage

This method provides comprehensive error handling by displaying an alarm to the operator and managing the subsequent cycle manager behavior based on the error acknowledgment. It integrates alarm management with cycle flow control for robust error handling.

The method blocks execution until the alarm is acknowledged and then determines the next step based on the error context and resumeWithLastStep parameter.

Typical usage patterns

  1. Critical error handling: Display alarm for critical errors requiring operator intervention
  2. Process deviation handling: Show alarm when process parameters are out of range
  3. Equipment failure handling: Alert operators to equipment malfunctions
  4. Recovery operations: Provide options for continuing after error resolution

When to use

  • When an error requires operator notification and acknowledgment
  • For errors that need to be logged and tracked in the alarm system
  • When you need flexible recovery options (continue or retry)
  • For integrating cycle management with plant-wide alarm systems

Behaviour details

  • Displays the alarm using the CNM message system
  • Blocks cycle progression until alarm is acknowledged
  • If resumeWithLastStep=TRUE and step was reached via error: returns to last step
  • If resumeWithLastStep=FALSE: proceeds to next configured step
  • Warning: resumeWithLastStep is ignored if last step was successful

Parameter validation

  • alarm parameter must be a valid IAlarm instance
  • resumeWithLastStep flag only affects behavior when current step resulted from error evaluation

Example:

// Basic error handling with alarm
PROCESS_STEP:
IF motor_overload_detected THEN
cyclemanager.errors.handle(motor_overload_alarm, TRUE); // Resume with last step after ack
END_IF;

// Error handling with different recovery strategies
CRITICAL_OPERATION:
IF safety_violation THEN
cyclemanager.errors.handle(safety_alarm, FALSE); // Don't resume, go to next step
ELSIF equipment_fault THEN
cyclemanager.errors.handle(equipment_alarm, TRUE); // Allow retry of operation
END_IF;

// Complex error handling with context
VAR
process_error_alarm : ProcessErrorAlarm;
END_VAR

MONITORING_STEP:
IF temperature_out_of_range THEN
process_error_alarm.setMessage('Temperature exceeded limits');
process_error_alarm.setSeverity(AlarmSeverity.WARNING);
cyclemanager.errors.handle(process_error_alarm, TRUE);
END_IF;

Parameters

NameTypeCommentKind
alarmCNM_MessageInterfaces.IAlarmthe alarm event that should be throwninput
resumeWithLastStepBOOLif this flag is set AND we got to the current step because of an ERROR state, then the cyclemanager will automatically will go back to the last stepinput

Code

Declaration

METHOD handle
VAR_INPUT
(* the alarm event that should be thrown *)
alarm :CNM_MessageInterfaces.IAlarm;
(* if this flag is set AND we got to the current step because of an ERROR state, then the cyclemanager will automatically will go back to the last step *)
resumeWithLastStep :BOOL := TRUE;
END_VAR