Defining Data Structure

Description

A data structure, ST_MyData in this example, is used to transmit user data from the C2C Slave (C2C Data Output) to the C2C Master (C2C Data Input).

NOTE: In general, you can use any data structure for this data transfer (for example, a data structure of the data type DINT or a data structure of an existing library).

Defining ST_MyData

Define a structure ST_MyData as DUT object to map the 10 bytes user data:

Step

Action

1

Add a new structure with the name ST_MyData to the Application node of your project.

2

Enter the following code in the ST_MyData tab:

{attribute 'pack_mode' := '1'}
TYPE ST_MyData :
STRUCT
   diData1 : DINT;
   diData2 : DINT;
   uiData3 : UINT;
END_STRUCT
END_TYPE