Data type properties
Editing the properties of data types
General properties
Name: user-defined name of the data type.
Note | |
Name conflict A name collision can occur if the driver is used in combination with a PLC module.
|
Namespace: user-defined namespace of the data type.
Please note that this is not assigned to a C namespace. It is used as the prefix to your data type.
Sample: an enumeration with a namespace "A":
The following code is generated:
///<AutoGeneratedContent id="DataTypes">
#if !defined(_TC_TYPE_41D4A207_3A09_4316_9D89_0DD1881AB8C4_INCLUDED_)
#define _TC_TYPE_41D4A207_3A09_4316_9D89_0DD1881AB8C4_INCLUDED_
enum A_ASampleEnum : SHORT {
One,
Two,
Three
};
#endif // !defined(_TC_TYPE_41D4A207_3A09_4316_9D89_0DD1881AB8C4_INCLUDED_)
You may wish to manually append the namespace name to the enumeration element as a prefix:
#if !defined(_TC_TYPE_C26FED5F_AC13_4FD3_AC6F_B658CB5604E0_INCLUDED_)
#define _TC_TYPE_C26FED5F_AC13_4FD3_AC6F_B658CB5604E0_INCLUDED_
enum B_BSampleEnum : SHORT {
B_one,
B_two,
B_three
};
#endif // !defined(_TC_TYPE_C26FED5F_AC13_4FD3_AC6F_B658CB5604E0_INCLUDED_)
GUID: unique ID of the data type.
Specification: specification of the data type.
- Alias: generate an alias of a standard data type (e.g. INT).
- Array: create a user-defined array.
- Enumeration: create a user-defined enumeration.
- Struct: generate a user-defined structure.
- Interface: generate a new interface.
Select data type
Select: Select data type – it can be a basic TwinCAT data type or a user-defined data type.
Data types equivalent to the PLC data types are defined (like TIME, LTIME, etc.). See Data Types of the PLC for further information.
Description: Define the type as pointer, reference or value by means of the appropriate selection.
- Normal type
- Pointer
- Pointer to pointer
- Pointer to pointer to pointer
- a reference
Type information
- Namespace: Defined for selected data type.
- GUID: Unique ID of the selected data type.
Optional data type settings
Size [Bits]: Size in bits (white fields) and in "Byte.Bit" notation (grey fields). A different size can be defined for the x64 platform.
C/C++ Name: name used in the generated C++ code. The TMC code generator will not generate the declaration, so that user-defined code can be provided for this data type. Beyond that a different name can be defined for x64.
Unit: a unit of the variable.
Comment: comment that is visible, for example, in the instance configurator.
Hide sub items: If the data type has sub-elements, the System Manager will not allow the sub-elements to be accessed. This should be used, for example, in the case of larger arrays.
Persistent (even if unused): Persistent type in the global type system (cf. System->Type System->Data Types).
Optional Defaults
Depending on data type the default could be defined.
Optional Properties
A table of name, value and description for annotating the data type.
This information is provided within the TMC and also TMI files.
TwinCAT functions as well as customer programs can use these properties.
Datatype Hides
Listed GUIDs refer to data types which are hidden by this data type. Normally, GUIDs of previous versions of this data type are inserted here automatically on each change.