15.07.2013 Views

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

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.

The step can be positive or negative.<br />

Positive step: The search is made by increasing addresses.<br />

Negative step: The search is made by decreasing addresses.<br />

Return code<br />

Value found<br />

Positive number equal to the number of steps made to the first occurrence.<br />

Positive step: Return code = (occurrence address - &source)/step<br />

Negative step: Return code = (&source - occurrence address)/(-step)<br />

Value not found<br />

-1: Value not found<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- &source parameter error,<br />

- &source+step*n outside authorised area.<br />

6.19 Return to Calling Module or Network return<br />

Syntax<br />

6 - 18 en-938846/7<br />

return([numerical_expression])<br />

numerical_expression: Value returned to the calling module.<br />

Operation<br />

Returns:<br />

- To the calling module in the case of an intermodule call with the form = sp(....). In this case, the value<br />

of the numerical expression is recovered in .<br />

- To the calling <strong>ladder</strong> network in the case of an intra-module call with the form call(). In this case, the returned<br />

value, if any, cannot be recovered.<br />

Return code<br />

No code is reported by the <strong>function</strong> itself.<br />

! CAUTION<br />

This <strong>function</strong> cannot be called in the test zone.<br />

REMARK An assignment with the form %M20.B = return(Var_ 1+3) is meaningless.

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

Saved successfully!

Ooh no, something went wrong!