Introduction
A derived data type corresponds with:
A derived data type is one of the following
a structure type:
Structure for input/output data, the type is not created by the user in this case, but by the manufacturer (IODDT),
Structure for other data; in this case the type is created by user.
an array type.
a reference type.
Memory Structure
The different PLC families vary in memory structure.
Creating a Structure Type
Step |
Action |
---|---|
1 |
Double click in the Data Editor in the tab on the empty field (marked by an arrow , and enter the name of the structure type (e.g. IDENTITY); the default type is . Enter a comment (optional). |
2 |
Call up the newly created structure by clicking on .Example: ![]() |
3 |
Double-click on the corresponding field and enter the name of the first element of the structure (e.g. Name, Age) and its type and comment (optional).Example: ![]() |
4 |
Double-click on the next cell (marked with an arrow) to enter the name of the next element etc. |
5 |
Go to the name of the structure
type ( |
Result: The structure was successfully analyzed (the symbol in front of the structure type has changed):

Result: The IDENTITY
structure is
created in the structure view of the project:

IDENTITY
structure.Creating a Structure Type with an Extracted Bit
The user can create structure type using extracted bit.
The Bit Rank dialog box is accessible by right clicking on the instance or data type which type must be:
WORD
UINT
INT
BYTE
an extracted bit with a compatible parent
Step |
Action |
---|---|
1 |
Double click in the Data Editor in the tab on the empty field (marked by an arrow , and enter the name of the structure type (for example, MyDDT); the default type is . Enter a comment (optional). |
2 |
Call up the newly created structure by clicking on :![]() |
3 |
Double-click on the corresponding field and enter the name of the first element of the structure (e.g. Extract, Extract1) and its type and comment (optional):![]() |
4 |
Double-click on the next cell (marked with an arrow) to enter the name of the next element etc. |
5 |
Select the variable to create the extracted bit and right-click on the variable. The Edit Bit Rank is available in the contextual menu list: ![]() Here below is the Bit Rank dialog box: ![]() |
6 |
Within the Bit Rank menu, the user can select to named each variable manually or automatically using the Generate button. NOTE: The Bit name
can be edited manually directly in the Data Editor.
|
7 |
Go to the name of the structure
type ( |
Result: The structure was successfully analyzed (the symbol in front of the array type has changed):

Result: The MyDDT
structure is created
in the structure view of the project:

IDENTITY
structure.Creating an Array Type
Use this procedure to create an array type:
Step |
Action |
---|---|
1 |
Double click in the |
2 |
Double click on the field, select , and confirm by pressing .Result: The Variable Type Selection dialog appears. |
3 |
The checkbox is automatically checked:
|
4 |
Confirm with . |
5 |
Change to the name of the array type and go to the shortcut menu and select .Result: The array was successfully analyzed (the symbol in front of the array type has changed): ![]() |
The array type SERIAL_NUMBERS
is created
in the project structure view:

SERIAL_NUMBER
type in the context menu using the command.Creating a Reference Type
Step |
Action |
---|---|
1 |
Double click in the |
2 |
Double click on the field, select , and confirm by pressing .Result: The Variable Type Selection dialog appears. |
3 |
The INT. checkbox is automatically checked. Select the reference data type, in this example: |
4 |
Confirm with . |
5 |
In the Data Editor, right-click the name Result: The reference was successfully analyzed (the symbol in front of the reference type has changed). |
The reference type MyRefInt
is created
in the .
MyRefInt
type using the contextual menu using
the command.Array of References
You cannot make directly, for example, an Array of REF_TO INT. You must first make a reference DDT with type REF_TO INT as in the figure above. Then you make a new DDT type, an array of the references.
In MyRefInt
:

After confirming with
and performing an , you obtain an array of references:
Structure with References
This example shows the creation of an array of reference type variables:
Step |
Action |
---|---|
1 |
Double click tab in the on the empty field (marked by an arrow , enter the name of the structured type and press ENTER. The default type is . |
2 |
Double click and select in the drop-down menu. |
3 |
Press ENTER to open the dialog. |
4 |
Set the size of the array. |
5 |
Select . |
6 |
Select |
The array of reference types example:
