Available placeholders
Placeholders are used in the Target for Simulink® configuration to reduce configuration effort and increase clarity. Placeholders are specified in the configuration with $<PlaceholderName>.
What are placeholders?
Placeholders can be used to specify the value of a configuration parameter abstractly as a variable. Specific placeholders exist at the level of the target (module generator), the project and the modules (TcCOM and PLC FB). Furthermore, the configuration parameter itself is also a placeholder, so you can reuse it.
Example:
In the above graphic, the driver product version is specified with the placeholder $<DrvFileVersion>. This placeholder points to the driver file version entry, which in turn is occupied by the placeholder $<VersionFromFile>. The placeholder $<VersionFromFile> assumes the version value, where the source of the version value is defined with the version source file parameter.
Why do we need placeholders?
Placeholders allow us to define a parameter value and reuse it in many places in the configuration, or to set them in a chain dependency in relation to each other (see example above).
Overview of available placeholders
Placeholders from the group of configuration parameters
Category | Name | Displayname | Default | Description |
---|---|---|---|---|
TC General | Generate | Generate TwinCAT C++ Project | TRUE | |
| ProjectDir | TwinCAT C++ Project Directory |
| Full path to the directory with the VCXPROJ file (e. g. "C:\Temp") |
| ProjectName | TwinCAT C++ Project Name |
| Name to the generated VCXPROJ file (e. g. "MyGeneratedProject.vcxproj") |
| LowestCompatibleTcBuild | Lowest compatible TwinCAT version (build number) | $<TwinCAT:Version:BUILD> | The lowest TwinCAT build number the generated C++ project and its modules and POUs are to be compatible with. |
| ClassFactoryName | Class factory name | $<Project:Name> | Name of the generated C++-Project, Name of the TcCOM classfactory and tmx-file name |
| ProductName | Product name | $<ModuleGenerator:ProductId> $<ModuleGenerator:Version:MAJOR.MINOR> | Product name, used e.g. for the module driver description and the module TMC description. |
| Copyright | Copyright notice | Copyright $<VendorName> $<LocalDateTime:%Y> | |
| Description | Driver description | TwinCAT executable file, generated by TwinCAT $<ModuleGenerator:ProductId> | |
| VendorName | Vendor name | TE140x Module Vendor | Module vendor name, used as the company name of the generated executables in the repository and the major module group as shown in the TwinCAT XAE module dialog. |
| VersionSrc | Version source file | $<LatestTMFile> | Path to an existing TMC, TML or XML file containing the previous version value. |
| IncrementVersion | Version part for increment | Revision | |
| DrvFileVersion | Driver file version | $<VersionFromFile> | |
| DrvProductVersion | Driver product version | $<DrvFileVersion> | |
| CodeGenPlaceholders | Code generation placeholders |
| Define custom placeholders |
| UseDataExchangeModules | Load DataExchangeModules | 0 | Manually set DataExchangeModule dependency (currently no need to set manually) |
| MaxVisibleArrayElements | Maximum number of visible array elements | 200U | Specifies the maximum number of array elements to be displayed in the TwinCAT XAE. In the TwinCAT XAE, larger arrays cannot get expanded and linked to by its individual items |
| PackOutputPath | Pack output path |
| Path to pack the generated TwinCAT C++ project. Optional. Can be a directory or .zip file. See Sample "Use Continuous Integration Principles with Code Generation" |
TC Build | PreferToolArchitectureX64 | Prefer X64 build tools | TRUE | Prefer X64 compiler and linker. Useful for complex source files, where X86 tools may run out of heap space. |
| CppLanguageStandard | Specify C++ language standard version | Default | Enable supported C++ language features from the specified version of the C++ language standard |
| Verbosity | Codegeneration and build verbosity | Normal | Verbosity level of code generation and build output messages. Silent and Detailed are other possible values. |
| Publish | Run the publish step after project generation | TRUE | Start the build procedure after code generation for all selected platforms. The generated module binaries and module descpription files will get copied to the "publish folder". Published modules are automatically located by the XAE and can get instantiated in all TwinCAT 3 projects. If unset, the module generation process will be stopped after code generation. To instantiate in a TwinCAT3 project, the generated C++ project needs to be inserted and built from. |
| PublishPlatformtoolset | Platform Toolset | Auto | Choose Platform Toolset to build binaries. |
| PublishConfiguration | Build configuration | Release | Build configuration to build binaries. |
| PublishTcRTx86 | TwinCAT RT (x86) | TRUE | |
| PublishTcRTx64 | TwinCAT RT (x64) | TRUE | |
| PublishTcOSx64 | TwinCAT OS (x64) | TRUE | Publish binaries for platform 'TwinCAT OS (x64)' (e.g. TwinCAT/BSD) |
| PublishTcOSARMv8A | TwinCAT OS (ARMV8-A) (TwinCAT XAE >= 3.1.4026) | FALSE | Publish binaries for platform 'TwinCAT OS (ARMV8-A)' (requires TwinCAT XAE >= 3.1.4026) |
| ForceRebuildForPublish | Always rebuild all source files on publish | FALSE | Always rebuild all source files on publish |
| PublishParallel | Build parallel to publish
| TRUE | Build parallel on multiple cores to publish |
| SignTwinCatCertName | Certificate name for TwinCAT signing |
| Certificate name for TwinCAT signing with OEM Certificate level 2. |
| TmxInstall | Install TMX | TRUE | Install all generated TwinCAT Objects on local XAE (fill local Engineering Repository). |
| TmxArchive | TMX Archive |
| |
| MsBuildPublishProperties | MsBuild publish properties |
| Set additional MsBuild publish properties. |
| MsBuildProjProperties | MsBuild project properties |
| Set additional MsBuild project properties. |
| PreCodeGenerationCallbackFcn | Pre code generation callback function |
| The defined MATLAB® function is called before code generation. |
| PostCodeGenerationCallbackFcn | Post code generation callback function |
| The defined MATLAB® function is called after code generation. |
| PostPublishCallbackFcn | Post publish callback function |
| |
| DeploymentPath | Deployment project |
| |
| DeployRestart | Activate and restart deployment project | FALSE | If set the specified TwinCAT project will be activated and restarted on the configured target system |
| PostDeployCallbackFcn | Post deploy callback function |
| |
TC PLC library | LibCatPath | PLC library category description file | $<ProjectDir>\$<Name>.libcat.xml | Path to the PLC library category description file |
| LibraryCategories | PLC library categories | $<VendorName> | Define PLC library category hierarchy. Default only one hierarchy level = vendor. List separated with | possible: <MainCategory>|<SubCategory1>|… |
| GeneratePlcLibrary | Generate a PLC library | FALSE | Generate a PLC library with POUs. Define containing POUs with parameter TcComWrapperFb and PlcFb>General>Generate. |
| InstallPlcLibrary | Install the generated PLC library | FALSE | Install the generated PLC library for use in the local TwinCAT XAE/PLC. |
| PlcTypePrefixes | Type Prefixes |
| Define custom type prefixes |
| PlcVarPrefixes | Variable Prefixes | `PVOID=p \| BOOL=b \| BOOL32=b \| DATE=d \| TIME_OF_DATE=td \| TIME=t \| LTIME=t \| GUID=n` | Define custom variable prefixes. |
TC License | OemId | ID of OEM |
| |
| OemLicenses | IDs of OEM Licenses |
| IDs of OEM Licenses. Multiple IDs may be inserted as a comma separated list. "{GUID},{GUID}" |
TC TcCom General | Generate | Generate TcCOM Module (TwinCAT Module Class) | TRUE | Generate a TcCOM module class for the model. |
| OnlineChange | Online change support | FALSE | Allow to switch between different TcCOM module versions without switching TwinCAT runtime to config mode. |
| ModuleProperties | TMC Properties |
| Additional properties added to the module description in the TMC file: Name1=Value1|Name2=Value2|... |
| GroupName | GroupName | TE140x\|Simulink Modules | Minor module group name in the TwinCAT XAE module dialog |
| GroupDisplayName | GroupDisplayName | $<GroupName> | Minor module group description in the TwinCAT XAE module dialog |
| GroupIcon | GroupIcon | $<TE140x:Icon> | Optional module group icon in the TwinCAT XAE module dialog |
| ModuleIcon | ModuleIcon | $<TE140x:Icon> | Optional module icon in the TwinCAT XAE module dialog |
| InitExceptionHandling | Floating point exception handling during initialization | CallerExceptions | Configures how to throw, suppress or handle floating point exceptions during initialization. |
| UpdateExceptionHandling | Floating point exception handling during update | CallerExceptions | Configures how to throw, suppress or handle floating point exceptions during cyclic execution. |
| AdditionalIncludeFiles | Additional include files |
| Additional files required to be included after rtwtypes.h |
TC TcCom License | OemLicenses | IDs of OEM License | $<Project:OemLicenses> | IDs of OEM Licenses. Multiple IDs may be inserted as a comma separated list. "{GUID},{GUID}" |
TC TcCom Wrapper | TcComWrapperFb | TcCom Wrapper FB | FALSE | |
| TcComWrapperFbProperties | TcCom Wrapper FB properties | FALSE | Generate properties for accessible data in the referenced TcCOM object |
| TcComWrapperFbPropertyMonitoring | TcCom Wrapper FB property monitoring | NoMonitoring | |
TC TcCom Additional settings | ModuleCaller | Default module caller | CyclicTask | CyclicTask: Call module via TwinCAT Task. Module: Cal module from another TwinCAT module (see e.g. TcCOM-Wrapper-FB). |
| CallerVerification | Verify caller | Default | Verify the caller context to prevent concurrent execution of the model code and corresponding DataArea mappings. Skip verification to reduce the execution time. |
| StepSizeAdaptation | Default StepSize adaptation mode | RequireMatchingTaskCycleTime | Configure how to handle differences between the default model step size(s) and the cycle time of the assigned task(s). |
| ExecutionSequence | Default execution sequence | UpdateBeforeOutputMapping | Configure the execution order of input mapping, model code execution and output mapping. |
| ExecuteModelCode | Execute model code after startup | TRUE | Start cyclic execution of the model code after startup by default. If FALSE, Module Parameter Execute needs to be set to TRUE to start execution of code. |
| BlockDiagramExport | Export BlockDiagram | TRUE | |
| ResolveMaskedSubsystems | Resolve Masked Subsystems | FALSE | Resolve masked subsystems in the block diagram |
| ExtendSignalResolution | Extended resolution of signals in block diagram | FALSE | |
| BlockDiagramVariableAccess | Access to VariableGroup not referenced by any block | AssignToParent | Variables from a block within an unresolved subsystem are either assigned to the next higher visible block or hidden in the block diagram. |
| BlockDiagramDebugInfoExport | Export BlockDiagram debug info | TRUE | Export additional information required to debug the module using the block diagram. |
TC TcCom Interfaces | ExecutionInfoOutput | Create ExecutionInfo output | FALSE | Create additional output DataAreas containing execution and exception information. |
| MonitorExecutionTime | Monitor execution time | FALSE | Calculate and expose the execution time of the module as an ADS variable for monitoring purposes. |
| InputDataAccess | Input: Data Access | Input Destination DataArea | |
| InputCreateSymbols | Input: Create ADS Symbols | TRUE | |
| InputInitValues | Input: Initial values | FALSE | Create module parameters for the input variables to allow definition of initial values |
| InputProperties | Input: TMC Properties |
| Additional properties added to the Input symbol description in the TMC file. |
| OutputDataAccess | Output: Data Access | Output Source DataArea | |
| OutputCreateSymbols | Output: Create ADS Symbols | TRUE | |
| OutputProperties | Output: TMC Properties |
| Additional properties added to the Output symbol description in the TMC file. |
| ParametersDataAccess | Parameters: Data Access | Internal DataArea | Defines how the model parameter variables are exposed in TwinCAT |
| ParametersCreateSymbols | Parameters: Create ADS Symbols | TRUE | Create ADS symbol information for the model parameter variables. |
| ParametersInitValues | Parameters: Initial values | TRUE | Create module parameters for the model parameter variables to allow definition of initial values. |
| ParametersProperties | Parameters: TMC Properties |
| Additional properties added to the Parameters symbol description in the TMC file. |
| BlockIoDataAccess | BlockIO: Data Access | Internal DataArea | |
| BlockIoCreateSymbols | BlockIO: Create ADS Symbols | TRUE | |
| BlockIoProperties | BlockIO: TMC Properties |
| Additional properties added to the BlockIO symbol description in the TMC file. |
| ContStateDataAccess | ContState: Data Access | Internal DataArea | |
| ContStateCreateSymbols | ContState: Create ADS Symbols | TRUE | Create ADS symbol information for the continuous state variables. |
| ContStateProperties | ContState: TMC Properties |
| Additional properties added to the ContState symbol description in the TMC file. |
| DWorkDataAccess | DWork: Data Access | Internal DataArea | |
| DWorkCreateSymbols | DWork: Create ADS Symbols | TRUE | |
| DWorkProperties | DWork: TMC Properties |
| Additional properties added to the DWork symbol description in the TMC file. |
| DataStoreDataAccess | DataStore: Data Access | None | |
| DataStoreCreateSymbols | DataStore: Create ADS Symbols | TRUE | |
| DataStoreReadOnly | DataStore: Read Only | FALSE | Restrict ADS access to be read only for the DataStore variables. |
| DataStoreProperties | DataStore: TMC Properties |
| Additional properties added to the DataStore symbol description in the TMC file. |
| SymbolProperties | Additional TMC Symbol Properties |
| Additional properties added to specific symbol descriptions in the TMC file. |
| VariableSymbolMapping | Mapping between variable names and ADS symbol names | Identical | |
TC TcCom External Mode | ExtModeRtAllowExecutionCommands | Allow RealTime execution commands via External Mode | FALSE | Allow to start and stop model code execution via External Mode. |
| ExtModeRtWaitForStart | Wait for RealTime execution start command via External Mode | FALSE | Wait for External Mode connection before starting model code execution. |
| ExtModeRtAllowForParameterChange | Allow to change parameters via External Mode | FALSE | Allow to change parameter online values via External Mode. |
TC PlcFb General | Generate | Generate TwinCAT PLC Function Block | TRUE | |
| InitExceptionHandling | Floating point exception handling during initialization | CallerExceptions | Configures how to throw, suppress, or handle floating point exceptions during initialization. |
| UpdateExceptionHandling | Floating point exception handling during update | CallerExceptions | Configures how to throw, suppress, or handle floating point exceptions during cyclic execution. |
TC PlcFb License | OemLicenses | IDs of OEM License | $<Project:OemLicenses> | IDs of OEM Licenses. Multiple IDs may be inserted as a comma seperated list. "{GUID},{GUID}" |
TC PlcFb Additional settings | MonitorExecutionTime | Monitor ExecutionTime | FALSE | Calculate and expose the execution times of TwinCAT modules as an ADS variable for monitoring purposes. |
PlcFb->Interface | InputAttributes | Input variables: PLC Attributes |
| Additional attributes added to the PLC FB Input variables. |
| OutputAttributes | Output variables: PLC Attributes |
| Additional attributes added to the PLC FB Input variables. |
TC PlcFb External Mode | ExtModeRtAllowExecutionCommands | Allow RealTime execution commands via External Mode | FALSE | Allow to start and stop model code execution via External Mode. |
| ExtModeRtWaitForStart | Wait for RealTime execution start command via External Mode | FALSE | Wait for External Mode connection before starting model code execution. |
| ExtModeRtAllowForParameterChange | Allow to change parameters via External Mode | FALSE |
Placeholders at target level (module generator)
Placeholders from this group can be used at target/project and module level.
Placeholder name | Description |
---|---|
ModuleGenerator:ProductName | Product name of the module generator |
ModuleGenerator:Version | Version of the module generator |
TwinCAT:Version | Version of local TwinCAT installation |
UsablePlatformToolsets | Available and supported platform toolsets |
LocalDateTime:Format | Actual local time as string where Format must be defined like the format string for std::put_time (e.g. '%Y-%m-%d') |
UtcDateTime:Format | Actual UTC time as string where Format must be defined like the format string for std::put_time (e.g. '%Y-%m-%d') |
EnvironmentVarName | Any environment variable defined for the system, the current user or the current process (MATLAB®). |
Placeholders at project level
Placeholders from this group can be used at project and module level.
Placeholder name | Description |
---|---|
Project:Name | Name of the project file (without directory and extension) |
Project:Dir | Project file directory |
Project:Ext | Project file extension |
Project:Path | Full project file path |
Project:Guid | Project GUID |
Project:LibraryID | LibraryID of the generated repository driver |
Project:VendorName | Company name part of the LibraryID |
Project:DriverName | Driver name part of the LibraryID |
Project:DrvFileVersion | Version part of the LibraryID |
Project:LatestTMFile | Path to an existing corresponding TML or TMC file with the highest library version (searching project directory and repository) |
Project:LatestTMFile:Repository | Path to an existing corresponding TML or TMC file with the highest library version (searching only repository) |
Project:LatestTMFile:ProjectDir | Path to an existing corresponding TML or TMC file with the highest library version (searching only project directory) |
Project:VersionFromFile | Version read from file defined by "VersionSrc" |
Placeholders at module level (TcCOM and PLC FB)
Placeholders from this group can only be used at module level.
Placeholder name | Description |
---|---|
Module:Name | Name of the TcCom module or PLC FB |
Module:ClsId | Class ID of the TcCom module (TcCom only) |
Module:ContextCount | Number of task contexts |
Module:ClassName | Name of the TcCom module |
Module:CppClassFileName | Name of the corresponding .h and .cpp files |
Module:ModelName | Name of the corresponding Simulink Model (TE1400 only) |
Module:MFileName | Name of the corresponding M-File (TE1401 only) |
Module:FileFilterName | Visual Studio project filter name |