Reputation: 45
I am new to PLC Programming and I do not know the basic of it.
My task is to write a code in C# that sends and receive tags from/to their communication server OPC server) RSLINX which will be connected to the client's PLC. I have found the OPC CLient code in the C# but I can't find how should I connect it to the OPC server and is there any testing simulation available that could give me the testing data that I would be receiving from client's PLC. I can give you a reference of what the client is demanding. This is what the client said in the email.
We currently do not have a copy of RSLinx installed in our system onsite. The communications between our PLC and HMI is inherently built into the devices and configured using RSLinx Enterprise which is installed on our programming laptop. We also use RSLinx on our laptop when we want to access the PLC or HMI using the respective programming software.
For your system to reach into our PLC data table, the RSLinx Gateway software will need to be installed and configured on your computer which is running your software and that needs to access our PLC.
I hope this makes sense.
Upvotes: 1
Views: 8297
Reputation: 56
First of all, to communicate with any Rockwell PLC, it's mandatory to have at least the RSLinx Classic. The RS Linx Enterprise or the FactoryTalk Linx Enterprise (the version depends on which FTV you are using), is to communicate the HMI Client to the PLC. To enable the OPC communication you must have at least the RSLinx Classic installed, it has a built in OPC DA server. What the RSLinx Classic does is in rough words connect to the PLC over Ethernet/IP (or other communication protocol) and bridge the data as OPC server, which can be reached from OPC Clients.
To setup the communication you must configure a DDE/OPC Topic and point it to the PLC controller. This topic has a name, and this will be important to communicate. I’ve done this long time ago, but as far as I remember, you setup a OPC client on C#. Important: there is a defined structure to fetch the data. Rockwell on the Knowledge Base has examples of it for VBA and Excel, and probably for .Net.
Long story short, to achieve the communication to the PLC and get data to your C# application, you must install the RSLinx Classis on your system, Setup a DDE/OPC Topic, your C# application must start a client connection to the OPC Server from RSLinx, then you set the methods to read or write the tag data.
If you have a TechConnect valid user, you can search for the ID QA769 to reach the forum topic: RSLinx Classic: Monitor Data in Excel using DDE. This is not for C#, however, you can have a better picture to make the same in C#.
Somethings must be pointed out:
I hope I could help you. If you need more information or have more questions let me know. Good Luck.
Upvotes: 4
Reputation: 171
You can download libplctag C class libraries from GitHub here that assist in connection and communication for reading/writing tag values within an AB PLC: https://github.com/libplctag/libplctag from there, you can watch a few youtube examples. Mesta-Automation has a decent article on how to compile the libraries with an included video you can check out here https://www.mesta-automation.com/how-to-communicate-to-an-allen-bradley-plc-with-c-and-libplctag-ethernet-ip-library/ You don't need RSLinx to communicate with the controller with this method.
Upvotes: 0