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.

New Here? Please read this important info!!!


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

Reply
 
Thread Tools Display Modes
Old March 17th, 2023, 12:23 PM   #1
AMarks95
Member
United States

AMarks95 is offline
 
Join Date: Jul 2018
Location: South Dakota
Posts: 133
Logix 5000 Tasks, Programs, Routines

Since I've started with PLCs all of the routines have always been under the "MainProgram" folder. Would love to organize things further into sub-systems, but not sure of the implications for functionality, etc.

For instance, let's say I have 4 sets of 3 pumps that operate independently, but controlled by the same PLC. Typically, we'd have a routine for "Pump_Set_1", "Pump_Set_2", etc. all under the MainProgram folder.

Instead, what if I make 4 programs, one for each set of pumps, and add those programs to the task's program schedule? Would there be any real difference? The programmer in me says it shouldn't matter, but my experience with AB tells me it might.

Any insights are much appreciated.
TIA
  Reply With Quote
Old March 17th, 2023, 12:28 PM   #2
parky
Member
United Kingdom

parky is online now
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 4,790
No essentially, the only time it would really make a difference is the order you call them in but even then it would not make any difference unless you are relying on things like timed interrupts. AB is a bit different as I believe that the update of the I/O is asynchronous which means inputs & outputs can be updated during the scan of the program where many others only update real I/O before or after program scan, but with the exception of requiring high speed I/O update then it will not make any difference.
  Reply With Quote
Old March 17th, 2023, 12:35 PM   #3
joseph_e2
Member
United States

joseph_e2 is offline
 
Join Date: Dec 2010
Location: Harrisonburg, VA
Posts: 506
Only caveat I can think of is if any of the programs need to know what's going on in any of the other programs. If they do, you'll have to use global controller-scoped tags for the interface. Other stuff can be kept local to each program.
  Reply With Quote
Old March 17th, 2023, 12:59 PM   #4
JeremyM
Lifetime Supporting Member
United States

JeremyM is offline
 
JeremyM's Avatar
 
Join Date: May 2014
Location: Dallas, Texas
Posts: 1,043
Quote:
Originally Posted by joseph_e2 View Post
Only caveat I can think of is if any of the programs need to know what's going on in any of the other programs. If they do, you'll have to use global controller-scoped tags for the interface. Other stuff can be kept local to each program.
You can just use public parameters.
__________________
LogixLibraries
  Reply With Quote
Old March 17th, 2023, 01:26 PM   #5
joseph_e2
Member
United States

joseph_e2 is offline
 
Join Date: Dec 2010
Location: Harrisonburg, VA
Posts: 506
Quote:
Originally Posted by JeremyM View Post
You can just use public parameters.

I'll have to look into that. It would have made some things a lot easier for me...
  Reply With Quote
Old March 17th, 2023, 02:08 PM   #6
AMarks95
Member
United States

AMarks95 is offline
 
Join Date: Jul 2018
Location: South Dakota
Posts: 133
Quote:
Originally Posted by joseph_e2 View Post
Only caveat I can think of is if any of the programs need to know what's going on in any of the other programs. If they do, you'll have to use global controller-scoped tags for the interface. Other stuff can be kept local to each program.
All of our tags are always global scope.
  Reply With Quote
Old March 17th, 2023, 05:15 PM   #7
Operaghost
Member
United States

Operaghost is offline
 
Operaghost's Avatar
 
Join Date: Apr 2002
Location: Dallas, TX USA
Posts: 3,873
I think it is a very good idea. That is sort of the intention with Programs. I would sometimes refer to them like folders. Create a folder for a piece of equipment and put all the logic and tags you need for that equipment all in one place neatly separated from the other equipment.

A benefit to Program scoped tags would be that you could create a tag called Start (for example). That Start tag would be unique to that program. I know not everyone likes aliases, but you could alias that tag to the actual digital input tag used to start that equipment.

When you move to a different program, that Start tag doesn't exist. You could actually create a new tag in the other program and also call it Start, but alias it to a different digital input.

So when you have similar/identical pieces of equipment you could actually copy that entire program and paste it as a whole new program and then just update the aliases with the proper inputs and outputs for the other piece of equipment.

As for making that information available to other programs, you could always create a controller scoped alias to the particular tags you want visible to the other programs. Newer versions have parameters which are sort of like program scoped tags, but you can make them visible to other programs. It's a nice feature but sort of convoluted at first.

But, even if you don't use Program scoped tags and stick with Controller tags, Programs are still a really good idea. Like some of the comments here, we almost exclusively use Controller tags.

OG
__________________
I despise when people take random quotes and ascribe them to me - Julius Caesar
  Reply With Quote
Old March 20th, 2023, 09:37 AM   #8
AMarks95
Member
United States

AMarks95 is offline
 
Join Date: Jul 2018
Location: South Dakota
Posts: 133
Quote:
Originally Posted by parky View Post
No essentially, the only time it would really make a difference is the order you call them in but even then it would not make any difference unless you are relying on things like timed interrupts. AB is a bit different as I believe that the update of the I/O is asynchronous which means inputs & outputs can be updated during the scan of the program where many others only update real I/O before or after program scan, but with the exception of requiring high speed I/O update then it will not make any difference.
Does an "unscheduled" program mean that it's not being called?

EDIT: looks like that's the case: http://www.plctalk.net/qanda/showthread.php?t=78378
  Reply With Quote
Old March 20th, 2023, 09:40 AM   #9
Operaghost
Member
United States

Operaghost is offline
 
Operaghost's Avatar
 
Join Date: Apr 2002
Location: Dallas, TX USA
Posts: 3,873
Correct. Unscheduled programs are not scanned.

OG
__________________
I despise when people take random quotes and ascribe them to me - Julius Caesar
  Reply With Quote
Old March 20th, 2023, 09:45 AM   #10
AMarks95
Member
United States

AMarks95 is offline
 
Join Date: Jul 2018
Location: South Dakota
Posts: 133
Quote:
Originally Posted by Operaghost View Post
Correct. Unscheduled programs are not scanned.

OG
How about an inhibited task? Same thing?
  Reply With Quote
Old March 20th, 2023, 10:20 AM   #11
JeremyM
Lifetime Supporting Member
United States

JeremyM is offline
 
JeremyM's Avatar
 
Join Date: May 2014
Location: Dallas, Texas
Posts: 1,043
Quote:
Originally Posted by AMarks95 View Post
How about an inhibited task? Same thing?
Yes.
__________________
LogixLibraries
  Reply With Quote
Old March 20th, 2023, 10:32 AM   #12
cardosocea
Member
United Kingdom

cardosocea is online now
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 2,364
I'd look at the number of programs limit... but also whether the logic is repeated or not and choose accordingly. Programs seem too large of an organization unit to manage a pump.

Quote:
Originally Posted by JeremyM View Post
You can just use public parameters.
Can he modify these online?
  Reply With Quote
Old March 20th, 2023, 10:49 AM   #13
JeremyM
Lifetime Supporting Member
United States

JeremyM is offline
 
JeremyM's Avatar
 
Join Date: May 2014
Location: Dallas, Texas
Posts: 1,043
Quote:
Originally Posted by cardosocea View Post
I'd look at the number of programs limit... but also whether the logic is repeated or not and choose accordingly. Programs seem too large of an organization unit to manage a pump.
IMO, it's a massive improvement over blobs and blobs of controller-scoped tags that are constantly renamed or added - interlocks, permissives, alarms, and so on - why not just rename a program and maintain common naming within the local scope?

Quote:
Can he modify these online?
No, but one can create a public parameter of the same type and update the logic to reference it.
__________________
LogixLibraries
  Reply With Quote
Old March 20th, 2023, 11:49 AM   #14
cardosocea
Member
United Kingdom

cardosocea is online now
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 2,364
Quote:
Originally Posted by JeremyM View Post
IMO, it's a massive improvement over blobs and blobs of controller-scoped tags that are constantly renamed or added - interlocks, permissives, alarms, and so on - why not just rename a program and maintain common naming within the local scope?

As I remember, there's a limit on number of programs... a pump seems too small of an oject to take up a program. That was my comment.



As for segregation, it's pretty good.



Quote:
Originally Posted by JeremyM View Post
No, but one can create a public parameter of the same type and update the logic to reference it.

Thus increasing dead code and confusion.
  Reply With Quote
Old March 20th, 2023, 12:12 PM   #15
Operaghost
Member
United States

Operaghost is offline
 
Operaghost's Avatar
 
Join Date: Apr 2002
Location: Dallas, TX USA
Posts: 3,873
Program limit has bumped up twice over the years.
  • The limit prior to version 15 was 32 per task
  • The limit from version 15 - 23 was 100 per task
  • The limit from version 24 and newer is 1,000 per task

There really isn't much overhead involved in using a program. But there is some certainly. Not all that much different than creating a subroutine.

OG
__________________
I despise when people take random quotes and ascribe them to me - Julius Caesar

Last edited by Operaghost; March 20th, 2023 at 12:18 PM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


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
Using Studio 5000 View Designer with 5000 Studio Logix Emulate hbenkaab.takeda LIVE PLC Questions And Answers 3 July 22nd, 2020 09:30 AM
RS Logix 5000-Exporting/Importing Routines to another RS Logix 5000 Program Baker in Virginia LIVE PLC Questions And Answers 8 September 27th, 2019 02:27 PM
Studio 5000 V24 crashes when using Save As and when Exporting routines or programs kpElec LIVE PLC Questions And Answers 9 May 20th, 2019 12:15 PM
Is RS Linx still on and loaded with the RS Logix 5000 CD ? Rob S. LIVE PLC Questions And Answers 5 October 21st, 2014 04:24 PM
RSLogix 5000 Routines gizmo LIVE PLC Questions And Answers 4 January 6th, 2004 01:52 PM


All times are GMT -4. The time now is 06:57 AM.


.