refman
refman
1 Namespace Index 1
2 Hierarchical Index 3
3 Class Index 5
4 Namespace Documentation 7
5 Class Documentation 9
5.1.1.1 ClearAllParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.1.1.2 serialize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.1.1.3 setService() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.2.1.1 GetResponseData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2.1.2 Parse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.3.1.1 AddItem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
ii CONTENTS
5.3.1.2 ClearAllParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3.1.3 GetDataByItemIndex() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3.1.4 GetDataByItemType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.1.5 Parse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.1.6 serialize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.5.1.1 CyclicConsumer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5.2.1 Dispose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5.2.2 SetCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5.2.3 ThreadEntry() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.6.1.1 CyclicProducer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.6.2.1 Dispose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.6.2.2 SetPacketInterval() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.6.2.3 SuspendProduction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.6.2.4 ThreadEntry() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.8.1.1 CloseAllConnections() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.8.1.2 CloseIoSocketReceive() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.8.1.3 CloseUCMM() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.8.1.4 CreateInboundConnections() . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.8.1.5 CreateIoSocketReceive() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Generated by Doxygen
CONTENTS iii
5.8.1.6 CreateIoSocketReceiveMulticast() . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.8.1.7 CreateIoSocketSend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.8.1.8 GetTimeouts() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.8.1.9 LeaveMulticastGroup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.8.1.10 OpenUCMM() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.8.1.11 receive() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.8.1.12 receiveIO() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.8.1.13 receiveReply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.8.1.16 sendIO() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.8.1.17 SetTimeouts() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.9.1.1 FileLogging() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.9.2.1 Close() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.9.2.2 LogString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.10.1.1 GetAllLocalIPv4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.10.1.2 hexify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.10.1.5 IPAddresstoUint() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.10.1.6 IsValidHexChar() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.10.1.7 IsValidHexString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.10.1.8 MACaddressify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.10.1.9 MessageToHumanReadableString() . . . . . . . . . . . . . . . . . . . . . . . . 31
5.10.1.10 ParseInto() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Generated by Doxygen
iv CONTENTS
5.11.1.1 Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.11.1.2 TransportClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.11.1.3 TransportType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.11.1.4 Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.11.2.1 BuildNetworkConnectionParametersBitstring() . . . . . . . . . . . . . . . . . . 34
5.11.2.2 BuildTransportClassTriggerBitstring() . . . . . . . . . . . . . . . . . . . . . . . 35
5.11.2.3 CallServiceRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.11.2.4 CallServiceRequest_Connected() . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.11.2.5 CallServiceRequest_Keyed() . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.11.2.6 CipServiceRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.11.2.7 CipServiceRequest_Connected() . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.11.2.8 ForwardCloseRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.11.2.9 ForwardOpenRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.11.2.10 ForwardOpenRequest_withSockAddrItem() . . . . . . . . . . . . . . . . . . . . 39
5.11.2.11 GetAttributesAllRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.11.2.12 GetAttributesAllRequest_Connected() . . . . . . . . . . . . . . . . . . . . . . . 40
5.11.2.13 GetAttributesAllRequest_Keyed() . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.11.2.14 GetAttributeSingleRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.11.2.15 GetAttributeSingleRequest_Connected() . . . . . . . . . . . . . . . . . . . . . 42
5.11.2.16 GetAttributeSingleRequest_Keyed() . . . . . . . . . . . . . . . . . . . . . . . . 42
5.11.2.17 ListIdentityRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.11.2.18 ListIdentityResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.11.2.19 ListServicesReqest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.11.2.20 RegisterSessionRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.11.2.21 SetAttributeSingleRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.11.2.22 SetAttributeSingleRequest_Connected() . . . . . . . . . . . . . . . . . . . . . 46
5.11.2.23 SetAttributeSingleRequest_Keyed() . . . . . . . . . . . . . . . . . . . . . . . . 46
Generated by Doxygen
CONTENTS v
5.11.2.24 SwapIntBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.11.2.25 SwapUdintBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.11.2.26 SwapUintBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.11.2.27 UnregisterSessionRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.12 LibEtherNetIP.RequestPath Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.12.1 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.12.1.1 addAttributeId() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.12.1.2 addAttributeIdSegment16Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.12.1.3 addAttributeIdSegment32Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.12.1.4 addAttributeIdSegment8Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.12.1.5 addClassId() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.12.1.6 addClassIdSegment16Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.12.1.7 addClassIdSegment32Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.12.1.8 addClassIdSegment8Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.12.1.9 addConnectionPoint() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.12.1.10 addConnectionPointSegment16Bit() . . . . . . . . . . . . . . . . . . . . . . . . 52
5.12.1.11 addConnectionPointSegment32Bit() . . . . . . . . . . . . . . . . . . . . . . . . 52
5.12.1.12 addConnectionPointSegment8Bit() . . . . . . . . . . . . . . . . . . . . . . . . 52
5.12.1.13 addElectronicKeySegment() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.12.1.14 addInstanceId() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.12.1.15 addInstanceIdSegment16Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.12.1.16 addInstanceIdSegment32Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.12.1.17 addInstanceIdSegment8Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.12.1.18 addLogicalSegment() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.12.1.19 addLogicalValue16Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.12.1.20 addLogicalValue32Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.12.1.21 addLogicalValue8Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.12.1.22 addMemberId() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.12.1.23 addMemberIdSegment16Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.12.1.24 addMemberIdSegment32Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.12.1.25 addMemberIdSegment8Bit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.12.1.26 clearRequestPath() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.12.1.27 getRequestPath() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.12.1.28 getRequestPathLength() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.13 LibEtherNetIP.SimpleScanner Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.14 LibEtherNetIP.StatusCodes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.14.1 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.14.1.1 GetCipExtendedStatusDescription() . . . . . . . . . . . . . . . . . . . . . . . . 56
5.14.1.2 GetCipGeneralStatusDescription() . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.14.1.3 GetEncapsulationStatusDescription() . . . . . . . . . . . . . . . . . . . . . . . 57
Generated by Doxygen
Chapter 1
Namespace Index
LibEtherNetIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Namespace Index
Generated by Doxygen
Chapter 2
Hierarchical Index
LibEtherNetIP.CipResponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
LibEtherNetIP.CommonPacketFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
LibEtherNetIP.EipCommunication.Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
LibEtherNetIP.SimpleScanner.DeviceIdentity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
LibEtherNetIP.EipCommunication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
LibEtherNetIP.FileLogging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
LibEtherNetIP.Helpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
IDisposable
LibEtherNetIP.CyclicConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
LibEtherNetIP.CyclicProducer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
LibEtherNetIP.Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
LibEtherNetIP.RequestPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
LibEtherNetIP.CipRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
LibEtherNetIP.SimpleScanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
LibEtherNetIP.StatusCodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4 Hierarchical Index
Generated by Doxygen
Chapter 3
Class Index
Here are the classes, structs, unions and interfaces with brief descriptions:
LibEtherNetIP.CipRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
LibEtherNetIP.CipResponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
LibEtherNetIP.CommonPacketFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
LibEtherNetIP.EipCommunication.Connection
A conection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
LibEtherNetIP.CyclicConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
LibEtherNetIP.CyclicProducer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
LibEtherNetIP.SimpleScanner.DeviceIdentity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
LibEtherNetIP.EipCommunication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
LibEtherNetIP.FileLogging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
LibEtherNetIP.Helpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
LibEtherNetIP.Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
LibEtherNetIP.RequestPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
LibEtherNetIP.SimpleScanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
LibEtherNetIP.StatusCodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6 Class Index
Generated by Doxygen
Chapter 4
Namespace Documentation
Classes
• class CipRequest
• class CipResponse
• class CommonPacketFormat
• class CyclicConsumer
• class CyclicProducer
• class EipCommunication
• class EncapsulationHeader
• class FileLogging
• class Helpers
• class Messages
• class RequestPath
• class Serialize
• class SimpleScanner
• class StatusCodes
8 Namespace Documentation
Generated by Doxygen
Chapter 5
Class Documentation
LibEtherNetIP.RequestPath
LibEtherNetIP.CipRequest
5.1.1.1 ClearAllParameters()
Reset the state of the CipRequest to teh initial state. This allows to start over with a new request (setting new values
& serializing)
10 Class Documentation
5.1.1.2 serialize()
Serialize the CIP service request into its binary string representation
Returns
5.1.1.3 setService()
Parameters
serviceCode
The documentation for this class was generated from the following file:
• CipRequestResponse.cs
Generated by Doxygen
5.3 LibEtherNetIP.CommonPacketFormat Class Reference 11
5.2.1.1 GetResponseData()
After having parsed a binary CIP response, get its payload data as binary string
Returns
5.2.1.2 Parse()
Parameters
Returns
The documentation for this class was generated from the following file:
• CipRequestResponse.cs
Generated by Doxygen
12 Class Documentation
5.3.1.1 AddItem()
Add an item with the given item type, length and data.
Parameters
type←- Item type
Id
lenght Item data length in bytes
data Item data
5.3.1.2 ClearAllParameters()
Reset the object to its initial state by clearing all items. This allows to start over, i.e. add new items and serialize
them into a new message.
5.3.1.3 GetDataByItemIndex()
Return the data part (binary string representation) of the item at the given zero-based item index.
Parameters
index Zero-based item index
Returns
Binary string of the data part of the item with the given index or null, if no such item index exists
Generated by Doxygen
5.3 LibEtherNetIP.CommonPacketFormat Class Reference 13
5.3.1.4 GetDataByItemType()
Return the data part (binary string representation) of the first item with the given item type or null if no such item is
present
Parameters
Returns
Binary string of the data part of the item with the given item type or null, if no such item index exists
5.3.1.5 Parse()
From the given binary string representation of a CPF-formatted message, parse the list of CPF items.
Parameters
Returns
5.3.1.6 serialize()
Serialize the currently contained items into the binary string representation
Returns
The documentation for this class was generated from the following file:
• CommonPacketFormat.cs
Generated by Doxygen
14 Class Documentation
A conection
Public Attributes
• Socket Socket
• bool Originator
• ulong SeqNo
• uint SessionId
A conection
The documentation for this class was generated from the following file:
• EipCommunication.cs
IDisposable
LibEtherNetIP.CyclicConsumer
Generated by Doxygen
5.5 LibEtherNetIP.CyclicConsumer Class Reference 15
5.5.1.1 CyclicConsumer()
LibEtherNetIP.CyclicConsumer.CyclicConsumer (
ReceiveFuncDelegate receiveFunc,
FileLogging logFile,
string threadName,
HandleMessageDelegate pushReceivedDataCallback ) [inline]
Parameters
5.5.2.1 Dispose()
5.5.2.2 SetCallback()
void LibEtherNetIP.CyclicConsumer.SetCallback (
HandleMessageDelegate pushReceivedDataCallback ) [inline]
Parameters
pushReceivedDataCallback
Generated by Doxygen
16 Class Documentation
5.5.2.3 ThreadEntry()
The documentation for this class was generated from the following file:
• CyclicConsumer.cs
IDisposable
LibEtherNetIP.CyclicProducer
5.6.1.1 CyclicProducer()
LibEtherNetIP.CyclicProducer.CyclicProducer (
SendFuncDelegate sendFunc,
FileLogging logFile,
string threadName,
BuildMessageDelegate getSendDataCallback,
int packet_interval,
string targetIp,
int port ) [inline]
Generated by Doxygen
5.6 LibEtherNetIP.CyclicProducer Class Reference 17
Parameters
sendFunc Function to send data to the network
logFile logfile for diagnostics, can be set to null
threadName thread name as it will appear in the logfile
getSendDataCallback callback to get data to send from the application called with each sent frame
packet_interval Send packet rate in [ms]
targetIp Target IP address in decimal, dotted string representation
port send port number
5.6.2.1 Dispose()
5.6.2.2 SetPacketInterval()
void LibEtherNetIP.CyclicProducer.SetPacketInterval (
int packet_interval ) [inline]
Parameters
packet_interval Packet send interval in [ms]
5.6.2.3 SuspendProduction()
void LibEtherNetIP.CyclicProducer.SuspendProduction (
bool fSuspend ) [inline]
Pause/unpause the production of frames. Can be used to test timeouts at the target side.
Parameters
fSuspend
Generated by Doxygen
18 Class Documentation
5.6.2.4 ThreadEntry()
The documentation for this class was generated from the following file:
• CyclicProducer.cs
• DeviceIdentity (ushort EncapsulationProtocolVersion, short sin_family, ushort sin_port, uint sin_addr, byte[ ]
sin_zero, ushort VendorId, ushort DeviceType, ushort ProductCode, byte[ ] Revision, ushort Status, uint
SerialNumber, string ProductName, byte State)
Public Attributes
• ushort EncapsulationProtocolVersion
• short sin_family
• ushort sin_port
• uint sin_addr
• byte [ ] sin_zero
• ushort VendorId
• ushort DeviceType
• ushort ProductCode
• byte [ ] Revision
• ushort Status
• uint SerialNumber
• string ProductName
• byte State
The documentation for this class was generated from the following file:
• SimpleScanner.cs
Classes
• class Connection
A conection
Generated by Doxygen
5.8 LibEtherNetIP.EipCommunication Class Reference 19
5.8.1.1 CloseAllConnections()
Generated by Doxygen
20 Class Documentation
5.8.1.2 CloseIoSocketReceive()
5.8.1.3 CloseUCMM()
Close the given UCMM connection whcih has been opened by a previous call to OpenUCMM().
Parameters
5.8.1.4 CreateInboundConnections()
Create an UDP socket, bind it to the local interface, set the send/receive timeouts. THis socket will be used to send
and receive non-IO UDP frames, i.e. ListIdentity requests and replies.
Parameters
local←- Local IPv4 address ind ecimal dotted notation of the network interface to bind to
_if
5.8.1.5 CreateIoSocketReceive()
Create a UDP receive socket bound to the given local interface and port
Generated by Doxygen
5.8 LibEtherNetIP.EipCommunication Class Reference 21
Parameters
5.8.1.6 CreateIoSocketReceiveMulticast()
Create a UDP multicast receive socket bound to the given local interface and port. IGMP-Join the multicast group
Parameters
5.8.1.7 CreateIoSocketSend()
Parameters
local←- Local IPv4 address ind ecimal dotted notation of the network interface to bind to
_if
5.8.1.8 GetTimeouts()
Returns
Generated by Doxygen
22 Class Documentation
5.8.1.9 LeaveMulticastGroup()
Let the given local interface leave the given multicast group (IGMP)
Parameters
5.8.1.10 OpenUCMM()
Open a UCMM connection to the given target IP address and return a handle to it.
Parameters
target←- Target IPv4 address in decimal dotted notation
_ip
Returns
5.8.1.11 receive()
BLocking receive on the given connection. If a RegistrSession reply is received, the contained session ID will be
stored with the connection and will be used in all subsequent sends for that connection.
Parameters
conn
Returns
Generated by Doxygen
5.8 LibEtherNetIP.EipCommunication Class Reference 23
5.8.1.12 receiveIO()
BLocking receive on the I/O receive socket (can be either unicast or multicast).
Returns
5.8.1.13 receiveReply()
Returns
Parameters
data Data to send in binary string representation
conn Connection to send the data on
Generated by Doxygen
24 Class Documentation
Parameters
data Data to send in binary string representation
5.8.1.16 sendIO()
Blocking send on the I/O send socket: Send the given data to the given host via the given port.
Returns
Parameters
host Peer IPv4 address in decimal dotted notation
port Target port number
5.8.1.17 SetTimeouts()
Set the send and receive timeout to the given value in [ms]
Parameters
The documentation for this class was generated from the following file:
• EipCommunication.cs
Generated by Doxygen
5.9 LibEtherNetIP.FileLogging Class Reference 25
Constructor
• void LogString (string line)
Write the given string into the logfile
• void Close ()
Close the logfile
5.9.1.1 FileLogging()
LibEtherNetIP.FileLogging.FileLogging (
string filename ) [inline]
Constructor
Parameters
5.9.2.1 Close()
5.9.2.2 LogString()
void LibEtherNetIP.FileLogging.LogString (
string line ) [inline]
Parameters
line
The documentation for this class was generated from the following file:
Generated by Doxygen
26 Class Documentation
• FileLogging.cs
5.10.1.1 GetAllLocalIPv4()
Return a list of all local IPv4 addresses that are available to be used on this system
Returns
5.10.1.2 hexify()
Convert the given integer value into a hex string represenation, prefixed with "0x"
Generated by Doxygen
5.10 LibEtherNetIP.Helpers Class Reference 27
Parameters
value IP address to convert
Returns
Convert the given IPv4 address into the decimal-dotted string representation
Parameters
value IP address to convert
Returns
Convert the IPv4 address in the given byte array into the decimal-dotted string representation
Parameters
value IP address to convert
Returns
5.10.1.5 IPAddresstoUint()
Generated by Doxygen
28 Class Documentation
Convert the given IPv4 address string (decimal, dotted), into the integer representation
Generated by Doxygen
5.10 LibEtherNetIP.Helpers Class Reference 29
Parameters
Returns
5.10.1.6 IsValidHexChar()
Parameters
c Character to test
Returns
5.10.1.7 IsValidHexString()
Test for all valid hex chars in given string [0-9, a-f, A-F]
Parameters
s String to test
Returns
5.10.1.8 MACaddressify()
Generated by Doxygen
30 Class Documentation
Assemble a string representation for MAC address in the given byte array
Generated by Doxygen
5.10 LibEtherNetIP.Helpers Class Reference 31
Parameters
Returns
5.10.1.9 MessageToHumanReadableString()
Convert the given binary message (bytestream, e.g., as assembled by the Messages module or as received on the
network) into a better-readable, nicely indended, ASCII hex notation.
Parameters
msg Message to pretty-print
Returns
Pretty-printed bytestream
5.10.1.10 ParseInto()
Parse from the given string into the given object of the given type
Parameters
Returns
The documentation for this class was generated from the following file:
• Helpers.cs
Generated by Doxygen
32 Class Documentation
Public Types
• string RegisterSessionRequest ()
Assemble an Encapsulation Layer RegisterSession request
• string UnregisterSessionRequest ()
Assemble an Encapsulation Layer UnregisterSession request
• string ListIdentityRequest ()
Assemble an Encapsulation Layer ListIdentity request
• string ListServicesReqest ()
Assemble an Encapsulation Layer ListServices request
• byte BuildTransportClassTriggerBitstring (bool isServer, Trigger trigger, TransportClass tclass)
From the given server bit, the transport trigger and the transport class, encode the corresponding bitstring to contain
in the forward open request.
• ushort BuildNetworkConnectionParametersBitstring (bool exclusiveOwner, TransportType ttype, Priority prio,
bool fixedSize, uint size)
From the given exclusive owner bit, the transport type, priority type, the fixed-size bit and the connection size, encode
the corresponding bitstring to contain in the forward open request.
• string ForwardOpenRequest (Trigger trigger, TransportType ttype_ot, TransportType ttype_to, Priority prio←-
_ot, Priority prio_to, uint rate_ot, uint rate_to, uint size_ot, uint size_to, bool isFixedSize_ot, bool isFixed←-
Size_to, bool isExclusiveOwner_ot, bool isExclusiveOwner_to, byte[ ] connectionPath, byte timeoutMultiplier,
TransportClass transportClass, bool isServer, ushort connectionSerialNumber)
Assemble a forward open request from the given parameters
• string ForwardOpenRequest_withSockAddrItem (Trigger trigger, TransportType ttype_ot, TransportType
ttype_to, Priority prio_ot, Priority prio_to, uint rate_ot, uint rate_to, uint size_ot, uint size_to, bool isFixed←-
Size_ot, bool isFixedSize_to, bool isExclusiveOwner_ot, bool isExclusiveOwner_to, byte[ ] connectionPath,
byte timeoutMultiplier, TransportClass transportClass, bool isServer, ushort connectionSerialNumber, ushort
port)
Assemble a forward open request from the given parameters, adding an additinal sockaddr item to tell the target the
port information for I/O frame sending.
• string ForwardCloseRequest (ushort connectionSerialNumber, byte[ ] requestPath)
Assemble a forward close request from the given parameters.
• short SwapIntBytes (short value)
Swap bytes of a CIP INT
• ushort SwapUintBytes (ushort value)
Swap bytes of a CIP UINT
• uint SwapUdintBytes (uint value)
Swap bytes of a CIP UDINT
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 33
• void ListIdentityResponse (string msg, out ushort EncapsulationProtocolVersion, out short sin_family, out
ushort sin_port, out uint sin_addr, out byte[ ] sin_zero, out ushort VendorId, out ushort DeviceType, out ushort
ProductCode, out byte[ ] Revision, out ushort Status, out uint SerialNumber, out string ProductName, out byte
State)
Deserialize a ListIdentity response from the string representation into the given parameters
• string CallServiceRequest_Connected (uint connectionId, ushort sequenceCount, uint classId, uint
instanceId, byte serviceId, string sParamData)
Assemble a "connected" (CL3) service request from the given parameters
• string CallServiceRequest (uint classId, uint instanceId, byte serviceId, string sParamData)
Assemble a "unconnected" (UCMM) service request from the given parameters
• string CallServiceRequest_Keyed (uint classId, uint instanceId, byte serviceId, string sParamData, ushort
vendorId, ushort deviceType, ushort productCode, byte majorRev, byte minorRev, bool fCompatibility)
Assemble a "unconnected" (UCMM) service request with electronic keying from the given parameters
• string SetAttributeSingleRequest_Connected (uint connectionId, ushort sequenceCount, uint classId, uint
instanceId, uint attributeId, string sData)
Assemble a "connected" (CL3) SetAttributeSingle service request from the given parameters
• string SetAttributeSingleRequest (uint classId, uint instanceId, uint attributeId, string sData)
Assemble a "unconnected" (UCMM) SetAttributeSingle service request from the given parameters
• string SetAttributeSingleRequest_Keyed (uint classId, uint instanceId, uint attributeId, string sData, ushort
vendorId, ushort deviceType, ushort productCode, byte majorRev, byte minorRev, bool fCompatibility)
Assemble a "unconnected" (UCMM) SetAttributeSingle service request with electronic keying from the given param-
eters
• string GetAttributeSingleRequest_Connected (uint connectionId, ushort sequenceCount, uint classId, uint
instanceId, uint attributeId)
Assemble a "connected" (CL3) GetAttributeSingle service request from the given parameters
• string GetAttributeSingleRequest (uint classId, uint instanceId, uint attributeId)
Assemble a "unconnected" (UCMM) GetAttributeSingle service request from the given parameters
• string GetAttributeSingleRequest_Keyed (uint classId, uint instanceId, uint attributeId, ushort vendorId, ushort
deviceType, ushort productCode, byte majorRev, byte minorRev, bool fCompatibility)
Assemble a "unconnected" (UCMM) GetAttributeSingle service request with electronic keying from the given param-
eters
• string GetAttributesAllRequest (uint classId, uint instanceId)
Assemble an "unconnected" (UCMM) GetAttributesAll request.
• string GetAttributesAllRequest_Keyed (uint classId, uint instanceId, ushort vendorId, ushort deviceType,
ushort productCode, byte majorRev, byte minorRev, bool fCompatibility)
Assemble an "unconnected" (UCMM) GetAttributesAll request with electronic keying
• string GetAttributesAllRequest_Connected (uint connectionId, ushort sequenceCount, uint classId, uint
instanceId)
Assemble a "connected" (CL3) GetAttributesAll service request from the given parameters
• string CipServiceRequest (byte serviceId, uint classId, uint instanceId, uint attributeId, string sData)
Assemble an "unconnected" (UCMM) CIP service request request from the given parameters
• string CipServiceRequest_Connected (uint connectionId, ushort sequenceCount, byte serviceId, uint classId,
uint instanceId, uint attributeId, string sData)
Assemble an "connected" (CL3) CIP service request request from the given parameters
Generated by Doxygen
34 Class Documentation
5.11.1.1 Priority
5.11.1.2 TransportClass
5.11.1.3 TransportType
5.11.1.4 Trigger
5.11.2.1 BuildNetworkConnectionParametersBitstring()
ushort LibEtherNetIP.Messages.BuildNetworkConnectionParametersBitstring (
bool exclusiveOwner,
TransportType ttype,
Priority prio,
bool fixedSize,
uint size ) [inline]
From the given exclusive owner bit, the transport type, priority type, the fixed-size bit and the connection size,
encode the corresponding bitstring to contain in the forward open request.
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 35
5.11.2.2 BuildTransportClassTriggerBitstring()
byte LibEtherNetIP.Messages.BuildTransportClassTriggerBitstring (
bool isServer,
Trigger trigger,
TransportClass tclass ) [inline]
From the given server bit, the transport trigger and the transport class, encode the corresponding bitstring to contain
in the forward open request.
5.11.2.3 CallServiceRequest()
string LibEtherNetIP.Messages.CallServiceRequest (
uint classId,
uint instanceId,
byte serviceId,
string sParamData ) [inline]
Parameters
Returns
5.11.2.4 CallServiceRequest_Connected()
string LibEtherNetIP.Messages.CallServiceRequest_Connected (
uint connectionId,
ushort sequenceCount,
uint classId,
uint instanceId,
byte serviceId,
string sParamData ) [inline]
Parameters
Returns
5.11.2.5 CallServiceRequest_Keyed()
string LibEtherNetIP.Messages.CallServiceRequest_Keyed (
uint classId,
uint instanceId,
byte serviceId,
string sParamData,
ushort vendorId,
ushort deviceType,
ushort productCode,
byte majorRev,
byte minorRev,
bool fCompatibility ) [inline]
Assemble a "unconnected" (UCMM) service request with electronic keying from the given parameters
Parameters
Returns
5.11.2.6 CipServiceRequest()
string LibEtherNetIP.Messages.CipServiceRequest (
byte serviceId,
uint classId,
uint instanceId,
uint attributeId,
string sData ) [inline]
Assemble an "unconnected" (UCMM) CIP service request request from the given parameters
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 37
Parameters
Returns
5.11.2.7 CipServiceRequest_Connected()
string LibEtherNetIP.Messages.CipServiceRequest_Connected (
uint connectionId,
ushort sequenceCount,
byte serviceId,
uint classId,
uint instanceId,
uint attributeId,
string sData ) [inline]
Assemble an "connected" (CL3) CIP service request request from the given parameters
Parameters
Returns
5.11.2.8 ForwardCloseRequest()
string LibEtherNetIP.Messages.ForwardCloseRequest (
ushort connectionSerialNumber,
byte [ ] requestPath ) [inline]
Generated by Doxygen
38 Class Documentation
Parameters
Returns
5.11.2.9 ForwardOpenRequest()
string LibEtherNetIP.Messages.ForwardOpenRequest (
Trigger trigger,
TransportType ttype_ot,
TransportType ttype_to,
Priority prio_ot,
Priority prio_to,
uint rate_ot,
uint rate_to,
uint size_ot,
uint size_to,
bool isFixedSize_ot,
bool isFixedSize_to,
bool isExclusiveOwner_ot,
bool isExclusiveOwner_to,
byte [ ] connectionPath,
byte timeoutMultiplier,
TransportClass transportClass,
bool isServer,
ushort connectionSerialNumber ) [inline]
Parameters
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 39
Parameters
timeoutMultiplier Timeout multiplier, see spec. for mappings betwen values and actual timeout
multipliers
transportClass Transport class of the connection
isServer Server bit to encode in the forward open frame, see spec.
connectionSerialNumber
Returns
5.11.2.10 ForwardOpenRequest_withSockAddrItem()
string LibEtherNetIP.Messages.ForwardOpenRequest_withSockAddrItem (
Trigger trigger,
TransportType ttype_ot,
TransportType ttype_to,
Priority prio_ot,
Priority prio_to,
uint rate_ot,
uint rate_to,
uint size_ot,
uint size_to,
bool isFixedSize_ot,
bool isFixedSize_to,
bool isExclusiveOwner_ot,
bool isExclusiveOwner_to,
byte [ ] connectionPath,
byte timeoutMultiplier,
TransportClass transportClass,
bool isServer,
ushort connectionSerialNumber,
ushort port ) [inline]
Assemble a forward open request from the given parameters, adding an additinal sockaddr item to tell the target the
port information for I/O frame sending.
Parameters
Generated by Doxygen
40 Class Documentation
Parameters
Returns
5.11.2.11 GetAttributesAllRequest()
string LibEtherNetIP.Messages.GetAttributesAllRequest (
uint classId,
uint instanceId ) [inline]
Parameters
Returns
5.11.2.12 GetAttributesAllRequest_Connected()
string LibEtherNetIP.Messages.GetAttributesAllRequest_Connected (
uint connectionId,
ushort sequenceCount,
uint classId,
uint instanceId ) [inline]
Assemble a "connected" (CL3) GetAttributesAll service request from the given parameters
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 41
Parameters
Returns
5.11.2.13 GetAttributesAllRequest_Keyed()
string LibEtherNetIP.Messages.GetAttributesAllRequest_Keyed (
uint classId,
uint instanceId,
ushort vendorId,
ushort deviceType,
ushort productCode,
byte majorRev,
byte minorRev,
bool fCompatibility ) [inline]
Parameters
Returns
5.11.2.14 GetAttributeSingleRequest()
string LibEtherNetIP.Messages.GetAttributeSingleRequest (
uint classId,
uint instanceId,
uint attributeId ) [inline]
Assemble a "unconnected" (UCMM) GetAttributeSingle service request from the given parameters
Generated by Doxygen
42 Class Documentation
Parameters
Returns
5.11.2.15 GetAttributeSingleRequest_Connected()
string LibEtherNetIP.Messages.GetAttributeSingleRequest_Connected (
uint connectionId,
ushort sequenceCount,
uint classId,
uint instanceId,
uint attributeId ) [inline]
Assemble a "connected" (CL3) GetAttributeSingle service request from the given parameters
Parameters
Returns
5.11.2.16 GetAttributeSingleRequest_Keyed()
string LibEtherNetIP.Messages.GetAttributeSingleRequest_Keyed (
uint classId,
uint instanceId,
uint attributeId,
ushort vendorId,
ushort deviceType,
ushort productCode,
byte majorRev,
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 43
byte minorRev,
bool fCompatibility ) [inline]
Assemble a "unconnected" (UCMM) GetAttributeSingle service request with electronic keying from the given pa-
rameters
Generated by Doxygen
44 Class Documentation
Parameters
Returns
5.11.2.17 ListIdentityRequest()
Returns
5.11.2.18 ListIdentityResponse()
void LibEtherNetIP.Messages.ListIdentityResponse (
string msg,
out ushort EncapsulationProtocolVersion,
out short sin_family,
out ushort sin_port,
out uint sin_addr,
out byte [ ] sin_zero,
out ushort VendorId,
out ushort DeviceType,
out ushort ProductCode,
out byte [ ] Revision,
out ushort Status,
out uint SerialNumber,
out string ProductName,
out byte State ) [inline]
Deserialize a ListIdentity response from the string representation into the given parameters
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 45
Parameters
msg ListIdentity response as string
EncapsulationProtocolVersion Decoded Encap. Prot. Version
sin_family Decoded sin_family
sin_port Decoded sin_port
sin_addr Decoded sin_addr
sin_zero Decoded sin_zero
VendorId Decoded vendor ID
DeviceType Decoded device Type
ProductCode Decoded Product code
Revision Decoded revision
Status Decoded status
SerialNumber Decoded serial number
ProductName Decoded product name
State Decoded State
5.11.2.19 ListServicesReqest()
Returns
5.11.2.20 RegisterSessionRequest()
Returns
5.11.2.21 SetAttributeSingleRequest()
string LibEtherNetIP.Messages.SetAttributeSingleRequest (
uint classId,
uint instanceId,
uint attributeId,
string sData ) [inline]
Assemble a "unconnected" (UCMM) SetAttributeSingle service request from the given parameters
Generated by Doxygen
46 Class Documentation
Parameters
Returns
5.11.2.22 SetAttributeSingleRequest_Connected()
string LibEtherNetIP.Messages.SetAttributeSingleRequest_Connected (
uint connectionId,
ushort sequenceCount,
uint classId,
uint instanceId,
uint attributeId,
string sData ) [inline]
Assemble a "connected" (CL3) SetAttributeSingle service request from the given parameters
Parameters
Returns
5.11.2.23 SetAttributeSingleRequest_Keyed()
string LibEtherNetIP.Messages.SetAttributeSingleRequest_Keyed (
uint classId,
uint instanceId,
uint attributeId,
string sData,
Generated by Doxygen
5.11 LibEtherNetIP.Messages Class Reference 47
ushort vendorId,
ushort deviceType,
ushort productCode,
byte majorRev,
byte minorRev,
bool fCompatibility ) [inline]
Assemble a "unconnected" (UCMM) SetAttributeSingle service request with electronic keying from the given pa-
rameters
Parameters
Returns
5.11.2.24 SwapIntBytes()
short LibEtherNetIP.Messages.SwapIntBytes (
short value ) [inline]
Parameters
value
Returns
Byte-swapped value
5.11.2.25 SwapUdintBytes()
uint LibEtherNetIP.Messages.SwapUdintBytes (
uint value ) [inline]
Generated by Doxygen
48 Class Documentation
Parameters
value
Returns
Byte-swapped value
5.11.2.26 SwapUintBytes()
ushort LibEtherNetIP.Messages.SwapUintBytes (
ushort value ) [inline]
Parameters
value
Returns
Byte-swapped value
5.11.2.27 UnregisterSessionRequest()
Returns
The documentation for this class was generated from the following file:
• Messages.cs
LibEtherNetIP.RequestPath
LibEtherNetIP.CipRequest
Generated by Doxygen
5.12 LibEtherNetIP.RequestPath Class Reference 49
Generated by Doxygen
50 Class Documentation
Add the given attribute ID point as logical attribute ID segment of appropriate size
• static byte getRequestPathLength ()
Get the current length of the request path, in number of words (each being a multiple of two bytes)
• static string getRequestPath ()
Get the current request path, in its string representation
• static void clearRequestPath ()
Reset the request path which has been built-up so far by adding logical segments. This brings this module back to its
initial state and allows to start over for constructing another request path.
5.12.1.1 addAttributeId()
Add the given attribute ID point as logical attribute ID segment of appropriate size
Parameters
attribute←- attribute ID value to add
Id
5.12.1.2 addAttributeIdSegment16Bit()
5.12.1.3 addAttributeIdSegment32Bit()
Generated by Doxygen
5.12 LibEtherNetIP.RequestPath Class Reference 51
5.12.1.4 addAttributeIdSegment8Bit()
5.12.1.5 addClassId()
Parameters
5.12.1.6 addClassIdSegment16Bit()
5.12.1.7 addClassIdSegment32Bit()
5.12.1.8 addClassIdSegment8Bit()
5.12.1.9 addConnectionPoint()
Add the given connection point as logical class ID segment of appropriate size
Generated by Doxygen
52 Class Documentation
Parameters
connectionPoint connection point value to add
5.12.1.10 addConnectionPointSegment16Bit()
5.12.1.11 addConnectionPointSegment32Bit()
5.12.1.12 addConnectionPointSegment8Bit()
5.12.1.13 addElectronicKeySegment()
Parameters
Generated by Doxygen
5.12 LibEtherNetIP.RequestPath Class Reference 53
5.12.1.14 addInstanceId()
Parameters
instance←- Instance ID value to add
Id
5.12.1.15 addInstanceIdSegment16Bit()
5.12.1.16 addInstanceIdSegment32Bit()
5.12.1.17 addInstanceIdSegment8Bit()
5.12.1.18 addLogicalSegment()
Parameters
Generated by Doxygen
54 Class Documentation
5.12.1.19 addLogicalValue16Bit()
5.12.1.20 addLogicalValue32Bit()
5.12.1.21 addLogicalValue8Bit()
5.12.1.22 addMemberId()
Parameters
member←- member ID value to add
Id
5.12.1.23 addMemberIdSegment16Bit()
Generated by Doxygen
5.12 LibEtherNetIP.RequestPath Class Reference 55
5.12.1.24 addMemberIdSegment32Bit()
5.12.1.25 addMemberIdSegment8Bit()
5.12.1.26 clearRequestPath()
Reset the request path which has been built-up so far by adding logical segments. This brings this module back to
its initial state and allows to start over for constructing another request path.
5.12.1.27 getRequestPath()
Returns
Request path which has been built up so far (by adding logical segments)
5.12.1.28 getRequestPathLength()
Get the current length of the request path, in number of words (each being a multiple of two bytes)
Returns
The documentation for this class was generated from the following file:
• RequestPath.cs
Generated by Doxygen
56 Class Documentation
Classes
• class DeviceIdentity
The documentation for this class was generated from the following file:
• SimpleScanner.cs
5.14.1.1 GetCipExtendedStatusDescription()
Get a human readable error message for the given CIP extended status codes.
Parameters
Returns
Error message
Generated by Doxygen
5.14 LibEtherNetIP.StatusCodes Class Reference 57
5.14.1.2 GetCipGeneralStatusDescription()
Get a human readable error message for the given CIP general status code.
Parameters
Returns
Error message
5.14.1.3 GetEncapsulationStatusDescription()
Get a human readable error message for the given CIP Encapsulation status code.
Parameters
Returns
Error message
The documentation for this class was generated from the following file:
• StatusCodes.cs
Generated by Doxygen
58 Class Documentation
Generated by Doxygen