RSLogix 5000 Programs vs Tasks

Shane.platt

Member
Join Date
Jun 2017
Location
Tucson AZ
Posts
19
Hi everyone,
I hope this isn’t too much to ask?!? I hope no one minds my “new programmer” questions. Deep breath, here goes…
I am having some trouble understanding when to use a Program or Task. I need to write logic for machine that will have 3 operating modes, Idle, Manual, Auto.

1. Idle mode will have the coolant circulating, heating elements at preheating temp and web pretension.
2. Manual mode will be just that; all the systems can be manually controlled independently.
3. Auto will confirm all the different systems are started and reached setpoint then once confirmed will start web travel.

My issue is I am not sure how to accomplish each mode.

My options:

Option 1: Create all the tags in the controller tags section(Global) and create different modes (Routines) in the MainTask:MainProgram. Each mode being a routine, and then use JSR or Event to initiate each mode from the MainProgram? This options eliminates destructive bits due to the ability to see all tags as global tags in Controller Tags. I have attached a picture to help illustrate named option1

Problems with Option #1
1. Different routines have different priority. Web travel needs to be the fastest scan rate.
2. 20+ routines (Setup of Servo Drives, Pumps, tank level control, etc) makes following the program difficult.

Option 2: Create different programs under the MainTask for each mode and create program tags(Local) for each program and use alias to manage hardwire inputs and outputs. I have attached a picture to help illustrate named option2


Problems with Option #2
1. Excessive amount of redundant tags for each program to manage hardwire I/Os
2. I am not sure how to integrate the different local tags between programs.
3. Excessive amount of destructive bits because of reason 1.

Option1.jpg Option2.jpg
 
Tasks group programs. Generally speaking most applications only have a few Tasks, Such as "High Speed", where scans are very fast. "Slow Speed" for logic that doesn't need to run that fast, and "PIDs" where you want to control PID loop update rates and such.

Programs are more used to complete some specific process.

Routines are used to control the functions within the program process.

Given the general description of your project, Option #1 is typical, and 20 routines isn't that crazy as long as you keep the program structured you'll be fine. Depending on the size of your program and what you're actually doing, the processor you are using, you may not have to worry about scan rates.

But if you do, create a "super fast task" for the logic that needs to execute fast and predictable, use controller tags to share the data with programs/routines outside the task. Might be an opportunity to use program parameters as well, but that might muddy the waters right now.
 
Paully,
Thank you for the advice!!! I haven't touched an A/B PLC since the late 90s and havent seen ladder in 10 years! I am used to function block. I do have a PID loop I am using to control the speed of 2 servos based on tension, so it needs to react pretty quick. Maybe I could put that in a periodic task. Do you have any recommendations for controlling the outputs without getting these destructive bits?

Shane
 

Similar Topics

I have moved some programs from the tasks to the unscheduled programs / phases. All the code is deleted from the programs; all the tags have been...
Replies
3
Views
4,469
i have factorytalk application (.mer) and rslogix 5000 application(.acd) and the are some problems in factorytalk application some trends are not...
Replies
2
Views
3,889
i think that after electricity got off the program in my plc deleted so i want to comper the program in the computer and the program in the plc...
Replies
4
Views
1,994
Anybody know the pro's/con's of using programs vs routines? For example, say the "Main Task" is a continuous task and we either have 1) a single...
Replies
6
Views
7,096
Can anyone assist me deleting Unschedule programs in RSLogix 5000? I am using an old program and don't need several routines that i shifted it in...
Replies
4
Views
7,772
Back
Top Bottom