C
C#•3y 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•3y ago
That's so overly specific
Scratch
Scratch•3y ago
@JamesK.Polk might know something
Google
Google•3y 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•3y ago
good idea
alkasel#159
alkasel#159•3y 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
KuinoxOP•3y 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•3y 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•3y ago
I have done extensive work with that library. 10/10 would recommend We are using it in production
Kuinox
KuinoxOP•3y 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•3y ago
I think there was a bug I reported a while back with tags not found being accidentally being marked as valid.
Kuinox
KuinoxOP•3y ago
google groups, about libplc, or ethernetip ?
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
is the api hard to use and did you looked at their code (like is it maintainable) or not ?
RazorSharpFang
RazorSharpFang•3y ago
At around the 17kB mark you may have performance issues on the EtherNet/IP card on physical PLCs
alkasel#159
alkasel#159•3y 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•3y ago
It seems fine, but it likes throwing exceptions, which isn't super good for performance.
Kuinox
KuinoxOP•3y 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•3y 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•3y 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•3y 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
KuinoxOP•3y ago
mhhh, I have trouble finding EEIP sources... wait, it's the smol EIPClient.cs
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
that what we wanted to do basically, directly communicate to devices over eip
RazorSharpFang
RazorSharpFang•3y ago
Do you have physical plcs?
Kuinox
KuinoxOP•3y ago
what is that ?
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
we have this for now OMEGALUL
RazorSharpFang
RazorSharpFang•3y ago
Not sure if the Micro controllers support that Which controller type are you using?
Kuinox
KuinoxOP•3y ago
3 secs I search it up
RazorSharpFang
RazorSharpFang•3y ago
Is it a L71/L81 ControlLogix? Or is it a CompactLogix?
Kuinox
KuinoxOP•3y ago
com module is a BWU3849
RazorSharpFang
RazorSharpFang•3y ago
That's not an Allen Bradley product
Kuinox
KuinoxOP•3y ago
am searching the infos, im in remote right now, cant look up the thing on place never said it was ! ^
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
ASi ?
RazorSharpFang
RazorSharpFang•3y ago
24 Volt ASi-5/ASi-3 EtherNet/IP + Modbus TCP Gateway in Stainless Steel, 1 ASi-5/ASi-3 master
Kuinox
KuinoxOP•3y ago
the belt is an interoll, so I guess an interoll controller ? ah found it, the motor controller is a BWU4246
RazorSharpFang
RazorSharpFang•3y ago
And it uses digital inputs
Kuinox
KuinoxOP•3y ago
company and I is entering/discovering these things, what do you mean by physical PLC here ?
RazorSharpFang
RazorSharpFang•3y ago
RazorSharpFang
RazorSharpFang•3y ago
As a GuardLogix
Kuinox
KuinoxOP•3y ago
yeah thats something like that, not exactly this one tho
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y 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•3y 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
KuinoxOP•3y ago
software side, does EEIP have/need some certification for task like this ?
Kuinox
KuinoxOP•3y ago
found some better doc
RazorSharpFang
RazorSharpFang•3y ago
What do you mean EEIP anyway?
Kuinox
KuinoxOP•3y 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•3y 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
KuinoxOP•3y ago
ok ok, thanks for the answers :D
RazorSharpFang
RazorSharpFang•3y ago
And libplctag.Net supports both EtherNet/IP and Modbus/TCP
Kuinox
KuinoxOP•3y ago
as far as I understand, libplctag wont work with the controller we have right ?
RazorSharpFang
RazorSharpFang•3y ago
Your gateway says it supports EtherNet/IP it should work. See if it supports symbolic protocol
Kuinox
KuinoxOP•3y ago
and it looks like this
Kuinox
KuinoxOP•3y ago
our gateways
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
symbolic doesnt show up in the pdf, any other keyword ? :')
RazorSharpFang
RazorSharpFang•3y ago
I think you could just give it a try tbh Reading a tag in C# libplctag.Net is like, 10 lines
Kuinox
KuinoxOP•3y ago
ok i'll test right now, need to pull out work laptop
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
do you know a good sample to clone and modify ?
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y 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•3y ago
Do you have valid tags on the device?
Kuinox
KuinoxOP•3y ago
mhhhhh
Kuinox
KuinoxOP•3y ago
would this help ? when
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
then I have the docs, will have to search it first roadblock: the freaking vpn
RazorSharpFang
RazorSharpFang•3y ago
Ah
Kuinox
KuinoxOP•3y 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•3y ago
F
Kuinox
KuinoxOP•3y 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•3y 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
KuinoxOP•3y ago
there is a EhternetIP-ASi5 gateway for that, no ?
RazorSharpFang
RazorSharpFang•3y ago
I'm not very familiar with the control system side of things. I don't know how gateways work per-se.
Kuinox
KuinoxOP•3y 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•3y ago
The motor controller may have defined memory addresses? Those might be your tag Name
Kuinox
KuinoxOP•3y ago
im not using libplctag, I don't think I even have tags there ?
Kuinox
KuinoxOP•3y ago
From what I understand, I need to open one of these EtherNet/IP connection, then ... ?
RazorSharpFang
RazorSharpFang•3y ago
I'm expecting named addresses on the motor
Kuinox
KuinoxOP•3y ago
does assemblyobjects have named instance ? Thonk dont know what you are expecting Thonk
RazorSharpFang
RazorSharpFang•3y ago
I'm expecting like Output1 being a named address Of a known datatype, e.g.: DINT, INT, SINT, REAL, BOOL etc
Kuinox
KuinoxOP•3y ago
thinkfused is this named address thing
RazorSharpFang
RazorSharpFang•3y ago
It's a region of memory on the controller
Kuinox
KuinoxOP•3y ago
... controller ? of the motor ? when
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
I have no PLC there
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
gateway docs speak about ethernetip "connections", I dont see mappings
RazorSharpFang
RazorSharpFang•3y ago
CompactLogix would be a cheaper controller
Kuinox
KuinoxOP•3y ago
cheaper than ... what ? Thonk
RazorSharpFang
RazorSharpFang•3y ago
Than a ControlLogix $1000 vs $20000
Kuinox
KuinoxOP•3y ago
it would expect you to use a CompactLogix
objective is to not use a PLC there FYI
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y 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•3y ago
Oh! It supports OPC UA Just use that There's nuget libraries for OPC UA Non-commercial only but whatever
Kuinox
KuinoxOP•3y ago
there is an MIT lib for ethernetIP and I tested it yesterday when
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
as far as I understood, I can redirect ASi-5 connection on ethernet/IP yes, got some output
RazorSharpFang
RazorSharpFang•3y ago
Were you able to move the motor?
Kuinox
KuinoxOP•3y 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•3y ago
Did you check their quick start guide on rockwell rslogix 5000 ? What output did you get?
Kuinox
KuinoxOP•3y ago
correction: not with the lib, but with gateway manufacturer software, yes
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
manufacturer software can do it without a PLC ¯\_(ツ)_/¯
RazorSharpFang
RazorSharpFang•3y 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
KuinoxOP•3y ago
yes
RazorSharpFang
RazorSharpFang•3y ago
Can you send it to me? It requires login
Kuinox
KuinoxOP•3y 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•3y 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
KuinoxOP•3y ago
I'm speaking about this:
Kuinox
KuinoxOP•3y ago
the assembly have "path", which looks hardcoded
RazorSharpFang
RazorSharpFang•3y ago
🤨
Kuinox
KuinoxOP•3y ago
it's also called Link Path elsewhere
RazorSharpFang
RazorSharpFang•3y ago
That's not the path I was referring to.
Kuinox
KuinoxOP•3y ago
yeah, I understood that: p
RazorSharpFang
RazorSharpFang•3y ago
This is a very different side of EtherNet/IP than the side I typically use, so I genuinely have no idea.
Kuinox
KuinoxOP•3y 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•3y 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"
Want results from more Discord servers?
Add your server