READ, WRITTEN, CHANGED, TRUE, and FALSE in Complex Data Types
Sensing how the rd() , wr() , and ch() events, as well as tr() and fs(), are related to complex Data-Types requires the Code Generator to create some additional C Data-Types and variables. These type declarations are put in the same header file as the type declaration for the complex type itself. (Remember that the names and number of header files varies, based on whether the Separate File per Statechart option was selected in the profile under Options > Module Settings.)
Additional types are required for wr() and rd() as well as additional variable declarations. These additional types have similar structures to the complex types themselves. The type have fields with the same name but the types of the fields are EVENTS. These are used to store the event of WRITTEN or READ for each of the fields of the complex type.
A separate variable is defined for rd() and wr(). Each is defined as a type COMPLEX_VARIABLE_NAME_event. The name of the variables is the same as the complex type itself, with either wr or rd prefixed, as appropriate. One or more fields in the wr or rd variable is set when these fields are READ or WRITTEN. This is found in the procedure for the action that sets or uses the referenced field values.