Automap Symbols
Variables from the PLC can be automatically mapped in the human-machine interface using the automap function. To do this, attributes must be set on the relevant variables in the PLC. The HMI searches the existing ADS symbols and creates them automatically if the relevant attribute is present.
Available attributes:
Attributes |
Description |
Version |
---|---|---|
'TcHmiSymbol.AddSymbol' |
Mapping the variables in the HMI using the automap function. |
>= 1.12.756.1 |
'TcHmiSymbol.AddSymbol.Ignore' |
Ignore the variables; underlying variables with AddSymbol attribute are still mapped. |
>= 1.14.x.x |
'TcHmiSymbol.AddSymbol.IgnoreRecursively' |
Ignore the variables and the underlying variables. |
>= 1.14.x.x |
'TcHmiSymbol.AddSymbol.Hidden' |
Hides the mapping (only visible when extended symbols are displayed). |
>= 1.12.756.1 |
'TcHmiSymbol.AddSymbol.UserGroups' |
Creates a read/write authorization for user groups. |
>= 1.12.756.1 |
'TcHmiSymbol.AddSymbol.UserGroups.Read' |
Creates a read authorization for user groups. |
>= 1.14.x.x |
Example – ST (variable declaration in the PLC)
Adding a variable
{ attribute 'TcHmiSymbol.AddSymbol' }
_i : INT;
Adding a variable that is hidden in the human-machine interface
{ attribute 'TcHmiSymbol.AddSymbol' }
{ attribute 'TcHmiSymbol.AddSymbol.Hidden' }
_i : INT;
Adding a variable, with read/write authorization for two user groups
{ attribute 'TcHmiSymbol.AddSymbol' }
{ attribute 'TcHmiSymbol.AddSymbol.UserGroups' := '__SystemAdministrators,Operators' }
_i : INT;
Adding the automap symbols in Visual Studio/TcXaeShell

- 1. Open the TwinCAT HMI Configuration window.
- 2. Go to the Server Symbols / All Symbols tab.
- 3. Right-click on ADS.
- 4. Start the automatic mapping via Map Automap Symbols.
- After adding, a message about the number of symbols added or an error message appears.
![]() | A maximum of 1000 symbols are currently mapped via Visual Studio/TcXaeShell. |
Adding the automap symbols via JavaScript
- 1. Add a new JavaScript file to the project.
- 2. Open the JavaScript file you have created.
- 3. Call up the writeEx function and describe the AddSymbols symbol.
- Automatic mapping of symbols is started by describing the symbol.
Parameter – AddSymbols
Name | Type | Description | Version |
---|---|---|---|
domain | Server domain that AddSymbols will be executed on. | >= 1.12.756.1 | |
path | Move the search entry point to sub-levels. "PLC1::MAIN::_fbMachine" The search starts from _fbMaschine. | >= 1.14.x.x | |
namePrefix | Adds the defined prefix to the beginning of the symbol name. | >= 1.14.x.x | |
dryRun | Only searches for symbols without creating them. | >= 1.12.756.1 | |
ignoreProblems | Continues the request if problems occur. | >= 1.12.756.1 | |
Ignore | string [] | Specified symbols are not taken into account during creation. ["ADS.PLC1.MAIN._axis"] | >= 1.12.756.1 |
skipExisting | Only symbols that do not yet exist are created. | >= 1.12.756.1 | |
limit | int32 | Limits the number of symbols that are searched for. | >= 1.14.x.x |
Example – JavaScript (start Automap Symbols, minimal data for request):
TcHmi.Symbol.writeEx('%s%AddSymbols|Timeout=5000%/s%', {domain: "ADS"}, function (data) {
// callback value
console.log(data);
// number of found symbols
console.log(Object.keys(data?.value).length);
});
Example – JavaScript (start Automap Symbols):
let config = {
domain: "ADS",
path: "PLC1::MAIN::_fbMachine",
namePrefix: "AutoMapp.",
dryRun: false,
ignoreProblems: false,
ignore: [
"ADS.PLC1.MAIN._axis"
],
skipExisting: true,
limit: 3000
}
TcHmi.Symbol.writeEx('%s%AddSymbols|Timeout=5000%/s%', config, function (data) {
// callback value
console.log(data);
// number of found symbols
console.log(Object.keys(data?.value).length);
});
![]() | This functionality is available since version 1.12.756.1. |
![]() | This functionality is only available with an ADS connection and not with a TMC file. |
![]() | The attributes do not currently work for methods or properties. |