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

Describes one logical process-data signal available from a GSDML device. More...

#include <IOSignal.h>

+ Collaboration diagram for profinet::io::IoSignal:

Public Member Functions

bool IsBitSignal () const noexcept
 Returns whether this signal represents one BitDataItem.
 
bool IsSensor () const noexcept
 Returns whether this signal is an input/sensor.
 
bool IsActuator () const noexcept
 Returns whether this signal is an output/actuator.
 
bool IsDoubleCompatible () const noexcept
 Returns whether this signal can be represented by the IO connector's double field.
 
bool operator== (const IoSignal &) const =default
 Equality comparison for tests and catalogue validation.
 

Public Attributes

IoSignalDirection direction = IoSignalDirection::Sensor
 Sensor or actuator direction.
 
std::string name
 Current display name of the signal.
 
std::string textId
 Original GSDML TextId.
 
bool bitSignal = false
 Whether this logical signal originated from a BitDataItem.
 
std::size_t bitOffset = 0
 Bit offset within the containing DataItem.
 
std::size_t parentDataItemByteOffset = 0
 Byte offset of the parent DataItem.
 
std::string parentDataItemTextId
 TextId of the parent DataItem.
 
std::string gsdmlDataType
 GSDML DataType string.
 
IoSignalValueType valueType = IoSignalValueType::Unsupported
 Logical value category inferred from gsdmlDataType.
 
bool doubleCompatible = false
 Whether the connector can represent this logical value using its double field.
 
std::string moduleId
 GSDML module identifier containing the signal.
 
std::string moduleName
 Human-readable module name, when supplied by the GSDML.
 
std::string submoduleId
 GSDML submodule identifier containing the signal.
 
std::string submoduleName
 Human-readable submodule name, when supplied by the GSDML.
 
std::uint32_t moduleIdentNumber = 0
 Module ident number of the containing module.
 
std::uint32_t submoduleIdentNumber = 0
 Submodule ident number of the containing submodule.
 
std::size_t byteOffset = 0
 Byte offset within the submodule's input or output process-data area.
 
std::size_t byteLength = 0
 Size of the GSDML DataItem in bytes.
 
std::vector< int > possibleSlots
 Slots in which the containing module may occur, when known.
 
std::vector< int > possibleSubslots
 Subslots in which the containing submodule may occur, when known.
 

Detailed Description

Describes one logical process-data signal available from a GSDML device.

A signal is derived from one GSDML DataItem. The byteOffset is relative to the beginning of the corresponding Input or Output process-data area of the containing submodule. It is not an RTC1 frame offset.

The current GSDML data model exposes a DataItem's TextId but does not yet expose resolved DataItem text or BitDataItem children. Consequently, name uses textId as the current display-name source and bitOffset is intentionally not part of this first catalogue representation. Those details can be added to the GSDML model later without coupling this class to cyclic I/O.

Definition at line 82 of file IOSignal.h.

Member Function Documentation

◆ IsActuator()

bool profinet::io::IoSignal::IsActuator ( ) const
noexcept

Returns whether this signal is an output/actuator.

Definition at line 423 of file IOSignal.cpp.

References profinet::io::Actuator, and direction.

Referenced by profinet::io::TEST(), and profinet::gsdml::TEST_F().

+ Here is the caller graph for this function:

◆ IsBitSignal()

bool profinet::io::IoSignal::IsBitSignal ( ) const
noexcept

Returns whether this signal represents one BitDataItem.

Definition at line 413 of file IOSignal.cpp.

References bitSignal.

Referenced by profinet::gsdml::TEST_F().

+ Here is the caller graph for this function:

◆ IsDoubleCompatible()

bool profinet::io::IoSignal::IsDoubleCompatible ( ) const
noexcept

Returns whether this signal can be represented by the IO connector's double field.

Definition at line 428 of file IOSignal.cpp.

References doubleCompatible.

Referenced by profinet::sim::VirtualPhoenixPlc::EncodeSignalValue(), and profinet::io::TEST().

+ Here is the caller graph for this function:

◆ IsSensor()

bool profinet::io::IoSignal::IsSensor ( ) const
noexcept

Returns whether this signal is an input/sensor.

Definition at line 418 of file IOSignal.cpp.

References direction, and profinet::io::Sensor.

Referenced by profinet::io::TEST(), and profinet::gsdml::TEST_F().

+ Here is the caller graph for this function:

◆ operator==()

bool profinet::io::IoSignal::operator== ( const IoSignal &  ) const
default

Equality comparison for tests and catalogue validation.

Member Data Documentation

◆ bitOffset

std::size_t profinet::io::IoSignal::bitOffset = 0

Bit offset within the containing DataItem.

Only meaningful when bitSignal is true. The actual byte containing this bit is byteOffset + (bitOffset / 8).

Definition at line 101 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ bitSignal

bool profinet::io::IoSignal::bitSignal = false

Whether this logical signal originated from a BitDataItem.

Definition at line 94 of file IOSignal.h.

Referenced by IsBitSignal().

◆ byteLength

◆ byteOffset

◆ direction

IoSignalDirection profinet::io::IoSignal::direction = IoSignalDirection::Sensor

Sensor or actuator direction.

Definition at line 85 of file IOSignal.h.

Referenced by IsActuator(), IsSensor(), and profinet::io::TEST().

◆ doubleCompatible

bool profinet::io::IoSignal::doubleCompatible = false

Whether the connector can represent this logical value using its double field.

Numeric range/precision validation belongs to the future encoding layer.

Definition at line 126 of file IOSignal.h.

Referenced by IsDoubleCompatible(), and profinet::io::TEST().

◆ gsdmlDataType

std::string profinet::io::IoSignal::gsdmlDataType

GSDML DataType string.

Definition at line 119 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F().

◆ moduleId

std::string profinet::io::IoSignal::moduleId

GSDML module identifier containing the signal.

Definition at line 129 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F(), profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ moduleIdentNumber

std::uint32_t profinet::io::IoSignal::moduleIdentNumber = 0

Module ident number of the containing module.

Definition at line 141 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F(), profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ moduleName

std::string profinet::io::IoSignal::moduleName

Human-readable module name, when supplied by the GSDML.

Definition at line 132 of file IOSignal.h.

◆ name

std::string profinet::io::IoSignal::name

◆ parentDataItemByteOffset

std::size_t profinet::io::IoSignal::parentDataItemByteOffset = 0

Byte offset of the parent DataItem.

For normal signals this is equal to byteOffset. For bit signals this is the offset of the complete parent DataItem before applying BitOffset / 8.

Definition at line 109 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F().

◆ parentDataItemTextId

std::string profinet::io::IoSignal::parentDataItemTextId

TextId of the parent DataItem.

This is populated for BitDataItem-derived signals and allows the runtime layer to identify the containing process-data byte/value.

Definition at line 116 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ possibleSlots

std::vector<int> profinet::io::IoSignal::possibleSlots

Slots in which the containing module may occur, when known.

An empty list means the GSDML did not provide slot information through the parsed module reference. It does not mean that no slot is valid.

Definition at line 155 of file IOSignal.h.

Referenced by profinet::sim::VirtualPhoenixPlc::ResolveDeviceLocation(), profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ possibleSubslots

std::vector<int> profinet::io::IoSignal::possibleSubslots

Subslots in which the containing submodule may occur, when known.

An empty list means the GSDML did not provide subslot information through the parsed submodule reference. It does not mean that no subslot is valid.

Definition at line 160 of file IOSignal.h.

Referenced by profinet::sim::VirtualPhoenixPlc::ResolveDeviceLocation(), profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ submoduleId

std::string profinet::io::IoSignal::submoduleId

GSDML submodule identifier containing the signal.

Definition at line 135 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F(), profinet::gsdml::TEST_F(), profinet::gsdml::TEST_F(), profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ submoduleIdentNumber

std::uint32_t profinet::io::IoSignal::submoduleIdentNumber = 0

Submodule ident number of the containing submodule.

Definition at line 144 of file IOSignal.h.

Referenced by profinet::gsdml::TEST_F(), profinet::gsdml::TEST_F(), and profinet::gsdml::TEST_F().

◆ submoduleName

std::string profinet::io::IoSignal::submoduleName

Human-readable submodule name, when supplied by the GSDML.

Definition at line 138 of file IOSignal.h.

◆ textId

◆ valueType

IoSignalValueType profinet::io::IoSignal::valueType = IoSignalValueType::Unsupported

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