Create a TwinCAT Project from Scratch

Auteur avatarGareth Green | Dernière modification 12/09/2023 par Gareth Green en cours de rédaction

Étape 1 - Start a new project

  1. Open Visual Studio
  2. Click on New project
  3. Choose TwinCAT projects->TwinCAT XAE Project (xml format)
  4. Name is build number (no Suffix)
  5. Location is c:\TwinCAT\Stuga\
  6. Untick "Create Directory for solution"

This creates the template


Étape 2 - Add PLC Project for Reset

  1. On PLC, right click and Add Existing Item
  2. Navigate to g:\Design\TwinCAT3\PLC_Reset_1_1
  3. Select the .Plcproj file
  4. Copy Project to solution file


Étape 3 - Add PLC Project for tcMulti

  1. Add Existing Item
  2. Navigate to g:\Design\TwinCAT3\tcMulti_6_24
  3. Select the .Plcproj file
  4. Copy Project to solution file


Étape 4 - Ensure Correct Machine Commented in tcMulti project


  1. Navigate to tcMulti_6_24 project->POUs->MAIN
  2. Scroll down to the machine types. The "comment State" can be toggled on and off by right clicking next to the step number on the left
  3. Your goal is to ensure the correct machine is highlighted and the incorrect ones are commented out (in green)
  4. Click Save All
...Check the date next to the machine types - you will want the latest one

Étape 5 - Add TwinSAFE project

...From Z071 there is no twinSAFE project as the Estop circuit is hard wired

Étape 6 - Add the route to the PLC

  1. From Dropdown box select the Build number (If it does not exist we will need to add a new route)
  2. If there is a request for a platform change, click Yes
  3. On success, the Route dropdown will not read Error

Étape 7 - Scan for Devices and Check EtherCAT validity

  1. Expand IO
  2. Right click on devices, Scan
  3. Untick RT-Ethernet
  4. Untick COM-Port
  5. Just have the EtherCAT ports
  6. Scan for boxes - Yes
  7. If there is a request for New Device Type, Click Apply to All, Click Yes
  8. Check the Devices and boxes match the expected EtherCAT setup


Repeat this until the physical network matches the scanned network

...Check the green lights on the etherCAT boxes for connection status. Flickering Green means it is OK
You may need to Right Click->scan Boxes on the second device if the EtherCAT boxes do not appear
...If the boxes do not appear in the right order, there could be an EtherCAT In /Out crossover


Étape 8 - Name all EtherCAT devices according to network

Étape 9 - Add Drive Configurator

...This step needs to be done for the AX8000 drives only

Commentaires

Draft