PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::rpc::IOCRSetup Struct Reference

Configuration for establishing cyclic IO alongside an AR. More...

#include <rpcTypes.h>

+ Collaboration diagram for profinet::rpc::IOCRSetup:

Public Member Functions

std::uint32_t CycleTimeUs () const
 Compute the cycle time in microseconds from SendClockFactor/ReductionRatio.
 
double CycleTimeMs () const
 Compute the cycle time in milliseconds.
 
std::vector< std::string > Validate () const
 Sanity-check this configuration.
 
bool operator== (const IOCRSetup &) const =default
 Compares two IOCR configurations for equality.
 

Public Attributes

std::vector< IOSlotslots
 Slots to include in the cyclic data frames.
 
std::uint16_t sendClockFactor = 32
 Send clock base factor (31.25us units).
 
std::uint16_t reductionRatio = 32
 Reduction ratio relative to the send clock.
 
std::uint16_t watchdogFactor = 6
 Watchdog factor (missed-frame tolerance before a timeout fault).
 
std::uint16_t dataHoldFactor = 6
 Data hold factor (how long to keep the last good frame's data).
 
std::size_t dataLength = 43
 

Detailed Description

Configuration for establishing cyclic IO alongside an AR.

EXPERIMENTAL - NOT TESTED WITH REAL DEVICES. See rpc.py's IOCRSetup docstring for Python-GIL-driven cycle-time caveats (not applicable to this C++ port, but kept here as context since the block-building logic was ported as-is).

Definition at line 133 of file rpcTypes.h.

Member Function Documentation

◆ CycleTimeMs()

double profinet::rpc::IOCRSetup::CycleTimeMs ( ) const
inline

Compute the cycle time in milliseconds.

Returns
The cycle time in milliseconds.

Definition at line 161 of file rpcTypes.h.

References CycleTimeUs().

Referenced by Validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CycleTimeUs()

std::uint32_t profinet::rpc::IOCRSetup::CycleTimeUs ( ) const
inline

Compute the cycle time in microseconds from SendClockFactor/ReductionRatio.

Returns
The cycle time in microseconds.

Definition at line 154 of file rpcTypes.h.

References reductionRatio, and sendClockFactor.

Referenced by CycleTimeMs().

+ Here is the caller graph for this function:

◆ operator==()

bool profinet::rpc::IOCRSetup::operator== ( const IOCRSetup ) const
default

Compares two IOCR configurations for equality.

Two IOCR configurations are equal when all scalar configuration fields and their IO slot configurations are equal.

◆ Validate()

std::vector< std::string > profinet::rpc::IOCRSetup::Validate ( ) const

Sanity-check this configuration.

Returns
Human-readable warnings, if any (does not throw; caller decides what to do).

Definition at line 625 of file rpc.cpp.

References CycleTimeMs(), profinet::cyclic::MIN_CYCLE_MS, slots, and watchdogFactor.

+ Here is the call graph for this function:

Member Data Documentation

◆ dataHoldFactor

std::uint16_t profinet::rpc::IOCRSetup::dataHoldFactor = 6

Data hold factor (how long to keep the last good frame's data).

Definition at line 148 of file rpcTypes.h.

Referenced by profinet::rpc::RPCCon::BuildIocrBlock().

◆ dataLength

std::size_t profinet::rpc::IOCRSetup::dataLength = 43

Definition at line 150 of file rpcTypes.h.

Referenced by profinet::rpc::RPCCon::BuildIocrBlock().

◆ reductionRatio

std::uint16_t profinet::rpc::IOCRSetup::reductionRatio = 32

Reduction ratio relative to the send clock.

Definition at line 142 of file rpcTypes.h.

Referenced by profinet::rpc::RPCCon::BuildIocrBlock(), CycleTimeUs(), and profinet::device::ProfinetDevice::StartCyclic().

◆ sendClockFactor

std::uint16_t profinet::rpc::IOCRSetup::sendClockFactor = 32

Send clock base factor (31.25us units).

Definition at line 139 of file rpcTypes.h.

Referenced by profinet::rpc::RPCCon::BuildIocrBlock(), CycleTimeUs(), and profinet::device::ProfinetDevice::StartCyclic().

◆ slots

◆ watchdogFactor

std::uint16_t profinet::rpc::IOCRSetup::watchdogFactor = 6

Watchdog factor (missed-frame tolerance before a timeout fault).

Definition at line 145 of file rpcTypes.h.

Referenced by profinet::rpc::RPCCon::BuildIocrBlock(), profinet::device::ProfinetDevice::StartCyclic(), and Validate().


The documentation for this struct was generated from the following files: