Loading [MathJax]/extensions/tex2jax.js

You are here: Start » Tutorial Exercises » ADVANCED: Error handling (error_handling)

ADVANCED: Error handling (error_handling)

Aim

Create a task macrofilter which contains a single error handler. This error handler should set a different value on a macrofilter output if any error occurs.

Create a simple HMI with two Label controls and a single Knob control.

Input

The value set by a user on an HMI.

Output

The HMI with a single Knob and two Label controls. One of the Label should be set to a computed value or text Error when any problem occurred.

Hints

Task macrofilters can contain error handlers which are executed when an error occurred. The behavior of each error handler depends on the severity of the exception.

In this example only DomainError error will be raised. FabImage Studio allows a program to continue when Domain Error will be handled.

Domain Error is often raised in answer to setting value that lies out of operation domain. For example when a divisor is set to 0 during the integer division operation. In this example a filter DivideIntegers is the source of exception. In real appliance most exceptions come from problems with hardware.

Error handling is a quite computational complex operation. Avoid usage of the error handling as an answer to invalid parameter set on an input.

Labeling connections is explained in this article.

Solution (FIS)

►Click here to show the solution.