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 August 13th, 2019, 03:32 AM   #1
Scarra
Member
Netherlands

Scarra is offline
 
Join Date: Oct 2016
Location: Tilburg
Posts: 7
Best way of using same code multiple times

Good day all you knowledgeable people.
The scenario:
We have 1 main PLC communicating to and controlling multiple PLCs (up to 20). These multiple PLCs all contain exactly the same code - each performing exactly the same function. The main PLC will orchestrate the individual PLC depending on data received from them.
The Hardware:
Main PLC is a GaurdLogix 1756-L83S
"Child" PLCs are Compact gaurdLogix L30ERMS

The problem is not the child PLCs, the problem lies on the main PLC where each child is monitored and addressed individually. The code per child is complex and long, so copy-paste multiple times is out of the question. Ideally, we want to do the code once as a "template", then use the template multiple times. We are considering using indirect tagging/arrays, but then cross-referencing and maintaining the code will become difficult for the maintenance team later in the life of the product.

The Question:
Is there an elegant and more productive way of doing this?
Please assist
  Reply With Quote
Old August 13th, 2019, 03:35 AM   #2
EICS
Member
Australia

EICS is offline
 
EICS's Avatar
 
Join Date: Dec 2008
Location: Melbourne
Posts: 192
Quote:
Originally Posted by Scarra View Post
Good day all you knowledgeable people.
We are considering using indirect tagging/arrays, but then cross-referencing and maintaining the code will become difficult for the maintenance team later in the life of the product.
don't do that it's like a time bomb.

My opinion
ok by making it easier for you... you then make it hard for everyone who follows. if its manufacturing this equates to lost time or lost production. do it right the first time and the dividend will repay your client many times. no sense it making it really clever when it does not need to be.... think about the guy on night shift who has to fix it !!

Last edited by EICS; August 13th, 2019 at 03:40 AM.
  Reply With Quote
Old August 13th, 2019, 03:45 AM   #3
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,393
Find better maintenance staff and pay accordingly?
  Reply With Quote
Old August 13th, 2019, 04:31 AM   #4
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 13,809
CompactLogix/ControlLogix have the AOI which is a way to program code for reuasability.
Downside is, as far as I know AOI cannot be used with online editing.

Definitely would not recommend going by indirect addressing for this purpose.
__________________
Jesper
See my profile interests for Q&A
  Reply With Quote
Old August 13th, 2019, 04:37 AM   #5
Scarra
Member
Netherlands

Scarra is offline
 
Join Date: Oct 2016
Location: Tilburg
Posts: 7
Quote:
Originally Posted by JesperMP View Post
... AOI which is a way to program code for reuasability.
Downside is, as far as I know AOI cannot be used with online editing...
That was a consideration, but sorry, that is definitely not going to work. As I said, the code is complicated and long, consisting of numerous routines.
And no, online edits of AOIs is not possible.
  Reply With Quote
Old August 13th, 2019, 10:26 AM   #6
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 896
I did something similar though might not be as complex as yours where I used Produced / Consumed tags to convey the status and control tags (status and control in separate UDT's ) from individual child PLC's to/from the master. Then the master evaluates and acts on them. Depending on the speed of your process this may or may not be an option.

I do use an indexed process, but the indexing process copies the entire status UDT into a working area, Master does the evaluation and writes required changes to the indexed command UDT. Then the P/C tags simply do their thing.

The advantage to copying into a working area first is the ease that an electrician can see the values in the UDT and doesn't have to try to find a value using the index number.
  Reply With Quote
Old August 14th, 2019, 12:42 AM   #7
Scarra
Member
Netherlands

Scarra is offline
 
Join Date: Oct 2016
Location: Tilburg
Posts: 7
Quote:
Originally Posted by TheWaterboy View Post
I did something similar though might not be as complex as yours where I used Produced / Consumed tags to convey the status and control tags (status and control in separate UDT's ) from individual child PLC's to/from the master. Then the master evaluates and acts on them. Depending on the speed of your process this may or may not be an option.

I do use an indexed process, but the indexing process copies the entire status UDT into a working area, Master does the evaluation and writes required changes to the indexed command UDT. Then the P/C tags simply do their thing.

The advantage to copying into a working area first is the ease that an electrician can see the values in the UDT and doesn't have to try to find a value using the index number.
Thank you!
This is good advice. We also use produce/consume, but copying into a staging/working area will do the trick.
  Reply With Quote
Old August 14th, 2019, 01:22 AM   #8
janner_10
Supporting Member
United Kingdom

janner_10 is offline
 
Join Date: Dec 2014
Location: Tewkesbury
Posts: 772
As an OEM im generally surprised the quality of a maintenance man dictates how you write your code.

In the 12 years i've been in my current role, the discussion has never arisen. (Aside facility A uses Siemens and Facility B uses Rockwell)
  Reply With Quote
Old August 14th, 2019, 02:01 AM   #9
Scarra
Member
Netherlands

Scarra is offline
 
Join Date: Oct 2016
Location: Tilburg
Posts: 7
Quote:
Originally Posted by janner_10 View Post
As an OEM im generally surprised the quality of a maintenance man dictates how you write your code.

In the 12 years i've been in my current role, the discussion has never arisen. (Aside facility A uses Siemens and Facility B uses Rockwell)
Bit off-topic here, but hey, then you are fortunate. Not all clients are English, and not all technicians are literate with PLC code.
  Reply With Quote
Old August 14th, 2019, 02:57 AM   #10
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 13,809
My comment to avoid making reusable code by indirect addressing is aimed at the main programmer, not a 3rd party. Think about having to return after a couple of years after you wrote the "master piece" and try to pinpoint a sneaky error.

If AOIs are not an option, copy-paste with a lot of search-and-replace may be the only way to go. The search-and-replace may be much easier if you cleverly name the symbols used so you dont have to change the entire symbol but only the part that identifies each instance. That is actually not so hard to do.
The problem is that every time you make a change, you have to re-do it in every program instance, in your case 20 times.
The above is how I did it with PLC5 way back, and then there were more than 20 instances.
__________________
Jesper
See my profile interests for Q&A
  Reply With Quote
Old August 14th, 2019, 03:45 AM   #11
shooter
Member
Netherlands

shooter is offline
 
shooter's Avatar
 
Join Date: Sep 2002
Location: duketown
Posts: 2,708
On the Master you will need a program to read every slave(one after the other by only one program). and put the result in one or more array.
Never copy and paste your program better is to use a function to do a task. In the beginning it is more complex, however after a good lookthrough it will get simpler. You will have to find a balance between operation and maintenance.
I am very close to you so a visit is no problem. Not used AB however IEC61131 is no problem.
__________________
shooter@home.nl
skype shooter paul.deelen
Computer Shooter
Paul Deelen
J. Wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
+31653300739
  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
Fault code in rslogix bornwild LIVE PLC Questions And Answers 3 August 7th, 2017 02:01 PM
What do you do when you encounter substandard code robertmee LIVE PLC Questions And Answers 3 April 20th, 2017 10:47 AM
Andrew Andrew5555555555 LIVE PLC Questions And Answers 13 May 30th, 2011 07:29 AM
Bar code reader and PLC dayanyan LIVE PLC Questions And Answers 8 December 27th, 2010 11:11 PM
How to simulate a FOR..NEXT loop? New2PLCs LIVE PLC Questions And Answers 26 May 9th, 2002 12:36 PM


All times are GMT -5. The time now is 12:49 PM.


.