Create TwinCAT 3 C++ project
After creating a TwinCAT 3 project, open the C++ node and proceed as follows:
- 1. Right-click C++ and choose Add New Item....
If the green C++ symbol is not listed, this means that either a target device is selected that doesn't support TwinCAT C++ or the TwinCAT Solution is currently open in a version of Visual Studio that is not C++-capable (cf. Requirements). - The TwinCAT C++ Project Wizard is shown and all existing project templates are listed.
- 2. A) Select TwinCAT Versioned C++ Project, optionally enter a related project name and click on OK.
B) Alternatively use the TwinCAT Static Library Project, which provides an environment for programming static TC-C++ libraries (see Sample 25).
C) TwinCAT Driver Project are still offered for compatibility reasons, but should no longer be used for new projects. - The TwinCAT Module wizard is displayed.
- 3. In this case, select TwinCAT Module Class with Cyclic I/O and click on OK. If you want to use the OnlineChange capability, select the TwinCAT Module Class Online Changeable.
A name is not necessary and also cannot be entered here. - 4. Enter a unique name in the TwinCAT Class Wizard dialog box or continue with the "Module1" suggestion.
- A TwinCAT 3 C++ project will then be created on the basis of the selected template: