.

Events Overview

Introduction
Events Sequence
Event Handlers
EventType Enumeration Values

Introduction

Events are asynchronous (can be generated at any time, independently of what the main program is doing) conditions that are generated by the firmware executing on the motion controller.

Event Sequence

event

 
  1. The motion controller's firmware detects a condition that will trigger an event.
  2. The EventState for this event is immediately set. The event state will remain set until it is cleared. This property can be periodically monitored to know if an event has happened without needing any of the subsequent steps.
  3. If this event has a default action property then the appropriate object will perform the specified default action changing the motion object's state. This allows the motion controller to react to events very quickly without needing to perform any operations on the host.
  4. Each event has an "Event Enable" property. If this enable property is true then the notification of this event is sent to the MPX control. It is common to only enable events that are required in the users application, thereby reducing the processor loading on the host (by not handling unused events). The MPX control will send a message to the host program allowing it to interrupt the task it is currently performing and make the appropriate action.
  5. The MPX will call any functions attached to the Controller.ControllerEvent event.

Event Handlers

The MPX notifies applications about events through the Controller.ControllerEvent event. For example, the following function, once associated with the Controller.ControllerEvent event, will be executed on every event that is generated on the controller.

Visual Basic


Sub Controller_ControllerEvent(ByVal eventType As Mpx.EventType, _
                               ByVal objectNumber As Int32, _
                               ByVal int32Info() As Int32, _
                               ByVal int64Info() As Int64) _
                                   Handles Controller.ControllerEvent

    ' Any instructions here is executed after an event is generated. 

End Sub 

C#


void ControllerEventHandler(Mpx.EventType eventType,
                            int objectNumber As Int32,
                            int[] int32Info() As Int32,
                            long[] int64Info() As Int64)
{
    // Any instructions here is executed after an event is generated. 
}

The event code receives four arguments that give:

 
  • The type of event that has been generated
  • The object number of object that generated the event
  • An array of 32-bit integers that supplies additional information
  • An array of 64-bit integers that supplies additional information

The arrays of integers are a set of information captured when the original event was detected.

EventType Enumeration Values

The following table lists the different type of events that can be generated by a controller:

EventType Originating Object Description
None N/A Represents no event, or the absence of an event.
AxisAmpFault Axis An amplifier fault has occurred.
AxisHome Axis The main capture object associated with an Axis has fired.
AxisLimitPositionError Axis The position error limit has been exceeded.
AxisLimitHwNeg Axis The axis has run into the negative hardware limit.
AxisLimitHwPos Axis The axis has run into the positive hardware limit.
AxisLimitSwNeg Axis The axis has run into the negative software limit.
AxisLimitSwPos Axis The axis has run into the positive software limit.
AxisFeedbackFault Axis A feedback fault has occurred.
AxisAmpWarning Axis An amplifier warning has occurred.
AxisUserLimit0 UserLimit A user limit has been triggered.
. . .
AxisUserLimit15
AxisNearTarget Axis

The axis has come within the “Near Target Distance” of the target position for motion.

For more information, see Motion Related Events.

AxisSettled Axis

The axis has settled.

For more information, see Motion Related Events.

AxisAtTarget Axis

The axis’s command position has reached its target position.

For more information, see Motion Related Events.

AxisFrame Axis This event type is currently not supported and is reserved for future use.
MotionDone Motion

Motion has completed.

For more information, see Motion Related Events.

MotionAtVelocity Motion

Motion has reached its final non-zero velocity. A velcocity move to zero velocity generates a MotionDone event.

For more information, see Motion Related Events.

MotionOutOfFrames Motion Indicates that during streaming-point motion, the controller ran out of points to execute. This occurs when the controller executes points more quickly than the MPX can load the points.
RecorderFull Recorder The Recorder’s data has filled the buffer on the controller, suspending the recording of data. When this event occurs, there will be gaps in the recorded data returned to the application. In order to know when gaps occur, it is recommended to include the controller’s sample counter as a trace when recording data.
RecorderDone Recorder Indicates that the controller has recorded the number of requested data records. This event cannot occur when using the MPX’s Recorder object. The event can only occur by an MPI-based application’s use of the Recorder.
RecorderHigh Recorder This event type indicates that the controller's recorded data exceeded the buffer's high limit.
SynqNetDead SynqNet

The SynqNet network was shutdown due to a communication failure. This event occurs when the controller fails to read/write data to the SynqNet network interface from a receive or transmit failure. To recover from a SynqNetDead event, the network must be shutdown and reinitialized.

SynqNetDead is latched by the controller; use SynqNet.EventReset to clear the event.

SynqNetRxFailure SynqNet

SynqNet network data receive failure. Generated when the controller fails to receive the packet data buffer in two successive controller samples. A SynqNetRxFailure event is most likely caused by an incorrect RX_COPY_TIMER value (internal) or a timing problem. To recover from a SynqNetRxFailure event, the network must be shutdown and reinitialized.

SynqNetRxFailure is latched by the controller; use SynqNet.EventReset to clear the event.

SynqNetTxFailure SynqNet

SynqNet network data transmission failure. Generated when the controller fails to transmit the packet data buffer in two successive controller samples. This occurs when the maximum foreground time exceeds the Controller.TxTime percentage of the controller's sample period. The default TxTime value is 75% of the controller's sample period. To correct transmission failures, either increase the TxTime or decrease the controller's sample rate. To recover from a SynqNetTxFailure event, the network must be shutdown and reinitialized.

SynqNetTxFailure is latched by the controller; use SynqNet.EventReset to clear the event.

SynqNetNodeFailure SynqNet

SynqNet node failure. Generated when any node's upstream or downstream packet error rate counters exceed the failure limit. To recover from a node failure, the network must be shutdown and reinitialized.

See Also: SynqNet Node Failure

SynqNetRecovery SynqNet

SynqNet fault recovery. Generated when any node's upstream or downstream packet error rate counters exceed the fault limit and the data traffic is redirected around the fault. The fault limits are configurable via SqNode.FaultLimit and SqNode.FailLimit.

SynqNetRecovery is latched by the controller; use SynqNet.EventReset to clear the event.

See Also: SynqNet Fault Recovery

SqNodeIoAbort SqNode

SynqNet node I/O abort. Generated when the node I/O Abort is activated. When the I/O Abort is triggered, the node's outputs are disabled (set to the power-on condition). The node I/O Abort can be configured to trigger when either the Synq signal is lost, Node Disable is active, a Power Fault occurs, or a User Fault is triggered.

See SqNode.IoAbortConfig for more details.

SqNodeDisable SqNode

SynqNet node's Node Disable input is activated. Generated when the Node Disable input signal transitions from inactive to active.

SqNodeDisable is latched by the controller; use SynqNet.EventReset to clear the event.

SqNodeAlarm SqNode

SynqNet node analog power failure. Generated when the node's power failure input bit transitions from inactive to active. The power fault circuit is node-specific, but is typically connected to an analog power monitor.

SqNodeAlarm is latched by the controller; use SynqNet.EventReset to clear the event.

SqNodeAnalogPowerFault SqNode

AnalogPowerFault may be used by a SynqNet node to indicate a problem with analog power rails. For example, the RMB-10V2 reports an AnalogPowerFault if its internal +15V or -15V (used to power the DACs and ADC) are below minimum values.

NOTE: The exact meaning of AnalogPowerFault is specific to each particular node.

SqNodeUserFault SqNode

SynqNet node user fault. Generated when the node's user configurable fault is triggered. The user fault can be configured to monitor any controller memory address and compare the masked value to a specified pattern.

SqNodeUserFault is latched by the controller; use SynqNet.EventReset to clear the event.

SqNodeFailure SqNode SynqNet node failure. Generated when a node's upstream or downstream packet error rate counters exceed the failure limit. The failure limits are configured with SqNode.FailLimit. To recover from a node failure, the network must be shutdown and reinitialized.
SqNodeIoFault SqNode The event indicates that a fault was detected when communicating with one of the Slices or SynqNet I/O modules attached to either Slice or SQID nodes. This event is only generated by Slice and SynqNet (SQID) I/O nodes.
CanBusState Can The BusState has changed.
CanRxOverrun Can The CAN hardware detected a receive overrun.
CanEmergency Can An emergency message was received from a node.
CanNodeBoot Can A node boot message was received from a node.
CanHealth Can The health of a node has changed.
CanDigitalInput Can A digital input event was received from a node.
CanAnalogInput Can An analog input event was received from a node.
ControllerHostProcessTimeExceeded Controller

This event cannot occur by using the MPX. The event can only occur by an MPI-based application’s use of the SyncInterrupt feature.

This is an event that occurs if the SyncInterrupt Process Flag is set when SynqNet data is transmitted at the end of the firmware’s foreground cycle. If the user is using the SynqInterrupt feature and sets the ProcessFlag at the beginning of the foreground cycle, the firmware checks to see if the user cleared the ProcessFlag by the time SynqNet data is transmitted. If the ProcessFlag has not been cleared, the event occurs.

ControllerFan Controller

This is an event that can occur when the on-board fan controller detects an error (overheating, fan failure, etc…).

NOTE: This is for the ZMP only and will not occur on an XMP.

 

See Also

MPX Topics
Motion Related Events

Motion Object
EventEnable

Axis Object
EventEnable

SynqNet Object
EventEnable

SqNode Object
EventEnable

Can Object
EventEnable

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering