-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Description
We are running into an issue where two independent processes on the same Linux PC both need to connect to a Beckhoff PLC via ADS.
- When both processes try to use
AdsDevice
at the same time, only one of them succeeds. - The other process immediately fails with
Ads operation failed with error code 1861
or later withBroken pipe
errors. - If only one process is running, it works perfectly.
This makes it hard to design modular ROS nodes where each node is its own process but both need PLC access.
Environment
- OS: Ubuntu 20.04 (ROS Noetic environment)
- ADS library: 0.0.28-1
- PLC: Beckhoff TwinCAT 3 runtime (PLC running on 192.168.125.10)
What we tried
All this tests done with the PC IP set to 192.168.125.100
Working scenario (one process)
- Start one ROS node/process using
AdsDevice
with Local AMS Net ID192.168.125.100.1.1
, local ADS port30000
. - Works fine: we can read/write variables without issues.
- Also works with
.1.2
as long as it’s the only process.
Also working: multiple AdsDevice in one process
- Inside one process, create two AdsDevice objects:
192.168.125.100.1.1
→ port30000
192.168.125.100.1.1
→ port30001
- Both coexist, read/write works.
- Suggests that the library/router is multiplexing properly inside a single process.
Failing scenario: two processes
- Start two independent processes:
- Process A → 192.168.125.100.1.1, port 30000
- Process B → 192.168.125.100.1.2, port 30001
- Only one process connects successfully.
- The other process logs:
Error: read frame failed with error: Connection reset by peer
Failed to connect: Ads operation failed with error code 1861.
Error: write frame failed with error: Broken pipe
- Tried same AMS Net ID in both processes (
.1.1
for both), and also different AMS Net IDs (.1.1
vs.1.2
). - In both cases, one process always gets dropped.
Question
What is the recommended way to support multiple independent processes on Linux connecting to the same PLC over ADS?
- Should we expect this to work with ads-lib (and we are misconfiguring something)?
- Or is the design such that only one process per host is supported unless there’s a central ADS router service?
Error logs (for reference)
[Beckhoff] Failed to connect: Ads operation failed with error code 1861.
Error: read frame failed with error: Connection reset by peer
Error: write frame failed with error: Broken pipe
[Beckhoff] Failed to connect: Ads operation failed with error code -1.
Would really appreciate guidance here.
Our use case: ROS nodes running in separate processes, both needing ADS connectivity. Currently this only works if we collapse everything into one process.
Thanks,
Pere
Metadata
Metadata
Assignees
Labels
No labels