SD01189C/07/EN/04.17
Endress+Hauser
31
An error is also, if a measurement shall be executed and another action is running. As the above pseudo
code shows, this will be detected as an error.
6.1.3.4 How-to abort an action
// “Abort” can be executed at any time
Write CommonRequest “AbortOfCurrentActivity”
IF Write access returns error
Abort procedure with error
DO
Read FunctionExecutionStatus
WHILE FunctionExecutionStatus is “AbortOfCurrentActivityInProgress”
IF FunctionExecutionStatus is NOT “AbortOfCurrentActivityFinished”
Abort procedure with error
6.1.3.5 Error evaluation
The examples in the former chapters show how to detect an error. How to handle an error may dependent
from the cause of error.
Two errors can occur:
1. Write access fails and returns fieldbus specific error codes.
In most cases the analyzer is in a state where it cannot execute the desired function.
This can be checked by reading the parameters “OperationMode” and
“FunctionExecutionStatus”.
2. The parameter “FunctionExecutionStatus” has not the expected value.
Since the PLC has already read the function execution status, it can rely on this value to
check the cause of error, e.g.:
a. Other function is running or even finished or failed. So another user accessed
the analyzer and started this function.
b. The desired function failed. In most times a failure is signaled by a diagnosis
that can be read via fieldbus specific mechanism, e.g. diagnosis parameters.
Remark: The user shall be aware that the diagnosis may not reflect the function
error because other diagnosis events might be triggered. All diagnosis events
are logged.
Example for a simple error handling is to wait until device is available again:
DO
DO
Write ModeChangeRequest “Fieldbus”
WHILE Write access returns error
DO
Read ModeChangeStatus
WHILE ModeChangeStatus is “Busy”
WHILE ModeChangeStatus is NOT “WaitingForRequest”
DO
Write ResetRequest “ResetOfStatus”
WHILE Write access returns error
Of course, such a simple error handling will generated some traffic on Modbus.