samy.timalsina
samy.timalsina

Reputation: 31

read and write data from AB PLC or any other controllers using C#

I am new to C# and .NET programming so please forgive me if my problem doesn't make sense to you. I am trying to make an application that can read and write data from PLC(Allen Bradley compact logix) to my application. Here are my visions :1) PLC acts as server and the host computer as a client. 2) PLC listens or waits for Host computer. 3) PLC accepts client or Host computer. 4) Host computer sends data or command to PLC to do some task. Example, create a simple button that turns on and off memory bit on the PLC. I am comfortable on working from 1,2 and 3 but I don't know how am I going to do part 4. In the past, I have built simple app to have two computers to exchange strings or text to each other using TCP/IP but instead of sending string I want to send command so that I can change memory bit of PLC.

I only need help in part 4.

I am using C# programming language to accomplish this.

Upvotes: 2

Views: 3680

Answers (2)

Juan Ojeda
Juan Ojeda

Reputation: 41

Depends on what type of compactlogix you actually have and its Ethernet Card, Sounds like you don/'t want to use a conventional HMI/OPC approach like ignition or plain Kepware so Id recommend you take a look at what ingear Net.Logix has (trial/pay). I've used it and its as much as reliable as Non-OPC Network sockets with TCP/IP for AB PLCs can get. The other thing is you could use a plain .NET socket with visual C# and try to use a the Socket MSG configuration on the logix that some of the Ethernet cards support after newer revisions and in this case you will have to program more intensively all the aspects of the socket and Ladder logic in order to handle IO inside PLC.

https://ingeardrivers.com/products/net-products/netlogix/

https://literature.rockwellautomation.com/idc/groups/literature/documents/at/enet-at002_-en-p.pdf

Upvotes: 3

CTGControls
CTGControls

Reputation: 114

It sounds like your end goal is to make a SCADA or HMI. So I am going to give you some options to do that:

  1. Take a look at Advanced HMI. This should give you everything you are looking for. This is not a open source software but is is Freeware.
  2. You can also look at a POST I did on using node-Red for doing what you request. This is using a WAGO PLC but I will show what is possible. If you need more help with this options just ask. Where should I start with my OPC-UA client?
  3. If you would like to roll you own and you would like a completely open-source option. There is a post that may help you with Communications AllenBradley Compactlogix PLC Ethernet IP & C# Communication?

There are many many more options out there. This is just a small list of free or open source options. If you need more options just ask and I will add paid list to this post.

Upvotes: 0

Related Questions