RSLogix 5000 Scanning Question

Krilun

Member
Join Date
Aug 2008
Location
Cleveland
Posts
44
Hey all,

I'm taking on my first big project and had a general, hopefully simple, question. Under my MainTask, I have my MainProgram, and under that I have my MainRoutine. If I create a new Program, for examples sake called Valves, and put some Functional Block Diagrams in that program, does the program Valves get scanned after MainProgram finishes? Assuming it does, what if I wanted to goto a routine in the Program Valves while in the MainProgram. I noticed I can't use a JSR.

Thanks a bunch,
-Ken-
 
All programs under a top level task, will execute in the order specified in the top level task configuration. Right click "MainTask", select properties, and look at the configuration page.

No, you cannot JMP or JSR between program's. JSR's can only call routines at the same nesting level as the caller.
 
In the configuration, yes. Actually, I meant that in the above post, but didn't have Logix open... There is a tab for "Program / Phase Schedule". That is where you set the order of execution of sub programs.

By default, the MainTask is scanned cyclically; that is, top to bottom, over and over again as processor time slots allow.

You can create other tasks as well, either as Periodic (run's at a specific time interval) or Event (run's upon a trigger). You can have multiple periodic or event tasks, but only one cyclic.

In any task, the scanning order of sub programs is determined by the task's "Program / Phase Schedule".

In any program, the scanning order of separate routines is up to you to determine by subroutine calls.

I generally make a "MainRoutine" which is just a dispatcher, calling various routines in order per program.

The overall structure is:

Controller -> Task -> Program -> Routine
| | |-> Routine
| |
| |-> Program -> Routine
|
|-> Task -> Program -> Routine

 
rdrast said:
I generally make a "MainRoutine" which is just a dispatcher, calling various routines in order per program.

Actually you must make a Main Routine (space is deliberate!), and use it as a "dispatcher" for your other routines.

In a Program's properties, you have to define one of your Routines as the Main Routine for the Program. The default structure for a new program has this assignment done automatically for you.

The assigned Main Routine is the only routine that the controller will automatically execute, the others being called by (generally) JSR calls from the assigned Main Routine, or other routines.

The Main Routine is named "MainRoutine" by default, although you can change it's name.

RSLogix puts the assigned Main Routine at the top of the list of routines in the Program (it also flags the routine Icon so you can see it is assigned). All the other routines are just listed beneath the Main Routine alphanumerically.
 
Nesting allways takes first priority within any system, unless specified. Routine scan assignment within AB can be scheduled as per your requirements, on various levels.
 

Similar Topics

Hi, I think I have got this correct but I just want to make sure. I have acquired a program which has quite a lot of JSR's and RETurn's in the...
Replies
3
Views
2,346
Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
2
Views
157
I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
578
First off, I'm a hobbyist-level programmer, and this program isn't controlling anything anything that could even remotely be considered "life...
Replies
18
Views
518
Back
Top Bottom