Fault and Error Functions

The controller generates axis faults, task errors, and task warnings to let you know when different error conditions occur on the drives and when they occur during the execution of AeroScript programs.

You can clear axis faults, task errors, and task warnings by using the AeroScript API functions or the Aerotech Automation1 Studio application. You can generate them manually by using the AeroScript API functions.

Clearing Axis Faults, Task Errors, and Task Warnings

The controller continuously monitors for axis faults, task errors, and task warnings. You can use the AcknowledgeAll() function to try to clear axis faults on all the axes, task errors on all the tasks, and task warnings on all the tasks.

IMPORTANT: The Internal Fault cannot be acknowledged. You must reset the controller to clear this fault.

function AcknowledgeAll()

Acknowledges all axis faults and clears all task errors.

The AcknowledgeAll() function works the same as when you do one of the steps that follow:

  • Click the Acknowledge All button in Aerotech Automation1 Studio.
  • Use the FaultAcknowledge() function on all the axes. Then call the TaskSetError() and TaskSetWarning() functions with arguments that have no error or no warning on all the tasks.

Refer to the Axis Faults section that follows for more information about axis faults. For more information about task errors and task warnings, refer to the Task Errors and Task Warnings section of this topic.

Axis Faults

The controller generates an axis fault when the drive detects an error condition that you must correct . Two or more axis faults can be generated at the same time. Examples of axis faults include the Position Error Fault and the Clockwise (CW) End-of-Travel Limit Fault. For information about all the axis faults that the controller can generate, refer to enum AxisFault.

When the controller detects a new axis fault on an axis, it does one of the operations that follow:

  • If a new axis fault is generated on an axis that is part of a coordinated move, the controller aborts all the axes that are part of the same move. Then it produces a task error on the task that is executing the coordinated move.
  • If a new axis fault is generated on an axis that was also specified for the task in the TaskTerminationAxes Parameter, the controller produces a task error on that task. If a coordinated move was executed on that task while the axis fault was generated, then the controller aborts all the axes that are part of that coordinated move.
  • The controller behavior that occurs as a result of new axis faults depends on the FaultMask Parameter, FaultMaskDecel Parameter, FaultMaskDisable Parameter, FaultAbortAxes Parameter, TaskTerminationAxes Parameter, and the FaultSetup Parameter. For more information, see Configuring Axis Faults below.

Configuring Axis Faults

When a new axis fault is generated, you can use fault and task parameters to configure the behavior of the controller. Refer to the table that follows.

WARNING: Before you enable and move the axes, make sure that you set these parameters to the correct values. Incorrect values can cause injury to personnel and damage to the hardware.

Table: Axis Fault and Task Error Parameters

Parameter Behavior

FaultMask

Specifies the set of axis faults that the controller can detect. For most faults that you specify for this parameter, the controller reports the fault condition only if the axis is enabled. But the controller can also report some fault conditions when the axis is disabled.

FaultMaskDecel

Specifies the set of axis faults that cause the controller to decelerate the axis to a stop. For this parameter to have an effect on a specific axis fault, you must set the same axis fault in the FaultMask Parameter. If you want the controller to disable the axis after it decelerates because of an axis fault, set the same axis fault in the FaultMaskDisable Parameter.

FaultMaskDisable

Specifies the set of axis faults for which the controller disables the axis. For this parameter to have an effect on a specific axis fault, you must set the same axis fault in the FaultMask Parameter. If you want the controller to decelerate the axis and then disable it because of an axis fault, set the same axis fault in the FaultMaskDecel Parameter.

FaultAbortAxes

Specifies the set of axes that the controller aborts because of an axis fault. The controller aborts these axes when a new axis fault is generated on the axis for which this parameter is configured.

TaskTerminationAxes

Specifies the set of axes that cause the task to produce a task error when a new axis fault is generated on one or more of the axes in the set.

FaultSetup

Configure the settings that are related to axis faults.

Examining Axis Faults

IMPORTANT: The Axis Dashboard shows fault information only if an axis has active faults.

To find the mask of axis faults that are active on an axis, examine the Axis Dashboard in Aerotech Automation1 Studio. You can also get the AxisDataSignal.AxisFault status item for the axis. Each bit in the retrieved status item relates to a value in the AxisFault enum.

Program Example


var $axisFaults as integer
$axisFaults = StatusGetAxisItem(X, AxisDataSignal.AxisFault)
' Axis X has an active PositionErrorFault axis fault.
if $axisFaults & AxisFault.PositionErrorFault
end

Clearing Axis Faults

You can use the FaultAcknowledge() function to try to clear all the axis faults on one or more axes. But there are some axis faults that you cannot clear because they are caused by a physical problem, such as a loose feedback cable connection.

function FaultAcknowledge($axis as axis)

Acknowledges faults on an axis.

Arguments

$axis  The axis on which to acknowledge faults.

function FaultAcknowledge($axes[] as axis)

Acknowledges faults on axes.

Arguments

$axes  The axes on which to acknowledge faults.

You can use the Acknowledge All button in Aerotech Automation1 Studio or the AcknowledgeAll() function to try to clear all the faults on all the axes. The button and the function also clear task errors and task warnings that are active on all the tasks.

If an axis is enabled and has an active software limit fault or end-of-travel limit fault, you can try to move the axis out of the limit that caused the axis fault by using jog buttons in the Axis Dashboard in Aerotech Automation1 Studio. You can also use the MoveAbsolute() function, MoveIncremental() function, MoveFreerun() function, or MoveOutOfLimit() function to generate a move to move the axis away from the limit that caused the fault.

You can use the FaultAckMoveOutOfLimit Parameter to configure the behavior of an axis when it has an active end-of-travel limit fault or software limit fault:

  • When you clear the active fault and enable this parameter, the axis moves out of the limit conditions.
  • When you clear the active fault and disable this parameter, the axis stays in the limit conditions.

Causing Axis Faults

If you want the controller to generate an axis fault, use the FaultThrow() function.

function FaultThrow($axis as axis, $faultMask as integer)

Causes faults on an axis.

Arguments

$axis  The axis on which to cause faults.

$faultMask  The mask of faults to cause on the axis.

You can cause the controller to generate two or more axis faults at the same time by using the | (bitwise OR) operator to combine multiple values from the enum AxisFault.

IMPORTANT: When you use the FaultThrow() function with a logical gantry axis under Decoupling Control, the controller does not reproduce the fault on other logical gantry axes, even if the fault would be detected on a physical or a logical axis in typical conditions.

Program Example

FaultThrow(Y, AxisFault.PositionError | AxisFault.ExternalFault)

Task Errors and Task Warnings

When an error condition occurs in an AeroScript program that is executing on a task, it results in a task error. For example, a task error will occur if you try to command motion on a disabled axis. When a task error occurs, the controller stops executing your AeroScript program and changes from the Task state to the Error state.

Configuring Task Errors

You can set the TaskErrorAbortAxes Parameter parameter to cause the controller to abort one or more axes when a task error occurs on a task. If the task is executing a coordinated move while a task error occurs, then the controller aborts all the axes that are part of that move.

You can use the supplied onerror() statement to cause the controller to execute an AeroScript function when a task error occurs on a task. This statement lets you do some steps in response to a task error and gives you the option to restart the program that caused it.

Examining Task Errors and Task Warnings

You can find the task error that is active on a task by retrieving the TaskStatusItem.TaskError status item for a task. Refer to the example that follows.

Program Example

var $taskError as integer
$taskError = StatusGetTaskItem(2, TaskStatusItem.TaskError)

You can also find the task warning that is active on a task by retrieving the TaskStatusItem.TaskWarning status item for a task.

You can get the error message or warning that is currently set on a task with the functions that follow.

function TaskGetErrorMessage($taskIndex as integer) as string

Gets the message of the error which is currently set on the given task.

Arguments

$taskIndex  The task from which to get the error message.

Returns

The message of the error which is currently set on the given task.

function TaskGetWarningMessage($taskIndex as integer) as string

Gets the message of the warning which is currently set on the given task.

Arguments

$taskIndex  The task from which to get the warning message.

Returns

The message of the warning which is currently set on the given task.

Causing or Clearing Task Errors and Warnings

You can use the functions that follow to cause an error or warning to occur on a task and include a custom message.

IMPORTANT: When you use TaskSetError() or TaskSetWarning() to set an error or warning, you will overwrite other errors or warnings that were set on the given task.

function TaskSetError($taskIndex as integer, $errorMessage as string)

Causes a task error with the specified message on a task.

Arguments

$taskIndex  The task on which to cause a task error.

$errorMessage  The error message to display.

function TaskSetWarning($taskIndex as integer, $warningMessage as string)

Causes a task warning with the specified message on a task.

Arguments

$taskIndex  The task on which to cause a task warning.

$warningMessage  The warning message to display.

The custom messages passed to the TaskSetError() and TaskSetWarning() functions have a capacity of 2,048 bytes. But, the messages must be null-terminated, so 2,047 bytes are available for AeroScript characters. Also, multi-byte Unicode characters use multiple bytes of the buffer from individual AeroScript characters. If the empty string is supplied, the error uses a default message of “A custom error was set.” or “A custom warning was set.”

You can use the functions that follow to clear a task error or task warning from a task.

IMPORTANT: The TaskClearError() function clears both the task error and task warning set on the given task.

function TaskClearError($taskIndex as integer)

Clears the task error that is set on the given task.

Arguments

$taskIndex  The task index on which to clear the task error.

function TaskClearWarning($taskIndex as integer)

Clears the task warning that is set on the given task.

Arguments

$taskIndex  The task index on which to clear the task warning.

You can use the Acknowledge All button in Aerotech Automation1 Studio or the AcknowledgeAll() function to try to clear all the faults on all the axes. The button and the function also clear task errors and task warnings that are active on all the tasks.

Related Topics 

Gantry Systems Overview