Cicode Programming Reference > Cicode Function Categories > Error Functions Introduction > ErrSet

ErrSet

Sets the error-checking mode. When Mode is set to 0 and an error occurs that causes a component to stop executing, CitectSCADA halts the execution of the Cicode task that caused the error, and generates a hardware error.

You can perform error checking by setting Mode to 1 and using the IsError() function to trap errors. When the type of error is determined, you can control what happens under particular error conditions.

The operation of the ErrSet() function is unique to each Cicode task. If you enable user error checking for one task, it does not enable error checking for any other tasks.

Note: This has changed from previous versions of CitectSCADA where this feature used to affect all Cicode tasks.

Syntax

ErrSet(Mode)

Mode:

Error-checking mode:

0 - default - CitectSCADA will check for errors.

1 - The user needs to check for errors.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

IsError, ErrSetHw, ErrSetLevel

Example

ErrSet(1);
Test=Var/0;
Error=IsError();
! Sets Error to 273 (divide by zero).

See Also

Error Functions