edwinmart
Member
I am trying to use the JSR instruction instead of repeat dozens of times the same rung structure. By using JSR to jump to a separate routine, pass data to the routine, execute the routine, and return results.
I know that I have to specify the Input and Output Parameters but inside the subroutines what tags I use?
But maybe Im no far from reality...
What I think is using JSR with values of input pars I0.0 and I0.1 and output par O0.0
-----------JSR-----------
| Routine Name: Routine A
| Input par: I0.0
| Input par: I0.1
| Return par: O0.0
-------------------------
Then inside the rungs in subroutine "Routine A"
I use the SBR instruction
--------SBR------
| Input par: Ix
| Input par: Iy
-----------------
--[ ADD Ix, Iy, Oz ] -------
then the return instruction inside "Routine A"
------RET-------
| Return par: Oz
----------------
So the value of Oz goes to O0.0
If I am wrong please tell me.
RSlogix 5000 v13
Last edited: