2

I use this library: https://github.com/rossmann-engineering/EEIP.NET to create an EtherNet/IP client and having a problem defining the O_T_Length data size.

This is the code I wrote. I expect it to insert the eeipClient.O_T_Length value of 34 to the data package, but the value I inspect on WireShark is 38

eeipClient.IPAddress = "192.168.2.172";

eeipClient.RegisterSession();

eeipClient.ConfigurationAssemblyInstanceID = 151;

eeipClient.O_T_InstanceID = 150;
eeipClient.O_T_Length = 32;
eeipClient.O_T_OwnerRedundant = false;
eeipClient.O_T_ConnectionType = Sres.Net.EEIP.ConnectionType.Point_to_Point;
eeipClient.RequestedPacketRate_O_T = 500000;

eeipClient.T_O_InstanceID = 100;
eeipClient.T_O_Length = 32;
eeipClient.T_O_OwnerRedundant = false;
eeipClient.T_O_ConnectionType = Sres.Net.EEIP.ConnectionType.Point_to_Point;
eeipClient.RequestedPacketRate_T_O = 500000;

eeipClient.ForwardOpen();

Going to the definition of ForwardOpen(), I see the following lines of code:

ushort num = 2;
if (O_T_RealTimeFormat == RealTimeFormat.Header32Bit) {
  num = 6;
}

if (O_T_RealTimeFormat == RealTimeFormat.Heartbeat) {
  num = 0;
}

ushort num4 = (ushort)(O_T_Length + num);

The initial value is 2, added to the O_T_Length I defined to be 32 will be 34. Somehow the result is 38.

[WireShark capture](https://i.stack.imgur.com/hVpI6.png)

Rafael
  • 1,281
  • 2
  • 10
  • 35
HV16
  • 25
  • 5

0 Answers0