undoBUS In Development
Fieldbus master implementations for the undoRT ecosystem — built on undoCore's IoBus interface.
Overview
undoBUS provides fieldbus master implementations that integrate seamlessly with
the undoRT ecosystem. Built on the IoBus interface defined in
undoCore, undoBUS will offer deterministic, real-time fieldbus
communication for industrial automation.
IoBus contract,
ensuring that any fieldbus protocol can be used interchangeably with undoPLC.
The bus drives the cycle timing — undoPLC is always the follower.
Architecture
undoBUS follows the IoBus synchronization protocol defined in undoCore:
/**
* Synchronization protocol:
*
* [Bus] cycleStart() → copyIn() → notifyPlc()
* [PLC] → execute() → notifyBus()
* [Bus] copyOut() → sendFrame()
*/
Core Components
| Component | Description | Status |
|---|---|---|
EtherCATMaster |
IgH EtherCAT Master wrapper with real-time scheduling | ● Planned |
ProfibusMaster |
Profibus DP master implementation | ● Future |
SimulatedBus |
Simulated fieldbus for testing and development | ● Planned |
IoBusAdapter |
Adapter for custom fieldbus implementations | ● Planned |
EtherCAT
The first fieldbus protocol to be supported by undoBUS is EtherCAT, using the IgH EtherCAT Master as the underlying stack.
Key Features (Planned)
- Real-time user-space operation
- Process Image mapping via
undoCore::ProcessImage - Distributed Clock (DC) synchronization
- Hot-connect / dynamic PDO mapping
- Diagnostic counters and error reporting
- Watchdog with safe-state handling
- IgH EtherCAT Master kernel module
- PREEMPT_RT kernel
- Root privileges for real-time scheduling
Anticipated API
#include
#include
using namespace undoCore;
using namespace undoBUS;
// 1024 inputs, 512 outputs
ProcessImage<1024, 512> pi;
// Configure and start EtherCAT master
EtherCATMaster bus("eth0", "/path/to/eni.xml", pi);
bus.start();
// PLC cycle — bus drives the timing
while (running) {
// Bus waits for cycle and copies inputs (copyIn)
if (!bus.waitCycle(1000)) {
// Watchdog timeout
break;
}
// PLC executes user logic (reads from pi, writes to pi)
plc.run();
// Notify bus that PLC is done
bus.notifyDone(); // bus calls copyOut() and sends frame
}
Profibus
Profibus DP master support is planned as a future extension. The implementation will follow
the same IoBus contract, ensuring protocol-agnostic integration with undoPLC.
Other Protocols
Additional fieldbus protocols are under evaluation based on community interest and industrial demand. Potential candidates include:
- • PROFINET — Industrial Ethernet standard
- • Modbus TCP/RTU — Widely used serial protocol
- • CANopen — CAN-based fieldbus
- • EtherNet/IP — ODVA industrial protocol
IoBus interface makes it straightforward
to add support for any fieldbus protocol. Contributions are welcome!
Integration with undoCore
undoBUS is built on undoCore, using:
IoBus— Abstract interface for all fieldbus mastersProcessImage— Double-buffered memory layout for I/Otypes.hpp— IEC 61131-3 type mapping
#include
class EtherCATMaster : public IoBus {
// Implements all IoBus virtual methods
// Uses ProcessImage for I/O mapping
};
Integration with undoPLC
undoPLC consumes the IoBus interface, making it completely agnostic to the
underlying fieldbus protocol:
// In undoPLC MasterTask
class DemoMasterTask : public UndoMasterTaskBase {
protected:
void readInputBus() override {
// Bus waits for cycle and copies inputs
if (!_bus->waitCycle(1000)) {
// Watchdog timeout
handleWatchdog();
}
}
void writeOutputBus() override {
// Bus copies outputs and sends frame
_bus->notifyDone();
}
};
IoBus interface — EtherCAT, Profibus, Modbus, or a simulated bus for testing.
Roadmap
| Milestone | Description | Status |
|---|---|---|
| v0.1.0 | Basic EtherCAT master wrapper with IoBus interface |
● Planned |
| v0.2.0 | Distributed Clock (DC) synchronization support | ● Future |
| v0.3.0 | Simulated bus for testing and development | ● Future |
| v1.0.0 | Production-ready EtherCAT master with full diagnostics | ● Future |
| v1.1.0 | Profibus DP master implementation | ● Future |
API Reference
Full API documentation will be generated with Doxygen when the first release is available: Browse API Reference
undoBUS