nimbuscontrols / EIPScanner

Free implementation of EtherNet/IP in C++
https://eipscanner.readthedocs.io/en/latest/
MIT License
224 stars 90 forks source link

Implicit Messaging - SICK FX3-GEPR #100

Closed ThiloGaertner closed 10 months ago

ThiloGaertner commented 10 months ago

Describe the bug Hello together,

I'm very sure that this is not really a Bug, but I really dont know where else I could place this question instead. At the moment, I got stuck while implementing the Implicit Messages Parameter to "ForwardOpen" the Communication with Assembly 131 and 141.

To Reproduce Here is the parameter Setting I used for initialization:

Example:


    ConnectionManager connectionManager;
    ConnectionParameters parameters;
    parameters.o2tRealTimeFormat = true;
    parameters.t2oNetworkConnectionParams |= NetworkConnectionParams::P2P;
    parameters.t2oNetworkConnectionParams |= NetworkConnectionParams::SCHEDULED_PRIORITY;
    parameters.t2oNetworkConnectionParams |= 10;
    parameters.o2tNetworkConnectionParams |= NetworkConnectionParams::P2P;
    parameters.o2tNetworkConnectionParams |= NetworkConnectionParams::SCHEDULED_PRIORITY;
    parameters.o2tNetworkConnectionParams |= 10;  
    parameters.o2tRPI = 100000; //microseconds
    parameters.t2oRPI = 100000; //microseconds
    parameters.transportTypeTrigger |= NetworkConnectionParams::CLASS1;
    parameters.connectionPath = { 0x20, 0x04, 0x24 ,0x96,0x2C, 0x83, 0x2C, 0x8D};

    auto io = connectionManager.forwardOpen(si, parameters);

Logs


DEBUG] Opened TCP socket fd=12
[DEBUG] Connecting to 192.168.1.10:44818
[INFO] Registered session 83951616
[INFO] Send request: service=0x1 epath=[classId=1 objectId=1]
[ INFO] Vendor ID is: 808'
[ INFO] DeviceType is: 100'
[ INFO] ProductCode is: 10560'
[ INFO] Revision is: 1.3'
[ INFO] Status is: 48'
[ INFO] SerialNumber is: 1177462826'
[ INFO] ProductName is: FX3-GEPR'
[INFO] Send request: service=0x54 epath=[classId=6 objectId=1]
[ERROR] Message Router error=0x1 additional statuses [0x128][0x10]
[WARNING] Attempt to close an already closed connection
[INFO] Unregistered session 83951616
[DEBUG] Close TCP socket fd=12

Additional context If someone could give me a hint how to configure the Implicit Message for my device, I would be very grateful :) EDS-File of the Device is attached.

FX3-GEPR_SICK_V1-03.txt

ThiloGaertner commented 10 months ago

after further analysis with wireshark i was able to establish communication.

Solution:

// Implicit messaging
// see eds file of SICK GEPR
ConnectionManager connectionManager;
ConnectionParameters parameters;
parameters.o2tRealTimeFormat = true;
parameters.t2oRealTimeFormat = true;
parameters.t2oNetworkConnectionParams |= NetworkConnectionParams::P2P;
parameters.t2oNetworkConnectionParams |= NetworkConnectionParams::SCHEDULED_PRIORITY;
parameters.t2oNetworkConnectionParams |= 10;
parameters.o2tNetworkConnectionParams |= NetworkConnectionParams::P2P;
parameters.o2tNetworkConnectionParams |= NetworkConnectionParams::SCHEDULED_PRIORITY;
parameters.o2tNetworkConnectionParams |= 10;  
parameters.o2tRPI = 100000; //microseconds
parameters.t2oRPI = 100000; //microseconds
parameters.transportTypeTrigger |= NetworkConnectionParams::CLASS1;
parameters.transportTypeTrigger |= NetworkConnectionParams::TRIG_CYCLIC;
parameters.connectionPath = { 0x20, 0x04, 0x24 ,0x96,0x2C, 0x83, 0x2C, 0x8D}; //

Sorry for opening the Issue.

yuzhiboban commented 2 weeks ago

Can you tell me about the theory behind it. I just run the OpEner on my windows and run the example(https://eipscanner.readthedocs.io/en/latest/implicit_messaging.html) on WSL,then i meet this problem.