RSLogix5000 link with RPI

Dhitzfelder

Member
Join Date
Feb 2019
Location
Montrose, Colorado
Posts
52
Hello, all.

I have purchased a Raspberry Pi, and intend to use it something like a high speed counter (It hasn't arrived yet). At this point, I intend to use the PyComm module to communicate with the PLC.

Question: from what I can see of the code, am I correct in assuming that the PI initiates all communication with the PLC? If so, is there any setup necessary on the PLC end other than creating tags to be read or written to?
 
You have the right idea, nothing will need to be done on the PLC end, all of the work will be done you the Pi.
 
Cool, Thanks dmroeder!

Out of curiosity, is there another alternative that sets up the PI as an ethernet device for the PLC? I looked at setting it up for Modbus TCP as well, but from what I'm seeing on forums, that's a different language than AB talks...
 
I believe AB does communicate via Modbus, but it's all done via software... as in you download a subroutine that will do that for you.

I had a look a while back and it looked ok. Not sure if it's only available through techconnect, though.

Have you checked pylogix for Python?
 
Last edited:
Kallileo, Thanks for the response. I'm going to play with it for sure :), but from everything I can see, Allen Bradley doesn't talk to modbus TCU.

You can do Modbus TCP with Studio 5000, but it's not a built-in. Rockwell has sample Modbus TCP master and slave implementations on the KB. It takes a fair amount of memory, but I've used it in the past to talk to Modbus VFDs successfully.

Overview PDF from Digi
KB With Program Links

EDIT: cadosocea beat me to it! I'll leave the links though. :)
 
Last edited:
pylogix is probably what I will go with.

As I understand it, the PLC doesn't recognize it as an I/O device, it just reads/modifies the tags similar to the way a user would do so using the ControLogix software. That's fine, but the PLC wouldn't think anything's wrong if it doesn't get any input, so I'll have to incorporate a heartbeat and program error handling for no input.

As an aside, it looks like it would be much simpler to use the PI as an interface for any other modbus devices than to use the code provided by RS Logix to configure the PLC as a modbus...
 
I'm interested in learning a bit more about the R-Pi <-> AB comms. What PyCom parts are you guys using?
 
I'm interested in learning a bit more about the R-Pi <-> AB comms. What PyCom parts are you guys using?

https://pypi.org/project/pycomm/

I started using PyLogix (available at GitHub), and it is much easier to impliment.

just create an instance of class PLC(), i.e.
myPLC = PLC()

assign an IP address to it:
myPLC.IPAddress = 192.168.30.1

write tags: (to a tag in the PLC named "test", the integer value of 1000)
myPLC.Write("test", 1000)

read from tag: (place value in variable "sample" in the pi)
sample = myPLC.Read("test")


good instructions are available here:
https://github.com/dmroeder/pylogix
 
Last edited:
pylogix is probably what I will go with.

As I understand it, the PLC doesn't recognize it as an I/O device, it just reads/modifies the tags similar to the way a user would do so using the ControLogix software. That's fine, but the PLC wouldn't think anything's wrong if it doesn't get any input, so I'll have to incorporate a heartbeat and program error handling for no input.

As an aside, it looks like it would be much simpler to use the PI as an interface for any other modbus devices than to use the code provided by RS Logix to configure the PLC as a modbus...

Your post got me thinking... Could I add a module to pylogix that would act as a real I/O device? The answer is yes, or at least I have a working proof of concept. In fact, I was able to make an EDS file that allows you to add a custom "pylogix" module to the tree, though I probably won't go that route since I'm not an ODVA member with an official vendor ID.

But if I can work out all of the details, I may add a module to pylogix that will connect with a generic Ethernet module.
 
Your post got me thinking... Could I add a module to pylogix that would act as a real I/O device? The answer is yes, or at least I have a working proof of concept. In fact, I was able to make an EDS file that allows you to add a custom "pylogix" module to the tree, though I probably won't go that route since I'm not an ODVA member with an official vendor ID.

But if I can work out all of the details, I may add a module to pylogix that will connect with a generic Ethernet module.


I'd be interested in this!
 

Similar Topics

Hello everyone, I have an RSLogix5000 project which is running live in the factory but I need to make some changes to the logic. I want to test...
Replies
0
Views
1,097
Good Morning Everyone, I'm looking to use the GSV instruction to get I/O fault codes for my project so I know if there's a comms issue in my E/IP...
Replies
5
Views
813
The machine is running production. When trying to go online with the laptop the whole machine looses communication and faults out. Drives, HMI...
Replies
13
Views
1,870
Hello, is it possible to create a data block, something like shared datablock in Siemens STEP 7, in the RS Logix5000 PLC project? I would like...
Replies
3
Views
1,049
Hi all. This is a machine programmed by the manufacturer. There is an event task and the event tag is a MOTION_GROUP tag. Screenshot . Since the...
Replies
2
Views
979
Back
Top Bottom