C
C#•2y ago
Kuinox

EthernetIP and .NET

Does anyone have experience, experience, or heard about an EthernetIP library in .NET ? Company I work for will soon need to communicate with devices over EthernetIP, and I want inputs on it, as I will probably be the one who work on it.
121 Replies
ProIcons
ProIcons•2y ago
That's so overly specific
Scratch
Scratch•2y ago
@JamesK.Polk might know something
Google
Google•2y ago
Oh, I don't That's something we have to do soon since our vendor won't give us a simple restAPI, but I will "feign" incompetence so I can stick to business problems
Scratch
Scratch•2y ago
good idea
alkasel#159
alkasel#159•2y ago
If you need to talk to allen bradley (rockwell) devices with ethernet-ip you can use libplctag (https://github.com/libplctag/libplctag.NET)
GitHub
GitHub - libplctag/libplctag.NET: This is a .NET wrapper for libplc...
This is a .NET wrapper for libplctag. Contribute to libplctag/libplctag.NET development by creating an account on GitHub.
Kuinox
Kuinox•2y ago
That's a tool I didn't seen before, thanks ! Did you worked with it ? Also, there is a .NET lib called EEIP for EthernetIP, did you heard anything about it ?
alkasel#159
alkasel#159•2y ago
Yes, I've worked with it and it's pretty good. Of course it has some limitations, like you cannot expect to have real-time communications like you have in PLCs. For what concerns EEIP, I never used it, but I could be interested in it (e.g. for directly accessing point I/O) There is a google group around it too, if you need help
RazorSharpFang
RazorSharpFang•2y ago
I have done extensive work with that library. 10/10 would recommend We are using it in production
Kuinox
Kuinox•2y ago
mhhhh, device we have right now are Bihl Wiedemann devices oh thats nice to know, any issue with it/things to know ?
RazorSharpFang
RazorSharpFang•2y ago
I think there was a bug I reported a while back with tags not found being accidentally being marked as valid.
Kuinox
Kuinox•2y ago
google groups, about libplc, or ethernetip ?
RazorSharpFang
RazorSharpFang•2y ago
I think that's patched in the newest preview Multiple instances of tags are thread-safe. A single tag is not thread-safe, use your own C# synchronization primitives. You can read and write entire UDT chunks in single operations if you so desire.
Kuinox
Kuinox•2y ago
is the api hard to use and did you looked at their code (like is it maintainable) or not ?
RazorSharpFang
RazorSharpFang•2y ago
At around the 17kB mark you may have performance issues on the EtherNet/IP card on physical PLCs
alkasel#159
alkasel#159•2y ago
Google group about libplctag: https://groups.google.com/g/libplctag?pli=1 The only problem I've had was in accessing a boolean in write-mode, it didn't worked. However it worked if you have that bit within a DINT. In that case you could just modify the corrisponding bit inside the DINT (Logix Designer terminology)
RazorSharpFang
RazorSharpFang•2y ago
It seems fine, but it likes throwing exceptions, which isn't super good for performance.
Kuinox
Kuinox•2y ago
thanks, I won't join the group for now, but i'll remember it if we need to work on Allen-Bradley modules
RazorSharpFang
RazorSharpFang•2y ago
But you can't query the PLC for "What type is this tag?" You must know what the type is! You can interpret the memory chunk as an Int32 or a Float32 should you so desire Make sure to get it right or you'll blow out a valve with way too much pressure
alkasel#159
alkasel#159•2y ago
Yep, the fact you can transfer an UDT is very handy. They have examples on how to access almost every data type
RazorSharpFang
RazorSharpFang•2y ago
We got 100x improvement on gamepad remote-control through that. Fantastic. Pipe over the full gamepad state continuously, over 100 updates a second heck yeah The library supports both sync and async methods.
Kuinox
Kuinox•2y ago
mhhh, I have trouble finding EEIP sources... wait, it's the smol EIPClient.cs
RazorSharpFang
RazorSharpFang•2y ago
We are 99% going to migrate away from using KepServerEXv6 and OPCDA to doing EtherNet/IP directly. libplctag.Net uses Symbolic Protocol, as opposed to Logical Non-Blocking.
Kuinox
Kuinox•2y ago
that what we wanted to do basically, directly communicate to devices over eip
RazorSharpFang
RazorSharpFang•2y ago
Do you have physical plcs?
Kuinox
Kuinox•2y ago
what is that ?
RazorSharpFang
RazorSharpFang•2y ago
Symbolic is using tag-name Logical Non-Blocking is using numerical indexes instead If you want to do LNB, you gotta index the entirety of the PLC memory first Which takes effort/time But then you don't need to transmit the tag-name, only the number index instead Both ControlLogix and CompactLogix support both
Kuinox
Kuinox•2y ago
we have this for now OMEGALUL
RazorSharpFang
RazorSharpFang•2y ago
Not sure if the Micro controllers support that Which controller type are you using?
Kuinox
Kuinox•2y ago
3 secs I search it up
RazorSharpFang
RazorSharpFang•2y ago
Is it a L71/L81 ControlLogix? Or is it a CompactLogix?
Kuinox
Kuinox•2y ago
com module is a BWU3849
RazorSharpFang
RazorSharpFang•2y ago
That's not an Allen Bradley product
Kuinox
Kuinox•2y ago
am searching the infos, im in remote right now, cant look up the thing on place never said it was ! ^
RazorSharpFang
RazorSharpFang•2y ago
It's an E-IP & Modbus TCP gateway, but a gateway for what exactly? Is that the controller itself, or is it just a gateway for something else? Not that I know what ASi refers to
Kuinox
Kuinox•2y ago
ASi ?
RazorSharpFang
RazorSharpFang•2y ago
24 Volt ASi-5/ASi-3 EtherNet/IP + Modbus TCP Gateway in Stainless Steel, 1 ASi-5/ASi-3 master
Kuinox
Kuinox•2y ago
the belt is an interoll, so I guess an interoll controller ? ah found it, the motor controller is a BWU4246
RazorSharpFang
RazorSharpFang•2y ago
And it uses digital inputs
Kuinox
Kuinox•2y ago
company and I is entering/discovering these things, what do you mean by physical PLC here ?
RazorSharpFang
RazorSharpFang•2y ago
RazorSharpFang
RazorSharpFang•2y ago
As a GuardLogix
Kuinox
Kuinox•2y ago
yeah thats something like that, not exactly this one tho
RazorSharpFang
RazorSharpFang•2y ago
But Allen-Bradley/Rockwell products tend to be really pricy You probably don't need those safety ratings on those products, but that may depend on what your specific application is
Kuinox
Kuinox•2y ago
*not this one because we use other company product that look like this a conveyor belt... for food or something like that yeah, not lifethreatening
RazorSharpFang
RazorSharpFang•2y ago
Okay, yeah, we use it for driving multi-tonne autonomous drilling rigs They use tank-like tracks for movement and can run over cars easily Good fun
Kuinox
Kuinox•2y ago
software side, does EEIP have/need some certification for task like this ?
Kuinox
Kuinox•2y ago
found some better doc
RazorSharpFang
RazorSharpFang•2y ago
What do you mean EEIP anyway?
Kuinox
Kuinox•2y ago
GitHub
GitHub - rossmann-engineering/EEIP.NET: Ethernet/IP compatible libr...
Ethernet/IP compatible library for .NET implementations - GitHub - rossmann-engineering/EEIP.NET: Ethernet/IP compatible library for .NET implementations
RazorSharpFang
RazorSharpFang•2y ago
Eh, not really. The moment you're doing C# you can't meet those ISO safety standards directly on that software. That's why the safety for us is done on the safety-rated controllers, digital smart/IOs and similar. But we use libplctag.Net And it works really well. Works on both windows and linux
Kuinox
Kuinox•2y ago
ok ok, thanks for the answers :D
RazorSharpFang
RazorSharpFang•2y ago
And libplctag.Net supports both EtherNet/IP and Modbus/TCP
Kuinox
Kuinox•2y ago
as far as I understand, libplctag wont work with the controller we have right ?
RazorSharpFang
RazorSharpFang•2y ago
Your gateway says it supports EtherNet/IP it should work. See if it supports symbolic protocol
Kuinox
Kuinox•2y ago
and it looks like this
Kuinox
Kuinox•2y ago
our gateways
RazorSharpFang
RazorSharpFang•2y ago
You would create a tag Give it the gateway and path details Say to use EtherNet/IP, say that the endpoint is probably a controllogix-compatible device Set the tag address by Name And then initialize the tag and it "should" work EtherNet/IP itself is an adaption of Rockwell CIP to operate over IP networks
Kuinox
Kuinox•2y ago
symbolic doesnt show up in the pdf, any other keyword ? :')
RazorSharpFang
RazorSharpFang•2y ago
I think you could just give it a try tbh Reading a tag in C# libplctag.Net is like, 10 lines
Kuinox
Kuinox•2y ago
ok i'll test right now, need to pull out work laptop
RazorSharpFang
RazorSharpFang•2y ago
I can't share any of my production code with you because NDAs annoyingly, but I can help out if you need it
Kuinox
Kuinox•2y ago
do you know a good sample to clone and modify ?
RazorSharpFang
RazorSharpFang•2y ago
The gateway is the IP address of the machine libplctag.Net github has samples? But I found it super easy to get started, so long as you know the valid address of tags on the end device
Kuinox
Kuinox•2y ago
oh, in the readme there is one, was searching for sources OMEGALUL have some docs to help, maybe we'll see when I need to use our office vpn which I never used
RazorSharpFang
RazorSharpFang•2y ago
Do you have valid tags on the device?
Kuinox
Kuinox•2y ago
mhhhhh
Kuinox
Kuinox•2y ago
would this help ? when
RazorSharpFang
RazorSharpFang•2y ago
... Maybe? But a tag typically refers to a chunk of memory at a known fixed address E.g.: MyRealValue like a C# variable
Kuinox
Kuinox•2y ago
then I have the docs, will have to search it first roadblock: the freaking vpn
RazorSharpFang
RazorSharpFang•2y ago
Ah
Kuinox
Kuinox•2y ago
lets run this .exe with a GUID which is under the vpn folder OMEGALUL root cert I have expired in june rainowo only person who know about it are in vacation rainowo
RazorSharpFang
RazorSharpFang•2y ago
F
Kuinox
Kuinox•2y ago
wtf azure vpn clien... look shady af @RazorSharpFang i'm in !!!!!! bruh im a moron @RazorSharpFang no plc, want to control motor directly OMEGALUL
RazorSharpFang
RazorSharpFang•2y ago
🤣 You'll have to find some way to talk to the digital inputs of the motor then All of our digital inputs are handled by PLCs
Kuinox
Kuinox•2y ago
there is a EhternetIP-ASi5 gateway for that, no ?
RazorSharpFang
RazorSharpFang•2y ago
I'm not very familiar with the control system side of things. I don't know how gateways work per-se.
Kuinox
Kuinox•2y ago
I looked at the Ethernet IP side, it looks like I can open a connection, then talk directly to the motor controller? But the motor controller use ASi-5, and I can't find anything about it
RazorSharpFang
RazorSharpFang•2y ago
The motor controller may have defined memory addresses? Those might be your tag Name
Kuinox
Kuinox•2y ago
im not using libplctag, I don't think I even have tags there ?
Kuinox
Kuinox•2y ago
From what I understand, I need to open one of these EtherNet/IP connection, then ... ?
RazorSharpFang
RazorSharpFang•2y ago
I'm expecting named addresses on the motor
Kuinox
Kuinox•2y ago
does assemblyobjects have named instance ? Thonk dont know what you are expecting Thonk
RazorSharpFang
RazorSharpFang•2y ago
I'm expecting like Output1 being a named address Of a known datatype, e.g.: DINT, INT, SINT, REAL, BOOL etc
Kuinox
Kuinox•2y ago
thinkfused is this named address thing
RazorSharpFang
RazorSharpFang•2y ago
It's a region of memory on the controller
Kuinox
Kuinox•2y ago
... controller ? of the motor ? when
RazorSharpFang
RazorSharpFang•2y ago
Either... ? On a controllogix for instance, you can refer to external mapped devices Kinda like memory-mapped files or addresses that correspond to particular digital pins on a computer
Kuinox
Kuinox•2y ago
I have no PLC there
RazorSharpFang
RazorSharpFang•2y ago
Okay, yes, but the gateway mapping should do something similar Either that, or to use ethernet/ip, it would expect you to use a CompactLogix or similar controller that does ethernet/ip and then you can do ethernet/ip to that controller
Kuinox
Kuinox•2y ago
gateway docs speak about ethernetip "connections", I dont see mappings
RazorSharpFang
RazorSharpFang•2y ago
CompactLogix would be a cheaper controller
Kuinox
Kuinox•2y ago
cheaper than ... what ? Thonk
RazorSharpFang
RazorSharpFang•2y ago
Than a ControlLogix $1000 vs $20000
Kuinox
Kuinox•2y ago
it would expect you to use a CompactLogix
objective is to not use a PLC there FYI
RazorSharpFang
RazorSharpFang•2y ago
Then perhaps you should be using a rasp-pi that has digital outputs, or a soc thingy ? Are you sure it's a EtherNet/IP Master and not an EtherNet/IP slave?
Kuinox
Kuinox•2y ago
Product selector: Gateways - Bihl+Wiedemann GmbH
Bihl+Wiedemann GmbH was founded in 1992 in Mannheim, Germany by Jochen Bihl and Bernhard Wiedemann. This highly specialized engineering firm is among the leading providers of safety technology and electronic components for automation technology using AS-Interface.
RazorSharpFang
RazorSharpFang•2y ago
Oh! It supports OPC UA Just use that There's nuget libraries for OPC UA Non-commercial only but whatever
Kuinox
Kuinox•2y ago
there is an MIT lib for ethernetIP and I tested it yesterday when
RazorSharpFang
RazorSharpFang•2y ago
Okay, but OPC UA lets you query the device As in "What do you have?" Which you might be able to use to tease out what the memory addresses it has actually are, which might be the same on the EtherNet/IP side But have you tried out the library on the device at all?
Kuinox
Kuinox•2y ago
as far as I understood, I can redirect ASi-5 connection on ethernet/IP yes, got some output
RazorSharpFang
RazorSharpFang•2y ago
Were you able to move the motor?
Kuinox
Kuinox•2y ago
not yet, due to my lack of knowledge of ethernetIP, and me not wanting to make a motor spin when nobody is in the office OMEGALUL
RazorSharpFang
RazorSharpFang•2y ago
Did you check their quick start guide on rockwell rslogix 5000 ? What output did you get?
Kuinox
Kuinox•2y ago
correction: not with the lib, but with gateway manufacturer software, yes
RazorSharpFang
RazorSharpFang•2y ago
Does the gateway manufacturer software let you set motor output? The more of the docs I read the more it makes me think it's expecting you to run this with a PLC
Kuinox
Kuinox•2y ago
manufacturer software can do it without a PLC ¯\_(ツ)_/¯
RazorSharpFang
RazorSharpFang•2y ago
Download - Bihl+Wiedemann GmbH
Bihl+Wiedemann GmbH was founded in 1992 in Mannheim, Germany by Jochen Bihl and Bernhard Wiedemann. This highly specialized engineering firm is among the leading providers of safety technology and electronic components for automation technology using AS-Interface.
Kuinox
Kuinox•2y ago
yes
RazorSharpFang
RazorSharpFang•2y ago
Can you send it to me? It requires login
Kuinox
Kuinox•2y ago
you just need an account, even unverified Reviving this when do you know details of the EtherNetIP protocol ? Like what are the "path" ?
RazorSharpFang
RazorSharpFang•2y ago
Path Chassis and Slot identification that lets the EtherNet/IP card determine to which device on the bus you are referring to E.g.: 1,0 (string) Says "Chassis 1, Slot 0"
Kuinox
Kuinox•2y ago
I'm speaking about this:
Kuinox
Kuinox•2y ago
the assembly have "path", which looks hardcoded
RazorSharpFang
RazorSharpFang•2y ago
🤨
Kuinox
Kuinox•2y ago
it's also called Link Path elsewhere
RazorSharpFang
RazorSharpFang•2y ago
That's not the path I was referring to.
Kuinox
Kuinox•2y ago
yeah, I understood that: p
RazorSharpFang
RazorSharpFang•2y ago
This is a very different side of EtherNet/IP than the side I typically use, so I genuinely have no idea.
Kuinox
Kuinox•2y ago
Yeah I think you are on the users/PLC side I have no PLC there that would be, 2 weeks, are at most 3 weeks of engineering time to get rid of the need of a PLC, I think that's worth it when near completion (I hope), of generating code from the EDS (if you know what are those ?) to interface to a EthernetIP device directly
RazorSharpFang
RazorSharpFang•2y ago
I only vaguely know what an EDS file tbh. Typically I just right-click and say "Upload from device" and then it "just works"