Übersichtstabelle über alle Konfigurationsparameter
Der Modulgenerator wird über ein Objekt der Klasse TwinCAT.ModuleGenerator.ProjectExportConfig konfiguriert, welches beispielsweise so erzeugt werden kann:
exportCfg = TwinCAT.ModuleGenerator.ProjectExportConfig('FullPath',fullfile(<PathToBuildDir>,<libraryName>));Die Export Konfiguration enthält zwei Arten von Parametern: Projekt-Parameter und Klassen-Parameter:
- Projekt-Paramater beziehen sich auf das übergeordnete Build Projekt und gelten somit für alle Klassen (MATLAB® Funktionen) in dem Build Projekt.
- Klassen-Parameter beziehen sich auf einzelnen, individuell hinzugefügt MATLAB® Funktionen, die Bestandteil des Build Projekts sind (bzw. werden sollen).
Eine Übersicht der aktuell konfigurierten Parameter kann mittels folgenden Befehls in MATLAB® angezeigt werden:
disp(exportCfg);Um alle unten beschriebenen Parameter angezeigt zu bekommen, wechseln Sie in den Konfigurations-Level Advanced:
TwinCAT.ModuleGenerator.Settings.Change('ConfigurationLevel', 'Advanced')Einige Parameter enthalten Platzhalter in der Definition der Standardwerte in der Form $<PlatzhalterName> (Liste der verfügbaren Platzhalter).
Sie können die voreingestellten Standardwerte auch selbst für Ihr System festlegen.
Projekt-Parameter
Name | Configuration Level | Default Value | Description |
|---|---|---|---|
Project.Generate | Advanced | true | Generate a TwinCAT C++ project. If unset, only code artifacts will be generated which can get used to generate C++ projects later. |
Project.ProjectDir | Standard |
| Full path to the directory with the VCXPROJ file (e. g. "C:\Temp") |
Project.ProjectName | Standard |
| Name of the generated VCXPROJ file (e. g. "MyGeneratedProject.vcxproj") |
Project.PreferToolArchitectureX64 | Advanced | true | Prefer X64 compiler and linker. Useful for complex source files, where X86 tools may run out of heap space. |
Project.CppLanguageStandard | Advanced | Default | Enable supported C++ language features from the specified version of the C++ language standard |
Project.Verbosity | Advanced | Normal | Verbosity level of code generation and build output messages. Silent and Detailed are other possible values. |
Project.Publish | 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. |
Project.PublishPlatformtoolset | Standard | Auto | Choose Platform Toolset to build binaries. |
Project.PublishConfiguration | Standard | Release | Build configuration to build binaries. |
Project.PublishTcRTx86 | Standard | true | |
Project.PublishTcRTx64 | Standard | true | |
Project.PublishTcOSx64 | Standard | true | Publish binaries for platform 'TwinCAT OS (x64)' (e.g. TwinCAT/BSD) |
Project.PublishTcOSx64E | Standard | false | Publish binaries for platform 'TwinCAT OS (x64)' (e.g. Beckhoff Real-Time Linux®) |
Project.PublishTcOSARMv8A | Standard | false | Publish binaries for platform 'TwinCAT OS (ARMV8-A)' (requires TwinCAT XAE >= 3.1.4026) |
Project.ForceRebuildForPublish | Advanced | false | Always rebuild all source files on publish |
Project.PublishParallel | Advanced | true | Build parallel on multiple cores to publish |
Project.SignTwinCatCertName | Standard |
| Certificate name for TwinCAT signing with OEM Certificate level 2 |
Project.TmxInstall | Advanced | true | Install all generated TwinCAT Objects on local XAE (fill local Engineering Repository). |
Project.TmxArchive | Standard |
| |
Project.DeploymentPath | 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 |
Project.DeployRestart | Advanced | false | If set the specified TwinCAT project will be activated and restarted on the configured target system |
Project.PreCodeGenerationCallbackFcn | Standard |
| The defined MATLAB® function is called before code generation |
Project.PostCodeGenerationCallbackFcn | Standard |
| The defined MATLAB® function is called after code generation |
Project.PostPublishCallbackFcn | Standard |
| |
Project.PostDeployCallbackFcn | Advanced |
| |
Project.ClassFactoryName | Advanced | $<Project:Name> | Name of the generated C++-Project, Name of the TcCOM classfactory and tmx-file name |
Project.ProductName | Advanced | $<ModuleGenerator:ProductId> $<ModuleGenerator:Version:MAJOR.MINOR> | Product name, used e.g. for the module driver description and the module TMC description. |
Project.Copyright | Advanced | Copyright $<VendorName> $<LocalDateTime:%Y> | Copyright notice of the generated module driver file |
Project.Description | Advanced | TwinCAT executable file, generated by TwinCAT $<ModuleGenerator:ProductId> | Driver description |
Project.VendorName | 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. |
Project.VersionSrc | Standard | $<LatestTMFile> | Path to an existing TMC, TML or XML file containing the previous version value. |
Project.IncrementVersion | Standard | Revision | |
Project.DrvFileVersion | Standard | $<VersionFromFile> | |
Project.DrvProductVersion | Advanced | $<DrvFileVersion> | |
Project.CodeGenPlaceholders | Advanced |
| Define custom placeholders |
Project.UseDataExchangeModules | Advanced | false | Manually set DataExchangeModule dependency (currently no need to set manually) |
Project.MaxVisibleArrayElements | Standard | 200 | 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 |
Project.PackOutputPath | 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" |
Project.AdditionalOptions | Advanced |
|
|
Project.LibCatPath | Advanced | $<ProjectDir>\$<Name>.libcat.xml | Path to the PLC library category description file |
Project.LibraryCategories | Advanced | $<VendorName> | Define PLC library category hierarchy. Default only one hierarchy level = vendor. List separated with | possible: <MainCategory>|<SubCategory1>|… |
Project.PlcTypePrefixes | Advanced |
| Define custom type prefixes |
Project.PlcVarPrefixes | Advanced | `PVOID=p \| BOOL=b \| BOOL32=b \| DATE=d \| TIME_OF_DATE=td \| TIME=t \| LTIME=t \| GUID=n` | Define custom variable prefixes |
Project.GeneratePlcLibrary | Standard | false | Generate a PLC library with POUs Define containing POUs with Parameters ClassExportCfg{i}.PlcFb.Generate or ClassExportCfg{i}.TcCom.TcComWrapperFb |
Project.InstallPlcLibrary | Standard | false | Install the generated PLC library for use in the local TwinCAT XAE/PLC |
Project.OemId | Advanced |
| |
Project.OemLicenses | Advanced |
| IDs of OEM Licenses. Multiple IDs may be inserted as a comma separated list. "{GUID},{GUID}" |
Klassen-Parameter
Für jede MATLAB® Funktion, die in ein TwinCAT-Objekt (TcCOM oder Funktionsbaustein) konvertiert werden soll, muss eine Klassen-Export Konfiguration zur Export Konfiguration hinzugefügt werden:
exportCfg.AddClassExportConfig(TwinCAT.ModuleGenerator.Matlab.FunctionExportConfig('MFile',<ModuleName>,'BuildDir',<cppDir>));Diese Klassen-Export Konfiguration wird zu dem entsprechenden cell Array der Export-Konfiguration hinzugefügt. Die Klassen-Export Konfiguration hat folgende Parameter:
ClassExportCfg{i}.<Name> | Configuration Level | Default | Description |
|---|---|---|---|
TcCom.Generate | Standard | true | Generate a TcCOM module class for the function. |
TcCom.ClassName | Standard | <ModuleName> | Name of TcCOM module based on the MATLAB® function READ ONLY |
TcCom.OnlineChange | Standard | false | |
TcCom.ModuleProperties | Advanced |
| Additional properties added to the module description in the TMC file: Name1=Value1|Name2=Value2|... |
TcCom.GroupName | Standard | TE140x|MATLAB Modules | Minor module group name in the TwinCAT XAE module dialog |
TcCom.GroupDisplayName | Advanced | $<GroupName> | Minor module group description in the TwinCAT XAE module dialog |
TcCom.GroupIcon | Advanced | $<TE140x:Icon> | Optional module group icon in the TwinCAT XAE module dialog |
TcCom.ModuleIcon | Advanced | $<TE140x:Icon> | Optional module icon in the TwinCAT XAE module dialog |
TcCom.InitExceptionHandling | Standard | CallerExceptions | Configures how to throw, suppress or handle floating point exceptions during initialization. |
TcCom.UpdateExceptionHandling | Standard | CallerExceptions | Configures how to throw, suppress or handle floating point exceptions during initialization. |
TcCom.AdditionalOptions | Advanced |
|
|
TcCom.OemLicenses | Advanced | $<Project:OemLicenses> | IDs of OEM Licenses. Multiple IDs may be inserted as a comma separated list. "{GUID},{GUID}" |
TcCom.TcComWrapperFb | Standard | false | Generate a PLC Functionblock simplifying the interaction between a PLC and an instance of the generated TcCOM module |
TcCom.TcComWrapperFbProperties | Standard | false | Generate properties for accessible data in the referenced TcCOM object |
TcCom.TcComWrapperFbPropertyMonitoring | 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 |
TcCom.ModuleCaller | Advanced | CyclicTask | CyclicTask: Call module via TwinCAT Task. Module: Call module from another TwinCAT module (see e.g. TcCOM-Wrapper-FB). |
TcCom.CallerVerification | 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. |
TcCom.StepSizeAdaptation | Advanced | RequireMatchingTaskCycleTime | Configure how to handle differences between the default model step size(s) and the cycle time of the assigned task(s). |
TcCom.ExecutionSequence | Advanced | UpdateBeforeOutputMapping | Configure the execution order of input mapping, model code execution and output mapping. |
TcCom.ExecuteModelCode | 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. |
TcCom.BlockDiagramExport | Standard | true | Export graphical block diagram information for monitoring and optional debugging on the generated TwinCAT module in TwinCAT XAE |
TcCom.ResolveMaskedSubsystems | Standard | false | Resolve masked subsystems in the block diagram |
TcCom.ExtendSignalResolution | Standard | false | Intensified search for assignments of variables and block diagram signals (blue signals). This option increases the build time. |
TcCom.BlockDiagramVariableAccess | 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. |
TcCom.BlockDiagramDebugInfoExport | Standard | true | Export additional information required to debug the module using the block diagram. |
TcCom.ExecutionInfoOutput | Advanced | false | Create additional output DataAreas containing execution and exception information. |
TcCom.MonitorExecutionTime | Standard | false | Calculate and expose the execution time of the module as an ADS variable for monitoring purposes. |
TcCom.InputDataAccess | Advanced | Input Destination DataArea | |
TcCom.InputCreateSymbols | Advanced | true | |
TcCom.InputInitValues | Standard | false | Create module parameters for the input variables to allow definition of initial values |
TcCom.InputProperties | Advanced |
| Additional properties added to the Input symbol description in the TMC file. |
TcCom.OutputDataAccess | Advanced | Output Source DataArea | |
TcCom.OutputCreateSymbols | Advanced | true | |
TcCom.OutputProperties | Advanced |
| Additional properties added to the Output symbol description in the TMC file. |
TcCom.InternalDataAccess | Advanced | Internal DataArea | |
TcCom.InternalCreateSymbols | Advanced | true | |
TcCom.TargetVariablesDataAccess | Advanced |
| |
TcCom.TargetVariablesCreateSymbols | Advanced |
| |
TcCom.Namespace | Standard |
|
|
PlcFb.Generate | Standard | true | Generate a PLC-FB for the model. |
PlcFb.ClassName | Standard |
| Name of function block based on the MATLAB® function READ ONLY |
PlcFb.InitExceptionHandling | Standard | CallerExceptions | Configures how to throw, suppress, or handle floating point exceptions during initialization. |
PlcFb.UpdateExceptionHandling | Standard | CallerExceptions | Configures how to throw, suppress, or handle floating point exceptions during cyclic execution. |
PlcFb.AdditionalOptions | Advanced |
|
|
PlcFb.MonitorExecutionTime | Standard | false | Calculate and expose the execution times of TwinCAT modules as an ADS variable for monitoring purposes. |
PlcFb.InputAttributes | Advanced |
| Additional attributes added to the PLC FB Input variables. |
PlcFb.OutputAttributes | Advanced |
| Additional attributes added to the PLC FB Input variables. |
PlcFb.Namespace | Standard |
|
|