Rockwell Automation Publication 1789-UM002K-EN-P - January 2015 113
Execute External Routines Chapter 6
Description
The JXR instruction is similar to the Jump to Subroutine (JSR) instruction. The
JXR instruction initiates the execution of the specified external routine:
• The external routine executes one time.
• After the external routine executes, logic execution returns to the routine
that contains the JXR instruction.
Arithmetic Status Flags
Arithmetic status flags are not affected.
Table 8 - EXT_ROUTINE_CONTROL Structure
Mnemonic Data Type Description Implementation
ErrorCode SINT If an error occurs, this value identifies the error. Valid values are
from 0…255.
There are no predefined error codes. The developer of the
external routine must provide the error codes.
NumParams SINT This value indicates the number of parameters associated with
this instruction.
Display only - this information is derived from the
instruction entry.
ParameterDefs EXT_ROUTINE_
PARAMETERS[10]
This array contains definitions of the parameters to pass to the
external routine. The instruction can pass as many as 10
parameters.
Display only - this information is derived from the
instruction entry.
ReturnParamDef EXT_ROUTIN_
PARAMETERS
This value contains definitions of the return parameter from
the external routine. There is only one return parameter.
Display only - this information is derived from the
instruction entry.
EN BOOL When set, the enable bit indicates that the JXR instruction is
enabled.
The external routine sets this bit.
ReturnsValue BOOL If set, this bit indicates that a return parameter was entered for
the instruction. If cleared, this bit indicates that no return
parameter was entered for the instruction.
Display only - this information is derived from the
instruction entry.
DN BOOL The done bit is set when the external routine has executed
once to completion.
The external routine sets this bit.
ER BOOL The error bit is set if an error occurs. The instruction stops
executing until the program clears the error bit.
The external routine sets this bit.
FirstScan BOOL This bit identifies whether this is the first scan after switching
the controller to Run mode. Use FirstScan to initialize the
external routine, if needed.
The controller sets this bit to reflect scan status.
EnableOut BOOL Enable output. The external routine sets this bit.
EnableIn BOOL Enable input. The controller sets this bit to reflect rung-condition-in. The
instruction executes regardless of rung condition. The
developer of the external routine should monitor this status
and act accordingly.
User1 BOOL These bits are available for the user. The controller does not
initialize these bits.
Either the external routine or the user program can set these
bits.
User0 BOOL
ScanType1 BOOL These bits identify the current scan type:
Bit Values Scan Type
00 Normal
01 Pre Scan
10 Post Scan
(not applicable to relay ladder programs)
The controller sets these bits to reflect scan status.
ScanType0 BOOL