Showing results for 
Search instead for 
Did you mean: 

What is the simplest way to send and receive ASCII strings from and to an Allen Bradley PLC??

I am working with an external vendor on an automated Test Fixture for one of our products.    Initially the vendor stated that the PLC in question accepts standard comma delimted ASCII strings via Ethernet, therefore i coded my VI using the standard labview TCP Open, TCP Write/Read, then TCP Close for the sending of the data to the PLC, and simulated the PLC using another PC running TCP listening software to verify the data was being sent over Ethernet to the correct IP and Port..   This all worked correctly..



However, we have discovered that the vendor was incorrect in that the PLC does NOT accept standard TCP, and that we need to reimplement using OPC.     I have not worked with OPC at any point in my labview experience.     I have verified that the PLC is acting as a OPC server.    However, in the Labview 2015 help files it mentions that to use Datasocket to communicate via OPC, an OPC Server is required.   Does the NI OPC server package include OPC client functionality as well, or would i need to buy the Labview DSC, which has an OPC client?    Also, whenever i build the application to deploy to the test fixture's PC, for the DSC i understand i'd need the DSC Runtime for that, but is there an equivalent for the OPC servers, or is it just the same license??






Greg G.



0 Kudos
Message 1 of 7



I support two testers the use AB plc's and OPC for communication to LabVIEW programs.  You don't need the DSC module. We use FactoryTalk Gateway software from Rockwell Automation for OPC server and use the OPC client functions in LabVIEW.  

0 Kudos
Message 2 of 7

LabVIEW ships with an example program that uses the datasocket API to communicate with OPC DA servers which may do what you are looking for. I forget the exact name off the top of my head but it's something like Monitor OPC Items with DataSockets.

Matt J | National Instruments | CLA
0 Kudos
Message 3 of 7

Hi Matt,



Actually i did try that VI as a troubleshooting step when i was at the site where the machine is being assembled, and unfortunately it didn't seem to work for me..    When i connected to the built in "OPCDemo" server it did show a value flipping from 0 to 1 periodically, but it never seemed to work for sending data to the actual PLC itself. 

0 Kudos
Message 4 of 7

Hi Wayne,



I believe the PLC is supported by Rockwell Automation, so this might be an option.  When you mention the OPC client functions, i assume you mean the standard Datasocket functionality??








0 Kudos
Message 5 of 7



Yes, the Datasocket functions will let you communicate with an OPC server.

0 Kudos
Message 6 of 7

Use  This allows you to comunicate directly to the AB PLC using EtherNet/IP.   Lava ( ) had a library to down load for free. Not Sure it is there any more. You can use IO or Messaging.  If you use messaging it requires no programing on plc side. Just that the controller tags exist. Can read or write up to 480 bytes.  

0 Kudos
Message 7 of 7