Valley Ind
Member
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,
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,