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< IODataObject > objects
 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 136 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 178 of file rt.h.

References CycleTimeUs().

Referenced by profinet::cyclic::CyclicController::CheckCycleTime(), and TEST_F().

+ 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 171 of file rt.h.

References reductionRatio, and sendClockFactor.

Referenced by CycleTimeMs(), profinet::sim::VirtualAumaValve::Run(), profinet::cyclic::CyclicController::SendStopFrames(), TEST_F(), 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 192 of file rt.h.

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

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ 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 199 of file rt.h.

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

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ 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 185 of file rt.h.

References CycleTimeUs(), and watchdogFactor.

Referenced by profinet::cyclic::CyclicController::RxLoop(), and TEST_F().

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

Member Data Documentation

◆ dataLength

◆ frameId

◆ objects

◆ phase

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

Phase offset within the reduction ratio.

Definition at line 154 of file rt.h.

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

◆ reductionRatio

◆ referenceIOCR

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

◆ sendClockFactor

◆ typeIOCR

◆ watchdogFactor


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