Attributes and comments
The following table provides an overview of all pragmas and comments that can be configured in the server. These can be defined in the various real-time environments of TwinCAT to enable different functionalities. A detailed description of the use of attributes and comments can be found in chapter Enabling symbols.
Using the tags in the PLC When using the pragmas in the PLC, please ensure that you place the key and value in quotation marks. You can find an example in the chapter Enabling symbols\PLC. |
TwinCAT 3
Key | Value | Meaning |
---|---|---|
OPC.UA.DA | 0 | Blocks a symbol explicitly for OPC UA. |
OPC.UA.DA | 1 | Enables a symbol for OPC UA. |
OPC.UA.DA | 2 | Enables a symbol for OPC UA. In the case of a structure and the StructuredDataType, member variables are not loaded into the server's address space as separate nodes. |
OPC.UA.DA.Access | 1 | Sets a node read-only. |
OPC.UA.DA.Access | 2 | Sets a node write-only. |
OPC.UA.DA.Access | 3 | Enables read/write access to a node (default if not set). |
OPC.UA.DA.Alias | <string> | Defines a different name (alias) for a node. |
OPC.UA.DA.Description | <string> | Defines the content of the OPC UA attribute "Description". |
OPC.UA.DA.StructuredType | 0 | Disables the StructuredDataType for a structure. |
OPC.UA.DA.StructuredType | 1 | Enables the StructuredDataType for a structure. |
OPC.UA.DA.Status | quality | Manually define the StatusCode of a symbol in the OPC UA namespace. |
TwinCAT 2
PLC comment | Meaning |
---|---|
(*~ (OPC:0:not available) *) | Locks a variable for OPC UA, whereupon it is no longer visible in the UA namespace. |
(*~ (OPC:1:available) *) | Enables a variable for OPC UA, whereupon it becomes visible in the UA namespace. This tag must always be set if you want to use a variable for UA. |
(*~ (OPC_PROP[0005]:1:read-only) *) | Sets the write protection for a variable. Must be used together with (*~ (OPC: 1: available) *).
|
(*~ (OPC_UA_PROP[5100] : x: Alias name) *) | Specifies x as node name in the UA namespace, so-called alias mapping. |
(*~ (OPC_UA_PROP[5000]:x:Storage media) *) | Enables a variable for "Historical Access". Must be used together with (*~ (OPC: 1: available) *). x defines the storage medium for storing the data values: 1 = RAM 2 = File 3 = SQL Compact Database 4 = SQL Server Database |
(*~ (OPC_UA_PROP[5000][1]:x:SamplingRate) *) | Determines the sampling rate at which the variable values are to be stored, in [ms] depending on the parameter "x" |
(*~ (OPC_UA_PROP[5000][2]:x:Buffer) *) | Defines the maximum number of values that remain in the data memory, depending on the parameter "x". |