RSLogix 500 subroutines

Skidood

Member
Join Date
Oct 2016
Location
Ontario
Posts
215
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,784
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
82
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
3
Views
161
buen dia. tengo una falla al pasar los tags de mi plc SLC 5 0/4 a mi panel me aparece un error Problem writing value " " to item <tag name>...
Replies
1
Views
81
Will someone please convert this logic to pdf?
Replies
2
Views
127
Back
Top Bottom