Setting the documentation format for a PLC project
The documentation format of a PLC project determines which output format is used when generating the project documentation. The only supported value is TcDocGen. The format is set via ConsumeXml on the PLC project Tree Item. This feature is available starting with TwinCAT Build 4026.7.
Requirements
- TwinCAT XAE is installed and started.
- A DTE connection to the target instance is active.
-
ITcSysManageris initialized in an STA thread. - A PLC project is included in the solution.
- TwinCAT Build 4026.7 or later.
Setting the documentation format
The following command sets the format to TcDocGen. An empty <DocFormat> tag resets the format to its default value.
ITcSmTreeItem plcProject = sysManager.LookupTreeItem(@"TIPC^PLC1^PLC1 Project");
// Set TcDocGen documentation format
plcProject.ConsumeXml(@"
<TreeItem>
<IECProjectDef>
<ProjectInfo>
<DocFormat>TcDocGen</DocFormat>
</ProjectInfo>
</IECProjectDef>
</TreeItem>");
// Reset to default (empty string sets format to "Default")
plcProject.ConsumeXml(@"
<TreeItem>
<IECProjectDef>
<ProjectInfo>
<DocFormat></DocFormat>
</ProjectInfo>
</IECProjectDef>
</TreeItem>");
Valid values
|
Value |
Meaning |
|---|---|
|
|
TcDocGen documentation generator |
|
|
Resets the format to “default” |