Experiment Code Node

Note

For microcontroller targets, these options are not available.

The following experiment code options are available:

Max Number of Loop Iterations

A value > 0 determines the maximum number of iterations the generated code will execute in a loop. Each loop generated by the code generation will contain a loop counter that causes the loop to end if the counter reaches the specified value. This option is useful for avoiding infinite loops.

ClosedEXAMPLE

Loop with loop counter

The example shows the generated code for a simple loop. Max Number of Loop Iterations is set to 100; the loop counter is shown in boldface.

_t1uint32 = (uint32)1;

for (index = 0; index < max; index++)

{

  {

    counter = index;

if (_t1uint32++ > 100)

{

asdWriteUserError ("Run Time Error: reached maximum number of
      loop iterations in component <component name>\n");

break;

}

  }

A value of 0 deactivates this feature. No additional code is created in the loops, but infinite loops become possible. A warning (WMdl921) is generated during code generation. By default, this warning is (globally) promoted to an error.

Enable logging of all data changes

Must be activated, if you want to use the data logger to log all changes of logged variables. The data logger is described in Data Logger.

Use OID for Generation of Component Names

Specifies whether the component OID (activated) or the model name (deactivated) is used as component name in the generated code.

Note

If the option is deactivated, you are responsible for avoiding name clashes. 

Add Comment with Specification Info for each Element

When this option is activated, a comment is generated for each element. This comment contains element specification information.

Message Usage Variant

Generation variant for ASCET message usage. See Message Copy Semantics for Experiment Code for details. The following selections are available:

See also

Component Manager – Promoting Messages

Component Manager – List of Warning Messages

Data Logger

Message Copy Semantics for Experiment Code