|
YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
|
#include <CiA402StateMachine.h>
Classes | |
| struct | Command |
| Command structure. More... | |
| struct | Impl |
Public Member Functions | |
| StateMachine () | |
| Constructor. | |
| ~StateMachine () | |
| Destructor. | |
| void | reset () |
| Resets the internal state machine. | |
| Command | update (uint16_t statusword, int8_t opModeDisplay, int8_t opReq, bool hwInhibit) |
| Computes the next control word and operation mode to send to the drive. | |
| int8_t | getActiveOpMode () const noexcept |
| Command | faultReset () noexcept |
| Generates a fault reset command. | |
Static Public Member Functions | |
| static bool | isOpEnabled (uint16_t sw) |
| static bool | isFault (uint16_t sw) |
| static bool | isFaultReactionActive (uint16_t sw) |
| static bool | isQuickStopActive (uint16_t sw) |
| static bool | isOperationEnabled (uint16_t sw) |
| static bool | isSwitchedOn (uint16_t sw) |
Definition at line 104 of file CiA402StateMachine.h.
| CiA402::StateMachine::StateMachine | ( | ) |
Constructor.
Initializes the CiA-402 state machine for a single EtherCAT drive.
Definition at line 22 of file CiA402StateMachine.cpp.
|
default |
Destructor.
Cleans up the resources used by the state machine.
|
noexcept |
Generates a fault reset command.
This function generates a command to reset the fault state of the drive.
Immediate Fault reset (equivalent to requesting VOCAB_CM_FORCE_IDLE).
Definition at line 133 of file CiA402StateMachine.cpp.
|
noexcept |
Definition at line 35 of file CiA402StateMachine.cpp.
|
inlinestatic |
Check if the drive is in a fault state.
| sw | Status word. |
Definition at line 181 of file CiA402StateMachine.h.
|
inlinestatic |
Check if the fault reaction is active.
| sw | Status word. |
Definition at line 191 of file CiA402StateMachine.h.
|
inlinestatic |
Check if the operation is enabled.
| sw | Status word. |
Definition at line 171 of file CiA402StateMachine.h.
|
inlinestatic |
Check if the drive is switched on.
| sw | Status word. |
Definition at line 211 of file CiA402StateMachine.h.
|
inlinestatic |
Check if the drive is not ready to switch on.
| sw | Status word. |
Definition at line 201 of file CiA402StateMachine.h.
|
inlinestatic |
Check if the drive is switched on.
| sw | Status word. |
Definition at line 221 of file CiA402StateMachine.h.
| void CiA402::StateMachine::reset | ( | ) |
Resets the internal state machine.
Call this after power-on or after a drive fault to reinitialize the state machine.
Definition at line 29 of file CiA402StateMachine.cpp.
| CiA402::StateMachine::Command CiA402::StateMachine::update | ( | uint16_t | statusword, |
| int8_t | opModeDisplay, | ||
| int8_t | opReq, | ||
| bool | hwInhibit ) |
Computes the next control word and operation mode to send to the drive.
This function should be called cyclically. It determines the correct control word and (optionally) the operation mode to send, based on the current statusword and opModeDisplay.
| statusword | Value read from TxPDO.Statusword. |
| opModeDisplay | Value read from TxPDO.OpModeDisplay (object 0x6061). |
| opReq | Requested operation mode (object 0x6060). |
| hwInhibit | Hardware inhibit state (true if inhibited, false otherwise). |
Definition at line 40 of file CiA402StateMachine.cpp.