25.07.2014 Views

1756-PM003H-EN-E, SFC and ST Programming Languages ...

1756-PM003H-EN-E, SFC and ST Programming Languages ...

1756-PM003H-EN-E, SFC and ST Programming Languages ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10-2 Program Control Instructions (JSR, RET, SBR)<br />

Jump to Subroutine (JSR)<br />

Subroutine (SBR)<br />

Return (RET)<br />

The JSR instruction jumps execution to a different routine. The SBR<br />

<strong>and</strong> RET instructions are optional instructions that exchange data with<br />

the JSR instruction.<br />

JSR Oper<strong>and</strong>s:<br />

Relay Ladder<br />

Oper<strong>and</strong>: Type: Format: Description:<br />

Routine ROUTINE name routine to execute (i.e., subroutine)<br />

name<br />

Input<br />

parameter<br />

Return<br />

parameter<br />

BOOL<br />

SINT<br />

INT<br />

DINT<br />

REAL<br />

structure<br />

BOOL<br />

SINT<br />

INT<br />

DINT<br />

REAL<br />

structure<br />

Structured Text<br />

immediate<br />

tag<br />

array tag<br />

tag<br />

array tag<br />

data from this routine that you want to copy<br />

to a tag in the subroutine<br />

• Input parameters are optional.<br />

• Enter multiple input parameters, if<br />

needed.<br />

tag in this routine to which you want to copy<br />

a result of the subroutine<br />

• Return parameters are optional.<br />

• Enter multiple return parameters, if<br />

needed.<br />

JSR(RoutineName,InputCount,<br />

InputPar,ReturnPar);<br />

Oper<strong>and</strong>: Type: Format: Description:<br />

Routine ROUTINE name routine to execute (i.e., subroutine)<br />

name<br />

Input count SINT<br />

INT<br />

DINT<br />

REAL<br />

immediate number of input parameters<br />

Input<br />

parameter<br />

Return<br />

parameter<br />

BOOL<br />

SINT<br />

INT<br />

DINT<br />

REAL<br />

structure<br />

BOOL<br />

SINT<br />

INT<br />

DINT<br />

REAL<br />

structure<br />

immediate<br />

tag<br />

array tag<br />

tag<br />

array tag<br />

data from this routine that you want to copy<br />

to a tag in the subroutine<br />

• Input parameters are optional.<br />

• Enter multiple input parameters, if<br />

needed.<br />

tag in this routine to which you want to copy<br />

a result of the subroutine<br />

• Return parameters are optional.<br />

• Enter multiple return parameters, if<br />

needed.<br />

(JSR oper<strong>and</strong>s continued on next page)<br />

Publication <strong>1756</strong>-<strong>PM003H</strong>-<strong>EN</strong>-E (excerpt from <strong>1756</strong>-RM003H-<strong>EN</strong>-P) - August 2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!