You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 2nd, 2019, 03:09 PM   #1
Dhitzfelder
Member
United States

Dhitzfelder is offline
 
Dhitzfelder's Avatar
 
Join Date: Feb 2019
Location: Montrose, Colorado
Posts: 16
RSLogix5000 link with RPI

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?
  Reply With Quote
Old February 2nd, 2019, 06:08 PM   #2
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,123
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.
  Reply With Quote
Old February 2nd, 2019, 06:24 PM   #3
Dhitzfelder
Member
United States

Dhitzfelder is offline
 
Dhitzfelder's Avatar
 
Join Date: Feb 2019
Location: Montrose, Colorado
Posts: 16
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...
  Reply With Quote
Old February 2nd, 2019, 07:13 PM   #4
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,123
There isn't anything that I'm aware of that would essentially let you add a Pi to the I/O tree if that is what you are thinking.

There are modbus TCP projects on github. Here is one (I've never used it):

https://github.com/sourceperl/pyModbusTCP
  Reply With Quote
Old February 3rd, 2019, 01:28 AM   #5
kallileo
Member
Greece

kallileo is offline
 
Join Date: Jun 2008
Location: Thessaloniki, Macedonia, Hellas
Posts: 162
You can install Codesys runtime on raspberry pi and make either Modbus tpc client or server in order to communicate with your AB PLC. You can even use it as Ethenet/IP scanner or adapter.

https://store.codesys.com/codesys-co...ml?___store=en
__________________
automationofthings.blogspot.com
  Reply With Quote
Old February 4th, 2019, 08:32 AM   #6
Dhitzfelder
Member
United States

Dhitzfelder is offline
 
Dhitzfelder's Avatar
 
Join Date: Feb 2019
Location: Montrose, Colorado
Posts: 16
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.
  Reply With Quote
Old February 4th, 2019, 10:09 AM   #7
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,215
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 by cardosocea; February 4th, 2019 at 10:12 AM. Reason: pylogix hint
  Reply With Quote
Old February 4th, 2019, 10:17 AM   #8
gothroach
Supporting Member
United States

gothroach is offline
 
Join Date: Jan 2019
Location: In the shop.
Posts: 4
Quote:
Originally Posted by Dhitzfelder View Post
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 by gothroach; February 4th, 2019 at 10:19 AM. Reason: Beaten to the punch.
  Reply With Quote
Old February 4th, 2019, 01:00 PM   #9
Dhitzfelder
Member
United States

Dhitzfelder is offline
 
Dhitzfelder's Avatar
 
Join Date: Feb 2019
Location: Montrose, Colorado
Posts: 16
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...
  Reply With Quote
Old February 5th, 2019, 05:52 PM   #10
Jeev
Member
Australia

Jeev is offline
 
Jeev's Avatar
 
Join Date: May 2008
Location: Brisbane
Posts: 451
I'm interested in learning a bit more about the R-Pi <-> AB comms. What PyCom parts are you guys using?
  Reply With Quote
Old February 7th, 2019, 09:36 AM   #11
Dhitzfelder
Member
United States

Dhitzfelder is offline
 
Dhitzfelder's Avatar
 
Join Date: Feb 2019
Location: Montrose, Colorado
Posts: 16
Quote:
Originally Posted by Jeev View Post
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 by Dhitzfelder; February 7th, 2019 at 09:47 AM.
  Reply With Quote
Old February 8th, 2019, 12:52 AM   #12
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,123
Quote:
Originally Posted by Dhitzfelder View Post
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.
  Reply With Quote
Old February 8th, 2019, 11:28 AM   #13
Phil Buchanan
Lifetime Supporting Member
United States

Phil Buchanan is offline
 
Phil Buchanan's Avatar
 
Join Date: Jun 2015
Location: Atlanta, Georgia
Posts: 431
I have a source for Pi drivers for Ethernet IP if that may serve better on the comms side. PM me if you want details.
__________________
PLC Boot Camp Training

http://www.KeyAutomationTraining.com
  Reply With Quote
Old February 10th, 2019, 04:35 PM   #14
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,777
Quote:
Originally Posted by dmroeder View Post
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!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Toshiba T3 PLC Computer Link <-> RS-485 (real time data extraction) vincentc LIVE PLC Questions And Answers 0 February 21st, 2017 02:47 AM
Omron Host Link question PLC_4_Ray LIVE PLC Questions And Answers 1 November 15th, 2016 01:20 PM
"AS-i Power Fail" at DP/AS-i Link silva.foxx LIVE PLC Questions And Answers 0 June 9th, 2009 09:40 AM
Serial Link between CJ1M and a CQM1H? Soggy Canuck LIVE PLC Questions And Answers 3 March 21st, 2009 04:28 AM
Rx3i and Omni Link press control jseavers LIVE PLC Questions And Answers 0 February 28th, 2009 02:12 AM


All times are GMT -5. The time now is 11:28 PM.


.