For (ESDL Editor)

The for loop stands out as one of the modeling features that are available in ESDL only. There is no equivalent in block diagrams.

The for loop has the following general form:

for ( initExpression; expressionLog; incrExpression )

{

loopStatement; }

This is equivalent to

initExpression;

while (expressionLog) {

loopStatement;

incrExpression; }

In the for loop, every component of the loop head, initExpression, expressionLog, and incrExpression, is optional. The loop condition expressionLog must be of type logical. It is set to true if omitted, which results in an infinite loop.

In ESDL, the components of the loop head are checked for compliance with MISRA-C:2012 rule 14.3:

In order to avoid infinite loops, the maximal number of loop iterations can be limited to a fixed number in the project properties, Experiment Code node, of the associated project (or default project).

See also

Example: For

Project Editor – Experimental Code Node