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,338
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
95
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
109
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
101
Hi All, I've been pulling my hair out trying to fix this for a few days and need some advice. I have V19.01, v20.05, V21, V24, V30, V31, V32...
Replies
5
Views
352
Back
Top Bottom