how to use the jump to subroutine jsr

normally a subroutine is called and at the end of this subroutine there is a return. in State machines a jump is better.
if condition is true do JSR
 
Since your previous post was about a ML1500 I'm going to assume you are referring to the JSR instruction in Logix500.

If you'll look at the project tree on the left hand side of your screen in Logix500 you'll see something called program files. In a micrologix ladder 2 is the main ladder file. (This is only the case for Logix500 PLCs. PLC/5s and ControlLogix are different). Below ladder 2 you can have as many ladder files as you want up to the limits of memory, but the only way to call them is from the main program with a JSR, or with an interrupt (an advanced topic that we'll leave for you to explore as you get more experience). You add a new ladder file by right clicking on program files and selecting new.

Dividing your logic into smaller ladders helps you organize our program to make writing it easier as well as make future troubleshooting easier. For example, you might put all of your analog scaling in one subroutine and all of your outputs in another with product quality tracking in yet another. Then in your main program #2 you place a JSR instruction to call each of these other ladders in the sequence you want them executed. It is a common practice for programmers to place everything is subroutines and ladder two consists on nothing by a few rungs each with just one JSR instruction on it.
 
Last edited:
This is what it looks like in RSLogix 500
I don't remember what the U stands for, but the file number corresponds to the file where you have your subroutine logic located.

JSRInstruction.jpg
 

Similar Topics

Hello, I have a simple JSR problem which confuses me. The software is RSLogix 5000. In the main routine, I have a rung like this A ------|...
Replies
9
Views
3,492
Hi folks, I have got a logic prob I haven't been able to solve by myself so I wanted to ask you... Does it exist any way to set a bit up to true...
Replies
12
Views
12,422
Hi all! I have a client requesting quotation for us to install a jump box for remote updating of 3 Siemens S7-300 PLC's using Simatic Manager...
Replies
10
Views
2,583
Good Evening , I have a Powerflex drive that has been running steady at about 39 Hz for years , but is beginning to swing 39.6 Hz , 40.5...
Replies
7
Views
2,915
New to rslogix 5000 and factorytalk view me. Where do I find the Jump to Display #?
Replies
7
Views
1,917
Back
Top Bottom