In this tutorial, we will demonstrate how to create a project, connect to an industrial controller, and upload a test program.

Creating a project in Visual Studio

  1. First, open the integrated development environment Visual Studio 2019 and click on Create a new project, to create a new project. 
  2. In the Create a new project dialog, select TwinCAT XAE Project and click Next
  3. Then, specify the project name and click Next
  4. Next, right-click on the PLC subfolder to open the menu, where you click Add New Item.... Select Standard PLC Project, specify the project name, and click Add.









Povezovanje na napravo

  1. In the toolbar, click on <Local> and select Choose Target System...from the options. 
  2. A window will appear with already connected devices. To connect to a new device, click Search (Ethernet)
  3. A dialog for searching controllers will open; press the Broadcast Search button to search for devices. 
  4. A window will appear where you select the network interfaces through which you want to search for devices and click OK
  5. Industrial controllers will be named PLC-1 ... PLC-9. Select the controller that has been assigned to you and press the Add Route button. A window will open where you enter the username and password. The username is Administrator, and the password is avtomatika. Once successfully connected to the controller, a lock icon will appear next to the name, and then click Close.

















Setting up inputs and outputs

  1. To set up inputs and outputs, we first need to activate configuration mode by clicking the blue icon in the toolbar.
  2. Right-click on Device and click Scan to automatically add inputs and outputs.

Uploading to the PLC

  1. We upload the program to the controller by pressing the Activate configuration button located in the taskbar. 
  2. If a dialog appears with the text Some required runtime licenses missing. Generate trial licenses., click Yes and enter the CAPTCHA code, and then click OK.








Working without the physical system connected

If we want to develop and test the software solution without a physical system, we need to disable the input-output modules and select the local computer as the target system for compiling our code.

  1. Right-click on I/ODevicesDevice 3 (CX7000).
  2. In the context menu, click Disable.
  3. Repeat the same for Device 1 (EtherCAT).