Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::node::ProcessDataCyclicTask Class Reference

Game-loop task that exchanges one cycle of process data. More...

#include <process_data_cyclic_task.h>

Inheritance diagram for mm::node::ProcessDataCyclicTask:
[legend]
Collaboration diagram for mm::node::ProcessDataCyclicTask:
[legend]

Public Member Functions

 ProcessDataCyclicTask (DeviceManager &deviceManager)
 
void execute (const mm::core::CycleContext &) noexcept override
 Called once per cycle, after the exchange of process data and device parameters updated.
 
- Public Member Functions inherited from mm::core::CyclicTask
virtual ~CyclicTask ()=default
 Virtual destructor.
 

Detailed Description

Game-loop task that exchanges one cycle of process data.

Delegates to DeviceManager::exchangeProcessData, which is a no-op until a process image has been published (i.e. the devices are mapped and in SAFE-OP or OP). Registering it unconditionally is therefore safe: the RT loop drives PDO automatically as soon as the bus is configured, and stops again when it is torn down — no wiring changes per state.

Constructor & Destructor Documentation

◆ ProcessDataCyclicTask()

mm::node::ProcessDataCyclicTask::ProcessDataCyclicTask ( DeviceManager deviceManager)
inlineexplicit

Member Function Documentation

◆ execute()

void mm::node::ProcessDataCyclicTask::execute ( const mm::core::CycleContext ctx)
inlineoverridevirtualnoexcept

Called once per cycle, after the exchange of process data and device parameters updated.

Must return before the next cycle deadline. Blocking here stalls the entire RT loop.

**noexcept states the contract in the type.** This project returns std::expected and throws nothing, but a task is ordinary C++ and may call something that throws. Left implicit, such an exception would unwind out of the RT loop and reach std::terminate from wherever the stack happened to be. Declared here, the throw terminates at its own site instead, so the report names the line that threw rather than the loop that ran it. A task that can fail reports it through its own channel — a value it publishes, or a log line — never by throwing.

Parameters
ctxPer-cycle timing context (grid index + skipped count). Tasks that act only on the freshest state may ignore it.

Implements mm::core::CyclicTask.


The documentation for this class was generated from the following file: