Variables and Function Parameters

The variables of a component are held in a data structure that, like the function heads, is automatically generated. The user has no influence on this data structure. A part of this data structure consists of the instance variables of the component, which can be used in any method. Therefore they have to be passed to all generated functions. This data structure also depends on the code expander and the exact naming is therefore hidden from the user.

In the example from Methods and Processes, the component has a data structure of its own that is passed to the generated function for the method calc. The data structure could look like this:

struct _040VS00C00013Q870ODG52RRJ8T00_Obj  {

ASDObjectHeader objectHeader;

real64_Obj *a;

real64_Obj *b;

real64_Obj *c;

real64_Obj *d;

};

The element names must be valid ANSI C identifiers. In addition to the reserved keywords of C, the names self and this are reserved.

Note

When specifying components in C code, the user must ensure that the names of functions called in the method body do not collide with the names of variables defined in the interface of that same component.

See also

Accessing Elements

Automatically Generated define Statements for Instance Variables

Working with Basic Elements

Messages (C Code)

Arguments

Local Variables

Arrays and Matrices in C Code

Characteristic Lines (C Code)

Characteristic Maps (C Code)

Structure

Header