Need help with RSLogix5000 & JSR

Valley Ind

Member
Join Date
May 2013
Location
Columbiana, Ohio
Posts
38
I have:
1734-AENTR processor
RSLogix5000 version 20

I am working with a JSR and it is behaving in a way I did not expect and I am unable to figure it out. Below is the Ladder for the MAIN ROUTINE and SUB ROUTINE 02.
What I expected was that even though PB_02 in SUB ROUTINE 02 is TRUE and PB00 in the MAIN ROUTINE is FALSE then when SUB ROUTINE 02 gets called Bit02 should not get set to TRUE because the value of PB00 is FALSE. A FALSE should have been sent from the MAIN ROUTINE to SUB ROUTINE 02.
But it appears that even if PB00 in the MAIN ROUTINE is FALSE the JSR is sending it as a TRUE to SUB ROUTINE 02 because if I toggle PB_02 to TRUE then Bit02 is also getting set to TRUE.

Can someone explain what is happening and what is the correct method for using a JSR as I am trying to here?


Thank you,

JSR.jpg
 
When you use the "Input Par" within the "JSR" instrcution in your case "PB00", the value of that address is put in the address of the "SBR"'s instruction "Input Par" in your case "Bit01". You would need to add an "XIC" instruction with the address of "Bit01" to rung 0 of the subroutine.

The "SBR" instruction is just a place holder which is always true no matter what the value(s) is/are of its input par(s).
 
Last edited:

Similar Topics

Hi Everybody, It is just a simple program but i still can't do it. Pls look into my attachment picture. I can key in the Preset value of...
Replies
2
Views
1,432
i need help with RsLogix5000 to translate this ladder diagram to structured text .
Replies
2
Views
1,311
Local:1:0.Data[0] is 32 bits long and has output for my 4 DeviceNet Devices (8 bit each). My question is how do i separate them and put each...
Replies
7
Views
2,402
Hi All, I am looking for some help, on writing a logic to control the Power output from a VFD using PID... I will appreciate your help...
Replies
3
Views
2,602
i need to pass a value stored in a tag to a timer as its preset value. how do i do something like this? this preset value will be the result of...
Replies
2
Views
1,973
Back
Top Bottom