RSLogix 500 subroutines

Skidood

Member
Join Date
Oct 2016
Location
Ontario
Posts
213
Hi again, a real basic question here, I just want to confirm something.

My ladder logic has a few subroutine call instructions (JSR) in Ladder 2. The subroutines are Ladders 8, 9, and 10, which all contain a normal END instruction on the last rung. (I understand this is the same as using a RET instruction)

When the scan of ladder 2 through 7 has completed, does the unit skip over scanning Ladders 8-10 before scanning subsequent ladders, then executing the logic and repeating the scan? Does it know NOT to scan the subroutine ladders a 2nd time?
 
Once the PLC finishes scanning ladder 2, including executing the requested subroutines, it then performs updating outputs, updating communications, rereading inputs, then starts scanning ladder 2 at the top. It doesn't fall through and execute subroutines even though they are shown below it in the listing on the side.
 
OH, so it wont scan any ladders after Lad 2 (other than the subroutines)? Meaning they wont get scanned unless they are called in Lad 2?
 
For SLC unless you call it from LAD2 with JSR it won't execute, this is also one of the biggest why is it not working pitfall. If you don't tell it to execute it won't.

For 5000 platform if it's not the Program MainRoutine or FaultRoutine it wont run unless called from the Routine assigned as MainRoutine.
 
Last edited:
Can't you also call a sub without the JSR but by using the STI? I don't know that I've done it but I "think" it can be done that way.
If this is incorrect, someone set me straight.
 
Only LAD2 is executed automatically by the SLC-500/MicroLogix controller operating system.

All other routines need to be called by a JSR, or by an interrupt (STI or DII).

It is very common for LAD2 to contain JSRs to every other subroutine in the program, but it's also possible for a subroutine to have a JSR to another subroutine.

This is different from Programs in a Task in ControlLogix (and different from Main Programs in a PLC-5); the operating systems are different and we can discuss that separately if you wish.
 

Similar Topics

Hi, Working with an AB Micrologix 1500, RSLogix 500 programming. I'm trying to write subroutines to control a 3 floor elevator system. Main...
Replies
40
Views
16,757
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
113
I would like to copy register N61:131 thru N61:147 into ST252:0 I keep failing What happens is I copy into ST252:0,1, 2 etc. What am i missing...
Replies
18
Views
485
I'm trying to fix a mess of code on an older machine that's running a Micrologix 1400 and an RS232 ASCII barcode scanner. The previous guy had...
Replies
3
Views
306
I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
260
Back
Top Bottom