Basic principles

With special comments, the developer writing a program with TwinCAT 3 is able to write explanatory text directly into the TwinCAT project. By using special markups in the comments, the text can be evaluated automatically. In addition, the structure of the software is also used to show inheritance relationships and dependencies. A table of contents for the documentation is generated automatically. No further markups are required for this.

TwinCAT Documentation Generation uses markups to process documentation comments in your code and formats them into documentation whose name and location you specify in the TE1030-Tc3DocGen window. As output format you can select HTML, among others. Documentation Generation also automatically generates partial class diagrams to show the dependencies of code elements.

The automatic generation of a documentation is based on the following information within a TwinCAT project:

Elements hierarchy

The Description, Summary and Example markups are at the top of the elements hierarchy. These three markups are the prerequisite for using many other markups.

The following example shows how to embed the markup code into the higher-level markup description:

(*!<description>Now follows a code block.

<code> iCount:=iCount+1 </code>

</description>*)

In the generated documentation it looks like this:

Basic principles 1:

The documentation is automatically divided into individual sections during output, which also reflects this hierarchy:

Output formats

TwinCAT 3 Documentation Generation allows you to create your documentation in three different output formats:

The integration in TwinCAT is structured accordingly as follows:

Basic principles 2: