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

IOCR configuration derived from AR setup: timing parameters and IO object mappings needed for cyclic data exchange. More...

#include <rt.h>

+ Collaboration diagram for profinet::rt::IOCRConfig:

Public Member Functions

std::uint32_t CycleTimeUs () const
 Compute the cycle time in microseconds.
 
double CycleTimeMs () const
 Compute the cycle time in milliseconds.
 
std::uint32_t WatchdogTimeUs () const
 Compute the watchdog timeout in microseconds.
 
bool IsInput () const
 Whether this is an input (device -> controller) IOCR.
 
bool IsOutput () const
 Whether this is an output (controller -> device) IOCR.
 

Public Attributes

std::uint16_t typeIOCR = 0
 IOCR direction: 1=Input, 2=Output.
 
std::uint16_t referenceIOCR = 0
 IOCR reference assigned during AR establishment.
 
std::uint16_t frameId = 0
 Frame ID assigned to this IOCR.
 
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 phase = 0
 Phase offset within the reduction ratio.
 
std::uint16_t watchdogFactor = 3
 Watchdog factor (missed-frame tolerance before a timeout fault).
 
std::uint16_t dataLength = 40
 Total cyclic data length in bytes.
 
std::vector< IODataObjectobjects
 IO data objects carried in this IOCR's cyclic frame.
 

Detailed Description

IOCR configuration derived from AR setup: timing parameters and IO object mappings needed for cyclic data exchange.

Definition at line 125 of file rt.h.

Member Function Documentation

◆ CycleTimeMs()

double profinet::rt::IOCRConfig::CycleTimeMs ( ) const
inline

Compute the cycle time in milliseconds.

Returns
The cycle time in milliseconds.

Definition at line 167 of file rt.h.

References CycleTimeUs().

Referenced by profinet::cyclic::CyclicController::CheckCycleTime().

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

◆ CycleTimeUs()

std::uint32_t profinet::rt::IOCRConfig::CycleTimeUs ( ) const
inline

Compute the cycle time in microseconds.

Returns
The cycle time in microseconds.

Base clock is 31.25us per IEC 61158; cycle time = ReductionRatio * SendClockFactor * 31.25us (computed as ReductionRatio * SendClockFactor * 125 / 4 to stay in integer microseconds).

Definition at line 160 of file rt.h.

References reductionRatio, and sendClockFactor.

Referenced by CycleTimeMs(), profinet::cyclic::CyclicController::SendStopFrames(), profinet::cyclic::CyclicController::TxLoop(), and WatchdogTimeUs().

+ Here is the caller graph for this function:

◆ IsInput()

bool profinet::rt::IOCRConfig::IsInput ( ) const
inline

Whether this is an input (device -> controller) IOCR.

Returns
True if IocrType == IOCR_TYPE_INPUT.

Definition at line 181 of file rt.h.

References profinet::rt::IOCR_TYPE_INPUT, and typeIOCR.

◆ IsOutput()

bool profinet::rt::IOCRConfig::IsOutput ( ) const
inline

Whether this is an output (controller -> device) IOCR.

Returns
True if IocrType == IOCR_TYPE_OUTPUT.

Definition at line 188 of file rt.h.

References profinet::rt::IOCR_TYPE_OUTPUT, and typeIOCR.

◆ WatchdogTimeUs()

std::uint32_t profinet::rt::IOCRConfig::WatchdogTimeUs ( ) const
inline

Compute the watchdog timeout in microseconds.

Returns
WatchdogFactor cycles' worth of time, in microseconds.

Definition at line 174 of file rt.h.

References CycleTimeUs(), and watchdogFactor.

Referenced by profinet::cyclic::CyclicController::RxLoop().

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

Member Data Documentation

◆ dataLength

std::uint16_t profinet::rt::IOCRConfig::dataLength = 40

Total cyclic data length in bytes.

Definition at line 149 of file rt.h.

Referenced by profinet::rt::BuildIocrConfigs().

◆ frameId

std::uint16_t profinet::rt::IOCRConfig::frameId = 0

◆ objects

◆ phase

std::uint16_t profinet::rt::IOCRConfig::phase = 0

Phase offset within the reduction ratio.

Definition at line 143 of file rt.h.

Referenced by profinet::rt::BuildIocrConfigs().

◆ reductionRatio

std::uint16_t profinet::rt::IOCRConfig::reductionRatio = 32

Reduction ratio relative to the send clock.

Definition at line 140 of file rt.h.

Referenced by profinet::cyclic::CyclicController::CyclicController(), profinet::rt::BuildIocrConfigs(), and CycleTimeUs().

◆ referenceIOCR

std::uint16_t profinet::rt::IOCRConfig::referenceIOCR = 0

IOCR reference assigned during AR establishment.

Definition at line 131 of file rt.h.

Referenced by profinet::rt::BuildIocrConfigs().

◆ sendClockFactor

std::uint16_t profinet::rt::IOCRConfig::sendClockFactor = 32

Send clock base factor (31.25us units).

Definition at line 137 of file rt.h.

Referenced by profinet::cyclic::CyclicController::CyclicController(), profinet::rt::BuildIocrConfigs(), and CycleTimeUs().

◆ typeIOCR

std::uint16_t profinet::rt::IOCRConfig::typeIOCR = 0

IOCR direction: 1=Input, 2=Output.

Definition at line 128 of file rt.h.

Referenced by profinet::rt::BuildIocrConfigs(), IsInput(), and IsOutput().

◆ watchdogFactor

std::uint16_t profinet::rt::IOCRConfig::watchdogFactor = 3

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

Definition at line 146 of file rt.h.

Referenced by profinet::rt::BuildIocrConfigs(), and WatchdogTimeUs().


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