Twincat XAE – Visual Studio Settings

There are some settings that need to be made after Twincat 3 installation. These settings are important for version control systems (git etc.) that provide convenience in writing code. The editor settings used during PLC coding can be customised according to the person. This creates a more suitable working environment for the developer and supports productivity. You can use the attached file by importing ready-made settings. Import and export settings can be done from Tools->Export and Import Settings.

Adjustments in the Text Editor

The following 2 settings are recommended from Tools -> Options-> Twincat->PLC Environment->TextEditor tab in Visual Studio or XAE menus.

  1. At the end of each code, it shows a ‘ . ‘ sign. This allows you to see and edit unnecessary spaces at the end of the code.
  2. Consolas – 10 is chosen as a font because it is useful in terms of readability.
Text editor settings

In addition, if you want to see all white space in the code, you can activate this setting in the Edit->Advanced->View White Space tab.


Visibility adjustment of gaps

After the setting, the blanks in the code will be shown with arrow (–>) as below.

View of empty spaces

Settings for the version control system

Activating multiple project files

The setting to be made in this section is required to keep the hardware changes made by Twincat Devices in a separate file. This setting will facilitate file tracking in our version control system and minimise unnecessary changes.

The following settings are recommended from Tools -> Options-> Twincat->XAE Environment->TextEditor tab in Visual Studio or XAE menus.

Saving hardware information in a separate file

Saving line IDs to a separate file

The setting to be made in this section is required to keep the code line numbers in a separate file. This setting will provide convenience in file tracking in our version control system thanks to parsing and will minimise unnecessary changes. Otherwise, since the instantly generated Line ID values for each file will be kept in the relevant file, it creates problems in version control.

It is recommended to make the following setting from Tools -> Options-> Twincat->PLC Environment->WriteOptions tab in Visual Studio or XAE menus.

Separating Line Id’s

For example, you can see how the Line ID values are kept in the .TcPOU extension file in the picture below. When we make the above setting, by keeping these lines elsewhere, we send the code parts that we really want to follow in the POU file to the version control system.

Örnek Line ID kayıtları

Smart Coding assistant settings

In order to display all defined variables in the input assistant and to intelligently suggest defined components as soon as you type, the following two settings must be made. These settings will provide speed and convenience during coding. The following settings are recommended from Tools -> Options-> Twincat->PLC Environment->Smart coding tab in Visual Studio or XAE menus.

Smart coding settings

Ahmet Muhammed Yahşi
Ahmet Muhammed Yahşi
Articles: 2

Leave a Reply

Your email address will not be published. Required fields are marked *