SysErr Function
Returns the latest error status or warning status.
Syntax
SysErr [(infoNo)]
Parameters
- infoNo
- Specify whether to get an error code or a warning code as an integer value. (Optional) 0: Error code (When omitted) 1: Warning code
Return Values
An integer representing the error code or warning code of the controller.
Description
SysErr is used only for NoEmgAbort task (special task using NoEmgAbort at Xqt) and background tasks.
Error codes or warning codes of controller are the error codes or warning codes displayed on the LCD.
When there are no errors or warnings, the return value will be 0.
See Also
ErrMsg$, ErrorOn, Trap, Xqt
SysErr Function Example
The following example shows a program that monitors the controller error and switches the I/O On/Off according to the error number when error occurs.
Notes
Forced Flag
This program example uses Forced flag for On/Off command.
Be sure that the I/O outputs change during error, or at Emergency Stop or Safety Door Open when designing the system.
Error Handling
As this program, finish the task promptly after completing the error handling.
Function main
Xqt ErrorMonitor, NoEmgAbort
:
:
Fend
Function ErrorMonitor
Wait ErrorOn
If 4000 < SysErr Then
Print "Motion Error = ", SysErr
Off 10, Forced
On 12, Forced
Else
Print "Other Error = ", SysErr
Off 11, Forced
On 13, Forced
EndIf
Fend
← SysConfig Statement T →