DEV Community

Cover image for Introducing libplctag.NET 1.0.0 - PLC communications via C#/VB

Introducing libplctag.NET 1.0.0 - PLC communications via C#/VB

Jody Koplo on September 21, 2020

We've released an open-source library that makes reading/writing tags to a PLC in C#/VB dead simple. It's available on Github and NuGet. ...
Collapse
 
jriosapise profile image
jriosapise

Hi, thanks for this. I am trying to create a project to communicate with a SLC 5/05 and get information from it, but I cannot find where to set the address of the PLC, like N7:0, N15:10, etc, to get it's data.
Some one know the proper syntax?
Thanks in advance!

Collapse
 
jkoplo profile image
Jody Koplo

We should really throw some more examples of different PLCs in the GitHub. I don't have any SLC around, but I've definitely seen this asked and answered on the Google group.

Collapse
 
jdperk profile image
jdperk

I work with PLCs and HMIs. I am interested in this library and I would like to ask if I can help develop the code? I am also a VB.NET developer. I am interested in developing a VB.NET, Toolset so to speak, to build HMIs using Visual Studio as the editor that can run on any OS and talk with any brand of PLC. Allen Bradley is normally the hardest to access. I would like be able to talk to Modicon (Schneider) using their "Data Dictionary". Ideally would like to be able to see all PLC tags in the PLC to use them directly without having to create a one-to-one mapping. I would want to be able to control the tag polling rate to include poll by exception, meaning if the value doesn't change then it is not updated. Would like to work on a concept of stale data meaning if the value does not change for a period of time throw an alarm. Please contact me to support this effort.

Collapse
 
jkoplo profile image
Jody Koplo

We're on Github (github.com/libplctag/libplctag.NET) and there's also a message list (groups.google.com/forum/#!forum/li...).

There are some challenges with what you're proposing (ex. cross OS UI is in infancy for .NET) but I think your desire is pretty common.

Collapse
 
jdperk profile image
jdperk

One has to start somewhere, let's get an HMI working on a Windows PC Touchscreen and eventually move to cross OS UI. The industry does not like Window OS for a few reasons. 1- IT owns the asset and wants to update Windows all of the time which can corrupt sometimes. 2- Most industrial sites communicate over satellite doing Windows update over satellite isn't the best method. 3- Security, most thinks Windows is a security risk and are more willing to run on Linux to keep IT out of the PC and the perception of security being better. A OEM would be a good candidate for a Window PC HMI because they can control the asset easier along with security.

Collapse
 
00sieliassg profile image
I. E. S. Galvan

Hello, Im interested in this. Im working with a PLC MicroLogix, I would know if this library could work with this kind of PLC. I noticed you mentioned this libary is able to work with Allen Bradleys PLC, but Im not sure if your refered in CompactLogix, or something like that. Thanks for your time!

Collapse
 
noumanqaiser profile image
NQ

This is an amazing peice of work, specially since this library works on .net Core, it has endless oppurtunities.

I had a question about read performance. I understand that the Tag.Read() function would create an underlying socket connection, read that tag and close the connection. When reading a large number of tags, would constantly opening/closing connection add in to the time/compute resources on PLC end? Is there a way that you can keep a connection open while you read a ton of tags and then close at once?

Collapse
 
oflores85 profile image
oflores85

Hi, what is the difference between this library and opc ua, or what is the best? thanks, i just start with automation projects

Collapse
 
jkoplo profile image
Jody Koplo

Sorry for the late reply. You may have already found your answer. OPC-UA is an open network protocol - but it's not a PLC native protocol. Some modern PLCs actually do implement it directly on their hardware, but many do not. In that case you need to run a OPC-UA server that has drivers to connect to proprietary PLC protocols. Libplctag can be thought of as an open version of one of those drivers. OPC-UA can be handy, but if you're writing a C# app, running an OPC-UA server can be costly, more complex, and more prone to failure than communicating directly.

Collapse
 
softwarewrench profile image
SoftwareWrench

Not to mention there are additional layers on OPC UA that have unpredictable latency.

Collapse
 
twoshrubs profile image
Shrubs

Excellent write up.
I've been using Libplctag for a couple of years now in C++.
The library is super stable and the developer is really active.