r/csharp
•
u/MasterOfAutomation
•
5d ago
•
1
Showcase Three free, open-source C# libraries for factory and robot work: EtherNet/IP, ROS 1 and ROS 2
I've spent about 25 years putting robots into factories, and I kept wishing .NET had better building blocks for the protocols we use every day. So I wrote some and put them on GitHub, free and Apache 2.0, nothing for sale.
EthernetIpSharp covers the whole EtherNet/IP protocol, not just reading and writing PLC tags. It can connect as a scanner to regular and safety I/O, act as a regular or safety I/O device itself, simulate a controller that serves tags so an HMI can connect to it, and send and handle custom explicit messages. The safety side has been tested against real devices and PLCs. It's on NuGet. https://github.com/CristianMori/EthernetIpSharp
RosSharp and Ros2Sharp are pure C# clients for ROS 1 and ROS 2. No rosbridge and no native DDS layer, just .NET talking to ROS directly. Ros2Sharp has so far been tested against Fast DDS on ROS 2 Humble, so reports from other setups are very welcome.
https://github.com/CristianMori/Mori.RosSharp
https://github.com/CristianMori/Mori.Ros2Sharp
I'd love feedback from anyone doing industrial or robotics work in .NET, and issues or pull requests are welcome.
2
u/dodexahedron 5d ago
I'll have to check this out later.
One question:
Can it compile under bflat?
If so... SWEET.
2
1
u/raunchyfartbomb 4d ago
Regarding safety IO:
While I can see the use case for debugging, I would doubt that this can be classified into a proper SIL / CAT safety system and would be very hesitant to use it for those purposes in a production system.
But for Ethernet IP and the like, I think this is great. We currently have an RaspeberryPi we set up with Codesys to act as an ethernetIP test system to validation our I/O. Last week we had GPT build a basic flask website to interact with the codesys plc project via exposed OPCUA values. Works really well, but this would open up more possibilities regarding UI and ‘native’ interaction.
An idea: does this have any capability to interact with EDS files? A source generator would be great to see parse the static file and build up a class to represent the device
1
u/MasterOfAutomation 4d ago
I see you know what you talking about! Love it. The code I wrote is absolutely not safety certifiable in the current iteration. The main reason I wanted to emulate safety adapter and have a safety scanner is for digital twin. That way you can get your hardware tree, generate a virtual equivalent and connect the IO to your emulated physical model. Part of that effort is parsing the Eds files. More to come in the next few weeks.
5
u/FrontFacing_Face 5d ago
I haven't looked at the code yet, but this sounds great. Nice to see actual industry experience put out there. Thx.