27inline constexpr std::uint16_t
RPC_PORT = 0x8894;
32inline const std::string
UUID_NULL =
"00000000-0000-0000-0000-000000000000";
34inline const std::string
UUID_EPM_V4 =
"e1af8308-5d1f-11c9-91a4-08002b14a0fa";
168 [[nodiscard]] std::vector<std::string>
Validate()
const;
182 std::array<std::uint8_t, uuidLenght>
arUuid{};
229 std::optional<PNInM0>
im0;
231 std::optional<PNInM1>
im1;
233 std::optional<PNInM2>
im2;
235 std::optional<PNInM3>
im3;
237 std::optional<PNInM4>
im4;
239 std::optional<PNInM5>
im5;
241 std::optional<PNInM6>
im6;
243 std::optional<PNInM7>
im7;
245 std::optional<PNInM8>
im8;
247 std::optional<PNInM9>
im9;
Declares PROFINET IO connection-management block structures and wire serialization.
PROFINET DCP discovery and device configuration interface.
constexpr std::uint16_t BLOCK_IOD_CONTROL_APP_READY_REQ
Block type: IODControlReqAppReady.
constexpr std::uint16_t CONTROL_CMD_DONE
Control command bit: Done.
constexpr std::uint16_t BLOCK_PRM_BEGIN_REQ
Block type: PrmBeginReq.
constexpr std::uint16_t CONTROL_CMD_PRM_BEGIN
Control command bit: PrmBegin.
const std::string UUID_PNIO_CONTROLLER
PROFINET IO-Controller interface UUID.
const std::string UUID_EPM_V4
Endpoint Mapper interface UUID.
constexpr double DEFAULT_TIMEOUT
Default RPC response timeout in seconds.
constexpr std::uint16_t BLOCK_IOD_CONTROL_RT_CLASS_3_REQ
Block type: IODControlReqRTClass3.
constexpr std::uint32_t PNIO_DEVICE_INTERFACE_VERSION
Interface version used for the PNIO device interface.
constexpr std::uint16_t BLOCK_IOD_CONTROL_PRM_END_REQ
Block type: IODControlReqPrmEnd.
constexpr std::uint16_t RPC_PORT
PROFINET IO RPC port (34964).
constexpr std::uint16_t BLOCK_RELEASE_REQ
Block type: IODReleaseReq.
constexpr std::uint16_t CONTROL_CMD_RELEASE
Control command bit: Release.
constexpr std::uint16_t CONTROL_CMD_READY_FOR_COMPANION
Control command bit: ReadyForCompanion.
constexpr std::uint16_t CONTROL_CMD_PRM_END
Control command bit: PrmEnd.
const std::string UUID_NULL
Null (all-zero) DCE/RPC UUID string.
constexpr std::uint16_t RPC_BIND_PORT
PROFINET IO RPC bind port (34965).
constexpr std::uint32_t EPM_INQUIRY_ALL
EPM inquiry type: all interfaces.
const std::string UUID_PNIO_DEVICE
PROFINET IO-Device interface UUID.
constexpr double CONNECTION_TIMEOUT
Maximum idle time in seconds before an AR is considered to need re-connection.
constexpr std::uint16_t CONTROL_CMD_APP_READY
Control command bit: ApplicationReady.
constexpr std::uint32_t EPM_INQUIRY_INTERFACE
EPM inquiry type: specific interface.
constexpr std::uint16_t CONTROL_CMD_READY_FOR_RT_CLASS_3
Control command bit: ReadyForRTClass3.
constexpr std::uint16_t BLOCK_IOD_CONTROL_APP_READY_RES
Block type: IODControlResAppReady.
constexpr std::uint32_t EPM_LOOKUP
EPM operation: Lookup.
std::vector< std::uint8_t > Bytes
Generic byte buffer alias used throughout the library for raw wire data.
All I&M records a device supports, read in one call.
std::optional< PNInM7 > im7
I&M7 (reserved), if supported.
std::optional< PNInM15 > im15
I&M15 (reserved), if supported.
std::optional< PNInM9 > im9
I&M9 (reserved), if supported.
std::optional< PNInM14 > im14
I&M14 (reserved), if supported.
std::optional< PNInM1 > im1
I&M1 (tag function/location), if supported.
std::optional< PNInM5 > im5
I&M5 (free-text annotation), if supported.
std::optional< PNInM10 > im10
I&M10 (reserved), if supported.
std::optional< PNInM3 > im3
I&M3 (free-text descriptor), if supported.
std::optional< PNInM6 > im6
I&M6 (reserved), if supported.
std::optional< PNInM13 > im13
I&M13 (reserved), if supported.
std::optional< PNInM11 > im11
I&M11 (reserved), if supported.
bool operator==(const AllIM &) const =default
Compares two AllIM for equality.
std::optional< PNInM2 > im2
I&M2 (installation date), if supported.
std::optional< PNInM12 > im12
I&M12 (reserved), if supported.
std::optional< PNInM4 > im4
I&M4 (PROFIsafe signature), if supported.
std::optional< PNInM0 > im0
I&M0 (mandatory identification data).
std::optional< PNInM8 > im8
I&M8 (reserved), if supported.
Result of a successful RPCCon::Connect() that also established cyclic IO.
std::array< std::uint8_t, uuidLenght > arUuid
AR UUID assigned to this connection.
bool HasCyclic() const
Whether cyclic IO was actually established.
int deviceAlarmRef
Device's local alarm reference, if an AlarmCR was also established.
std::uint16_t outputFrameId
Frame ID assigned to the output (controller -> device) IOCR.
std::uint16_t sessionKey
Session key for this connection.
std::uint16_t inputFrameId
Frame ID assigned to the input (device -> controller) IOCR.
Configuration for establishing cyclic IO alongside an AR.
std::uint16_t watchdogFactor
Watchdog factor (missed-frame tolerance before a timeout fault).
std::uint16_t dataHoldFactor
Data hold factor (how long to keep the last good frame's data).
std::vector< IOSlot > slots
Slots to include in the cyclic data frames.
bool operator==(const IOCRSetup &) const =default
Compares two IOCR configurations for equality.
std::vector< std::string > Validate() const
Sanity-check this configuration.
double CycleTimeMs() const
Compute the cycle time in milliseconds.
std::uint16_t reductionRatio
Reduction ratio relative to the send clock.
std::uint16_t sendClockFactor
Send clock base factor (31.25us units).
std::uint32_t CycleTimeUs() const
Compute the cycle time in microseconds from SendClockFactor/ReductionRatio.
One slot/subslot's expected module configuration and IO data sizes.
bool operator==(const IOSlot &) const =default
Compares two IO slot configurations for equality.
std::uint16_t inputLength
Expected input data length in bytes (0 if no input data).
std::uint16_t slot
Slot number.
std::uint16_t outputLength
Expected output data length in bytes (0 if no output data).
bool outputIoData
IODataObject for Output CR.
bool inputIoData
IODataObject for Input CR.
std::uint32_t moduleIdent
Expected module ident number.
std::uint32_t submoduleIdent
Expected submodule ident number.
std::uint16_t subslot
Subslot number.
Result of probing one index in EnumerateIndices().
std::uint8_t errorCode1
PNIOError ErrorCode1, if the error was a PNIOError.
std::string name
Human-readable name of the index.
std::size_t size
Payload size in bytes; valid when Status == "readable".
std::uint8_t errorCode2
PNIOError ErrorCode2, if the error was a PNIOError.
std::string error
Error message; valid when Status == "error".
std::string status
Probe outcome: "readable", "empty", or "error".
Configuration options for an RPC connection.
double timeoutSec
Timeout in seconds for RPC operations.
std::uint16_t rpcPort
UDP port used for RPC communication.
A single write operation for WriteMultiple().
std::uint16_t slot
Slot number.
Bytes data
Record data to write.
std::uint32_t api
API number.
std::uint16_t subslot
Subslot number.
std::uint16_t index
Record data index to write.