User manual

88 Publication LOGIX-AP010B-EN-P - May 2010
Chapter 3 Software Conversions Instructions
RSLogix 5000 software allows for the option of parameters to be passed to
subroutines and also allows for the subroutine to return a result to the calling
routine by using the RET function.
The following RSLogix 5000 example illustrates how the JSR/SBR instructions
can be used to pass parameters to the called subroutine and return a parameter
from the subroutine to the main routine. In this example, the data_word1 value
is passed to the parameter flow1 while the data_word2 value is passed to the
parameter flow2. The called subroutine, Calculation, evaluates the parameter
fault and this value is passed to the parameter out_bit1 in the calling routine.
Instead of using a subroutine, another option is to use the Add-On Instruction
functions as discussed in Chapter 2.
RSLogix 5000 Parameter Passing