Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valide SID, Query / Answer #15

Open
patbou74 opened this issue Nov 27, 2018 · 3 comments
Open

Valide SID, Query / Answer #15

patbou74 opened this issue Nov 27, 2018 · 3 comments

Comments

@patbou74
Copy link

patbou74 commented Nov 27, 2018

This is a problem of not validate the SID when returning information.
In my example, 2 nodes (10.20.100.254) have two query to the controller (Omron CJ2M) at the same time (frame 281, 282). For a reason (bug of the manufacturer) that I do not know, the two answers will come to the second node, because the PLC replaced the Dst Port (frame 283). Since it does not validate the SID ... it is that it causes bad data on the node.

Frame 281. Src Port 51123, Dst Port 9600, SID 0xbc, Query 50 Data, Sent by node 1
Frame 282. Src Port 33667, Dst Port 9600, SID 0Xbd, Query 10 Data, Sent by node 2
Frame 283. Src Port 9600, Dst Port 33667, SID 0Xbc, Answer 50 Data, Why PLC change Dst Port ??????????? I dont know ! But the node 2 was listening on this port
Frame 284. Src Port 9600, Dst Port 33667, SID 0Xbd, Answer 10 Data, OK !, Receive by node 2

The plc should not change the port, but ... node-omron-fins not valide de Service ID (SID)

image

image

image

image

Originally posted by @patbou74 in https://github.com/patrick--/node-omron-fins/issues/12#issuecomment-442228733

@patbou74 patbou74 changed the title Validation SID, Query / Answer Valide SID, Query / Answer Nov 27, 2018
@CharlieMarshall
Copy link
Contributor

Realise this issue was opened nearly 2 years ago. If I understand your problem correctly, your issue is that you have 2 clients accessing the same PLC via FINS and data is not ending up at the right place. I think this can be resolved by each node using a different SA1 number in the header, see lib/constants.js. This is what I do for different IP address accessing the same PLC

From the Omron manual:
SA1 Source node number. Specify within the following ranges.
01 to 7E: Node number in SYSMAC NET network (1 to 126 decimal)
01 to 3E: Node number in SYSMAC LINK network (1 to 62 decimal)
FF: Broadcast transmission

@patbou74
Copy link
Author

patbou74 commented Jun 18, 2021

I don't think this is possible.. The 2 nodes which query at the same time are on the same computer (multiple parallel requests). But the problem is with Omron. On the other hand, the nodes do not validate the SID to which they receive the information, after having emitted their requests. This is the point I wish to underline. If they validated it, I would never have been able to see the problem.

I have read the following article. It goes in the same direction.
#12

@Lucasrsv1
Copy link

I faced this exact same issue today: I have two different applications running on the same computer and accessing the same PLC, but just seconds after running they crashed with the message Unexpected SID 'XX' received. That was happening because one application was eventually receiving data that was meant to the other application, and the PLC was messing up the Dst Ports.

After following @CharlieMarshall 's suggestion and changing the SA1 parameter to 3 on one app and to 2 on the other app, the problem was solved, and data started going to the right place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants