Motion Master
|
#include <watchdog_machine.h>
Public Member Functions | |
WatchdogMachine (VirtualDeviceManager &vdm, ctpl::thread_pool &thread_pool, Notifier ¬ifier, moodycamel::ReaderWriterQueue< OutgoingMachineMessage > &outgoing_machine_message_queue) | |
void | execute (uint64_t pending_signals) override |
Execute the machine. More... | |
void | start () |
void | stop () |
void | abort_client_requests (const std::string &connection_id) override |
Abort all of the requests a certain client has issues. More... | |
bool | done () override |
Check if all of the machine started processes are done (including the Command Workers) More... | |
![]() | |
void | add_message (IncomingMachineMessage &incoming_machine_message) |
Add a new incoming machine message to the queue. More... | |
virtual void | execute (uint64_t pending_signals)=0 |
Execute the machine. More... | |
virtual void | abort_client_requests (const std::string &connection_id)=0 |
Abort all of the requests a certain client has issues. More... | |
bool | command_workers_done () |
Check if all started Command Workers are done. More... | |
virtual bool | done ()=0 |
Check if all of the machine started processes are done (including the Command Workers) More... | |
Additional Inherited Members | |
![]() | |
Machine (VirtualDeviceManager &vdm, ctpl::thread_pool &thread_pool, Notifier ¬ifier, moodycamel::ReaderWriterQueue< OutgoingMachineMessage > &outgoing_machine_message_queue) | |
virtual | ~Machine () |
void | start_command_worker (IncomingMachineMessage &incoming_machine_message) |
void | process_command_workers (std::function< void(CommandWorker *)> process=nullptr) |
Process all of the available Command Workers. More... | |
void | send_response (MachineMessage::Protocol protocol, std::string connection_id, motionmaster::MotionMasterMessage &message) |
Send the response (Status protobuf message) to the proper client. More... | |
![]() | |
VirtualDeviceManager & | vdm_ |
ctpl::thread_pool & | thread_pool_ |
std::queue< IncomingMachineMessage > | incoming_message_queue_ |
Notifier & | notifier_ |
WatchdogMachine::WatchdogMachine | ( | VirtualDeviceManager & | vdm, |
ctpl::thread_pool & | thread_pool, | ||
Notifier & | notifier, | ||
moodycamel::ReaderWriterQueue< OutgoingMachineMessage > & | outgoing_machine_message_queue | ||
) |
The watchdog on the Motion Master is a process that runs on each cycle, ideally every 1ms. If the previous execution took longer than one second, it checks which drives are not in the OP state. For any devices not in OP, it sends an error message indicating that they cannot be switched into the OP EtherCAT state. A communication warning usually precedes this error, indicating that the Motion Master has detected that the device has entered the SAFE-OP state. The warning is sent only if the drive has been previously initialized (i.e., it has parameters) and was already in the OP state.
NOTE: The condition "if (++counter_ == 7 + vdm_.get_devices().size())" is not entirely clear and may require further verification.
|
overridevirtual |
Abort all of the requests a certain client has issues.
connection_id | client connection ID |
Implements Machine.
|
overridevirtual |
Check if all of the machine started processes are done (including the Command Workers)
Implements Machine.
|
overridevirtual |
Execute the machine.
pending_signals | number of time intervals that passed since the last call to this function |
Implements Machine.
void WatchdogMachine::start | ( | ) |
void WatchdogMachine::stop | ( | ) |