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

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

TcDocGen documentation generator

"" (empty)

Resets the format to “default”