Send data from PC to PLC

adavi231

Member
Join Date
Apr 2012
Location
Kansas City, MO
Posts
7
I have written a computer program that generates a number that needs to be sent to a PLC. What's the best way of doing this?

The computer is running RSLinx Enterprise and it needs to be sent to a Controllogix PLC. I would like to send the number via ethernet.
 
You need an OPC Server/ Client that allows Windows programs to communicate with industrial hardware devices like PLC´s.

Matrikon is one company that can supply OPC Server software but you can find lots more. When you buy the OPC you must specify the type of PLC and also the type of communication like Ethernet/IP etc.

http://www.matrikonopc.com/
 
http://ab.rockwellautomation.com/Programmable-Controllers/ControlLogix-Communications

There are several methods to communicate to the PLC. The above link shows all of the different ways. Depending on the frequency and amount of information that is needed to send and receive, you may also want to try serial.

http://www.prosoft-technology.com/Products/Rockwell-Automation-In-chassis/Platform/ControlLogix/Generic-ASCII-Serial-Enhanced-Communication-Module

However if you want to communicate Ethernet/IP then here is the manual.
http://literature.rockwellautomation.com/idc/groups/literature/documents/um/1756-um051_-en-p.pdf

What computer program language are you using?

Hope this helps,
Garry
http://www.accautomation.ca
 
Can I use the RSLinx DDE / OPC server to do this? Is it capable of sending data from the computer to the PLC?
Yes, but the question then becomes how your program interface with the OPC server.

It would help us helping you to give more background information on the how and why this # is generated. Do you have to use a PC, can this # be generated from the PLC instead? What programming language or database is this # coming from?
 
More details

The computer program I wrote is in Java. The computer is monitoring another piece of equipment to see when it is faulted. When that equipment is faulted, my program captures the fault code (the fault code can be contained within 1 byte).

I would like for my program to continuously send the current fault code to the PLC. A fault code of "0" represents "No Faults". I could make my Java program write this value to a text file, where it could be read by the OPC server. Or I could have my Java program write the fault code directly to the OPC server, but I don't know how.

I can use another programming language if necessary to interface with the OPC server and send the data to the PLC.

Is OPC the simplest way? Can I send a simple TCP packet to the PLC and somehow have it received by a MSG instruction?
 
Some suggestions:

- sounds like you know PC programming well, so take a look at AdvancedHMI as rdrast suggested. It uses Visual Studio and is based on C#.

- If you stick with JAVA, take a look at http://www.opcconnect.com/java.php

- RSLinx Lite (the free version) does not act as an OPC server. You need to pay for single node or OEM version.

- check this equipment to see if it can talk some other standard protocol like modbus.
 
I third AdvancedHMI. Minor correction, it's based on VB.NET rather than C#. Regardless, it's easy to use and very powerful.
 
I use this bit of code in VBA in my Excel sheets for sending data to an RSLinx Topic:
'Get the application and topic from the 'Config' sheet
'app is RSLINX or ABTCP etc
txtApplication = Worksheets("Config").Range("b1").Value
'topic is DDE topic
txtTopic = Worksheets("Config").Range("b2").Value

'open dde channel
channelNumber = Application.DDEInitiate(app:=txtApplication, topic:=txtTopic)
'Debug.Print channelNumber

'Scan through the selected addresses and send to PLC
For Each txtAddress In Selection
'Debug.Print txtAddress.Value

'Send values to PLC:
DDEPoke channelNumber, txtAddress.Value, txtAddress.Offset(0, 1)
'Debug.Print channelNumber, txtAddress.Value, txtAddress.Offset(0, 1), Application.DDEAppReturnCode

Next txtAddress

'close channel
Application.DDETerminate channelNumber
 

Similar Topics

I'm fairly new to the PLC world. We are adding a pc to a line at my work the pc is to track good/bad parts and up/down time of the machine maybe...
Replies
8
Views
2,393
Dear forum members, I have a special request, I need to send data from PLC to the web. They will be stored in the database and processed...
Replies
5
Views
5,912
Hi All, I'm using AB plc 5370(Modbus TCP slave progm type) with GE cimplicity scada V8.1. For DI,DO,AI communication is working good. But, I...
Replies
10
Views
2,501
Hi, I want to send the data from ML1400 to ABB PLC. Can anyone help me to send the data through MSG instruction setup. Best Regards, Prasanna
Replies
1
Views
1,348
I have a delta plc that want to send and recive data from it. I use this code for open serial port. SerialPort port = new...
Replies
4
Views
4,948
Back
Top Bottom