PLCnext API Documentation  21.0.0.35466
AlarmPayload.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 
7 #pragma once
8 
9 
10 #include "Arp/System/Nm/SpecializedPayload.hpp"
11 
12 
13 namespace Arp { namespace System { namespace NmPayload { namespace Io { namespace ProfinetStack
14 {
15 
16 
21 {
22 public:
23  using SpecializedPayload::SpecializedPayload;
24 
40  AlarmPayload(const String& alarmType, const String& deviceName, uint16 slotNumber,
41  uint16 subslotNumber, uint32 moduleNumber, uint32 subModuleNumber, uint16 sequenceNumber,
42  bool isChannelDiagnosis, bool isManufacturerSpecificDiagnosis,
43  bool isSubmoduleDiagnosisState, bool isArDiagnosisState, const String& alarmText);
44 
46  String GetAlarmType() const;
47 
49  String GetDeviceName() const;
50 
52  uint16 GetSlotNumber() const;
53 
55  uint16 GetSubslotNumber() const;
56 
58  uint32 GetModuleNumber() const;
59 
61  uint32 GetSubModuleNumber() const;
62 
64  uint16 GetSequenceNumber() const;
65 
67  bool GetIsChannelDiagnosis() const;
68 
72 
74  bool GetIsSubmoduleDiagnosisState() const;
75 
78  bool GetIsArDiagnosisState() const;
79 
81  String GetAlarmText() const;
82 
83 private:
84  // Do not change the order of the field initialization!
85  size_t indexAlarmType = this->AddField<String>();
86  size_t indexDeviceName = this->AddField<String>();
87  size_t indexSlotNumber = this->AddField<uint16>();
88  size_t indexSubslotNumber = this->AddField<uint16>();
89  size_t indexModuleNumber = this->AddField<uint32>();
90  size_t indexSubModuleNumber = this->AddField<uint32>();
91  size_t indexSequenceNumber = this->AddField<uint16>();
92  size_t indexIsChannelDiagnosis = this->AddField<bool>();
93  size_t indexIsManufacturerSpecificDiagnosis = this->AddField<bool>();
94  size_t indexIsSubmoduleDiagnosisState = this->AddField<bool>();
95  size_t indexIsArDiagnosisState = this->AddField<bool>();
96  size_t indexAlarmText = this->AddField<String>();
97 };
98 
99 }}}}} // namespace Arp::System::NmPayload::Io::ProfinetStack
Payload class for a Profinet alarm
Definition: AlarmPayload.hpp:20
uint16 GetSubslotNumber() const
Returns the sub slot number
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:35
uint32 GetSubModuleNumber() const
Returns the sub module number
AlarmPayload(const String &alarmType, const String &deviceName, uint16 slotNumber, uint16 subslotNumber, uint32 moduleNumber, uint32 subModuleNumber, uint16 sequenceNumber, bool isChannelDiagnosis, bool isManufacturerSpecificDiagnosis, bool isSubmoduleDiagnosisState, bool isArDiagnosisState, const String &alarmText)
Creates a payload object
String GetAlarmText() const
Returns the alarm text if available
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:42
String GetDeviceName() const
Returns the Profinet device name
bool GetIsArDiagnosisState() const
Return s true if alarm is diagnostic information of the application reference
bool GetIsChannelDiagnosis() const
Returns true if alarm is a channel diagnosis
Root namespace for the PLCnext API
std::uint16_t uint16
The Arp unsigned integer type of 2 byte size.
Definition: PrimitiveTypes.hpp:31
uint16 GetSequenceNumber() const
Returns the sequence number
bool GetIsManufacturerSpecificDiagnosis() const
Return s true if alarm is manufacturer specific diagnosis
String GetAlarmType() const
Returns the alarm type
uint16 GetSlotNumber() const
Returns the slot number
System components used by the System, Device, Plc or Io domains.
uint32 GetModuleNumber() const
Returns the module number
bool GetIsSubmoduleDiagnosisState() const
Return s true if alarm is submodule diagnosis