Verfügbare Platzhalter

Platzhalter werden in der Konfiguration des Target for MATLAB® verwendet, um den Konfigurationsaufwand zu reduzieren und die Übersichtlichkeit zu erhöhen. Platzhalter werden in der Konfiguration mit $<PlaceholderName> angegeben.

Was sind Platzhalter?

Platzhalter können genutzt werden, um den Wert eines Konfigurationsparameters abstrakt als Variable anzugeben. Es existieren spezifische Platzhalter auf Ebene des Targets (Modulgenerator), des Projekts und der Module (TcCOM und PLC FB). Darüber hinaus sind Konfigurationsparameter selbst ebenso Platzhalter, sodass diese wiederverwendet werden können.

Beispiel: Standardeinstellung der Versionierung

exportCfg.Project.DrvProductVersion = '$<DrvFileVersion>';
exportCfg.Project.DrvFileVersion = '$<VersionFromFile>';

Bei der Erstellung versionierter Treiber wird standardmäßig die driver product Version mit dem Platzhalter $<DrvFileVersion> angegeben. Dieser Platzhalter verweist auf den Eintrag driver file Version, welcher wiederum mit dem Platzhalter $<VersionFromFile> besetzt ist. Der Platzhalter $<VersionFromFile> nimmt den Versionswert an, wobei die Quelle des Versionswerts mit dem Parameter Version source file definiert wird.

Wofür benötige ich Platzhalter?

Platzhalter bieten die Möglichkeit, einen Parameterwert zu definieren und an vielen Stellen der Konfiguration wiederzuverwenden, oder sie in einer Kettenabhängigkeit zueinander zu setzen (siehe obiges Beispiel).

Übersicht der verfügbaren Platzhalter

Platzhalter aus der Gruppe der Konfigurationsparameter

Placeholder name

Category

Configuration Level

Default Value

Description

Generate

Project

Advanced

true

Generate a TwinCAT C++ project. If unset, only code artifacts will be generated which can get used to generate C++ projects later.

ProjectDir

Project

Standard

 

Full path to the directory with the VCXPROJ file (e. g. "C:\Temp")

ProjectName

Project

Standard

 

Name to the generated VCXPROJ file (e. g. "MyGeneratedProject.vcxproj")

PreferToolArchitectureX64

Project

Advanced

true

Prefer X64 compiler and linker. Useful for complex source files, where X86 tools may run out of heap space.

CppLanguageStandard

Project

Advanced

Default

Enable supported C++ language features from the specified version of the C++ language standard

Verbosity

Project

Advanced

Normal

Verbosity level of code generation and build output messages. Silent and Detailed are other possible values.

Publish

Project

Standard

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

Project

Standard

Auto

Choose Platform Toolset to build binaries.

PublishConfiguration

Project

Standard

Release

Build configuration to build binaries.

PublishTcRTx86

Project

Standard

true

Publish binaries for platform 'TwinCAT RT (x86).'

PublishTcRTx64

Project

Standard

true

Publish binaries for platform 'TwinCAT RT (x64).'

PublishTcOSx64

Project

Standard

true

Publish binaries for platform 'TwinCAT OS (x64)' (e.g. TwinCAT/BSD)

PublishTcOSx64E

Project

Standard

false

Publish binaries for platform 'TwinCAT OS (x64-E)' (requires TwinCAT XAE >= 3.1.4026)

PublishTcOSARMv8A

Project

Standard

false

Publish binaries for platform 'TwinCAT OS (ARMV8-A)' (requires TwinCAT XAE >= 3.1.4026)

ForceRebuildForPublish

Project

Advanced

false

Always rebuild all source files on publish

PublishParallel

Project

Advanced

true

Build parallel on multiple cores to publish

SignTwinCatCertName

Project

Standard

 

Certificate name for TwinCAT signing with OEM Certificate level 2.

TmxInstall

Project

Advanced

true

Install all generated TwinCAT Objects on local XAE (fill local Engineering Repository).

TmxArchive

Project

Standard

 

Name of an optional archive containing all files required to use the generated TwinCAT Objects on another TwinCAT development system.

DeploymentPath

Project

Advanced

 

Full path to a TwinCAT project (.tsproj). Instances of the generated TcCOM Module in the specified project will be upgraded to the newly generated version

DeployRestart

Project

Advanced

false

If set the specified TwinCAT project will be activated and restarted on the configured target system

PreCodeGenerationCallbackFcn

Project

Standard

 

The defined MATLAB® function is called before code generation.

PostCodeGenerationCallbackFcn

Project

Standard

 

The defined MATLAB® function is called after code generation.

PostPublishCallbackFcn

Project

Standard

 

The defined MATLAB® function is called after publish.

PostDeployCallbackFcn

Project

Advanced

 

The defined MATLAB function is called after deployment

ClassFactoryName

Project

Advanced

$Project:Name

Name of the generated C++-Project, Name of the TcCOM classfactory and tmx-file name

ProductName

Project

Advanced

$<ModuleGenerator:ProductId> $<ModuleGenerator:Version:MAJOR.MINOR>

Product name, used e.g. for the module driver description and the module TMC description.

Copyright

Project

Advanced

Copyright $<VendorName> $<LocalDateTime:%Y>

Copyright notice of the generated module driver file

Description

Project

Advanced

TwinCAT executable file, generated by TwinCAT $<ModuleGenerator:ProductId>

Driver description

VendorName

Project

Standard

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

Project

Standard

$<LatestTMFile>

Path to an existing TMC, TML or XML file containing the previous version value.

IncrementVersion

Project

Standard

Revision

The part of the version number that is to be incremented.

DrvFileVersion

Project

Standard

$<VersionFromFile>

Executable file version and library version.

DrvProductVersion

Project

Advanced

$<DrvFileVersion>

Product version

CodeGenPlaceholders

Project

Advanced

 

Define custom placeholders

UseDataExchangeModules

Project

Advanced

false

Manually set DataExchangeModule dependency (currently no need to set manually)

MaxVisibleArrayElements

Project

Standard

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

Project

Advanced

 

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"

LibCatPath

Project

Advanced

$<Project:Dir>\$<Project:Name>.libcat.xml

Path to the PLC library category description file

LibraryCategories

Project

Advanced

$<VendorName>

Define PLC library category hierarchy. Default only one hierarchy level = vendor. List separated with | possible: <MainCategory>|<SubCategory1>|…

PlcTypePrefixes

Project

Advanced

 

Define custom type prefixes

PlcVarPrefixes

Project

Advanced

PVOID=p | BOOL=b | BOOL32=b | DATE=d | TIME_OF_DATE=td | TIME=t | LTIME=t | GUID=n

Define custom variable prefixes.

GeneratePlcLibrary

Project

Standard

false

Generate a PLC library with POUs. Define containing POUs with parameter TcComWrapperFb and PlcFb>General>Generate.

InstallPlcLibrary

Project

Standard

false

Install the generated PLC library for use in the local TwinCAT XAE/PLC.

OemId

Project

Advanced

 

ID of OEM. Required for OEM Licence checks

OemLicenses

Project

Advanced

 

IDs of OEM Licenses. Multiple IDs may be inserted as a comma separated list. "{GUID},{GUID}"

Generate

TcCom (Module)

Standard

true

Generate a TcCOM module class for the model.

ClassName

TcCom (Module)

Standard

 

TcCOM module name (READONLY)

OnlineChange

TcCom (Module)

Standard

false

Allow to switch between different TcCOM module versions without switching TwinCAT runtime to config mode.

ModuleProperties

TcCom (Module)

Advanced

 

Additional properties added to the module description in the TMC file: Name1=Value1|Name2=Value2|...

GroupName

TcCom (Module)

Standard

TE140x|MATLAB Modules

Minor module group name in the TwinCAT XAE module dialog

GroupDisplayName

TcCom (Module)

Advanced

$<GroupName>

Minor module group description in the TwinCAT XAE module dialog

GroupIcon

TcCom (Module)

Advanced

$<TE140x:Icon>

Optional module group icon in the TwinCAT XAE module dialog

ModuleIcon

TcCom (Module)

Advanced

$<TE140x:Icon>

Optional module icon in the TwinCAT XAE module dialog

InitExceptionHandling

TcCom (Module)

Standard

CallerExceptions

Configures how to throw, suppress or handle floating point exceptions during initialization.

UpdateExceptionHandling

TcCom (Module)

Standard

CallerExceptions

Configures how to throw, suppress or handle floating point exceptions during cyclic execution.

AdditionalIncludeFiles

 

Standard

 

Additional files required to be included after rtwtypes.h

OemLicenses

TcCom (Module)

Advanced

$<Project:OemLicenses>

IDs of OEM Licenses. Multiple IDs may be inserted as a comma separated list. "{GUID},{GUID}"

TcComWrapperFb

TcCom (Module)

Standard

false

Generate a PLC Functionblock simplifying the interaction between a PLC and an instance of the generated TcCOM module

TcComWrapperFbProperties

TcCom (Module)

Standard

false

Generate properties for accessible data in the referenced TcCOM object

TcComWrapperFbPropertyMonitoring

TcCom (Module)

Advanced

NoMonitoring

NoMonitoring: Online values of properties are not monitored in the PLC online view, CyclicUpdate: Update property values in the PLC online view cyclically, ExecutionUpdate: Update property values in the PLC online view when the property getter or setter is called

ModuleCaller

TcCom (Module)

Advanced

CyclicTask

CyclicTask: Call module via TwinCAT Task. Module: Cal module from another TwinCAT module (see e.g. TcCOM-Wrapper-FB).

CallerVerification

TcCom (Module)

Advanced

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

TcCom (Module)

Advanced

StepSizeAdaptation

Configure how to handle differences between the default model step size(s) and the cycle time of the assigned task(s).

ExecutionSequence

TcCom (Module)

Advanced

UpdateBeforeOutputMapping

Configure the execution order of input mapping, model code execution and output mapping.

ExecuteModelCode

TcCom (Module)

Advanced

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

TcCom (Module)

Standard

true

Export graphical block diagram information for monitoring and optional debugging on the generated TwinCAT module in TwinCAT XAE

ResolveMaskedSubsystems

TcCom (Module)

Standard

false

Resolve masked subsystems in the block diagram

ExtendSignalResolution

TcCom (Module)

Standard

false

Intensified search for assignments of variables and block diagram signals (blue signals). This option increases the build time.

BlockDiagramVariableAccess

TcCom (Module)

Standard

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

TcCom (Module)

Standard

true

Export additional information required to debug the module using the block diagram.

ExecutionInfoOutput

TcCom (Module)

Advanced

false

Create additional output DataAreas containing execution and exception information.

MonitorExecutionTime

TcCom (Module)

Standard

false

Calculate and expose the execution time of the module as an ADS variable for monitoring purposes.

InputDataAccess

TcCom (Module)

Advanced

Input Destination DataArea

Defines how the input variables are exposed in TwinCAT.

InputCreateSymbols

TcCom (Module)

Advanced

true

Create ADS symbol information for the input variables

InputInitValues

TcCom (Module)

Standard

false

Create module parameters for the input variables to allow definition of initial values

InputProperties

TcCom (Module)

Advanced

 

Additional properties added to the Input symbol description in the TMC file.

OutputDataAccess

TcCom (Module)

Advanced

Output Source DataArea

Defines how the output variables are exposed in TwinCAT.

OutputCreateSymbols

TcCom (Module)

Advanced

true

Create ADS symbol information for the output variables.

OutputProperties

TcCom (Module)

Advanced

 

Additional properties added to the Output symbol description in the TMC file.

InternalDataAccess

TcCom (Module)

Advanced

Internal DataArea

Defines how the internal variables are exposed in TwinCAT.

InternalCreateSymbols

TcCom (Module)

Advanced

true

Create ADS symbol information for the internal variables.

TargetVariablesDataAccess

TcCom (Module)

Advanced

Internal DataArea

Defines how the target variables are exposed in TwinCAT.

TargetVariablesCreateSymbols

TcCom (Module)

Advanced

true

Create ADS symbol information for the target variables.

Namespace

TcCom (Module)

Standard

 

 

Generate

PlcFb (Module)

Standard

true

Generate a PLC-FB for the function.

ClassName

PlcFb (Module)

Standard

 

FunctionBlock name (<READONLY>)

InitExceptionHandling

PlcFb (Module)

Standard

CallerExceptions

Configures how to throw, suppress, or handle floating point exceptions during initialization.

UpdateExceptionHandling

PlcFb (Module)

Standard

CallerExceptions

Configures how to throw, suppress, or handle floating point exceptions during cyclic execution.

MonitorExecutionTime

PlcFb (Module)

Standard

false

Calculate and expose the execution times of TwinCAT modules as an ADS variable for monitoring purposes.

InputAttributes

PlcFb (Module)

Advanced

 

Additional attributes added to the PLC FB Input variables.

OutputAttributes

PlcFb (Module)

Advanced

 

Additional attributes added to the PLC FB Input variables.

Hinweis zur Auflösung von Platzhaltern:

Platzhalter auf Ebene des Targets/Projekts (ModulGenerator)

Platzhalter dieser Gruppe können auf Ebene des Projekts und der Module verwendet werden.

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®).

Platzhalter auf Ebene des Projekts

Platzhalter dieser Gruppe können auf Ebene des Projekts und der Module verwendet werden.

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"

Platzhalter auf Ebene der Module (TcCOM und PLC FB)

Platzhalter dieser Gruppe können nur auf Ebene der Module genutzt werden.

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