Attribute 'TcGlobalDataType'
![]() | Available from TwinCAT 3.1 Build 4026.20 |
This pragma ensures that user-defined data types are available across projects via the global type system and can also be edited from the PLC. This requires an instance of the type in the respective PLC project.
Conversion with the Convert to Global Type option is therefore no longer necessary.
Syntax: {attribute 'TcGlobalDataType'}
Insertion location: line above the declaration line of a variable
Example:
{attribute 'TcGlobalDataType'}
TYPE ST_Sample :
STRUCT
bVar : BOOL;
nValue : DINT;
END_STRUCT
END_TYPE