How to create a new TwinCAT3 Project from scratch
Auteur Gareth Green | Dernière modification 12/09/2023 par Gareth Green en cours de rédaction ⧼frevu-button-review-label⧽
Difficulté
Hard Difficile
How to create a new TwinCAT3 Project from scratch
TwinCAT3, Project, New
Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_145941.jpg
Introduction
...Beckhoff Technical help is available on 01491 410539 option 3
Étape 1 - Add Drive Manager 2 for AX8000 drives (if not installed already)
...This step needs to be done for the AX8000 drives only
Copy the Drive Manager 2 setup g:\design\TwinCAT3\TE5950-TC3-Drive-Manager-2.zip to Install Files on the PC running Visual Studio
Close Visual Studio
Extract the Zip File
Run the Setup File
Étape 2 - Start a new project
Open Visual Studio
Click on New project
Choose TwinCAT projects->TwinCAT XAE Project (xml format)
Name is build number (no Suffix)
Location is c:\TwinCAT\Stuga\
Untick "Create Directory for solution"
This creates the template
Étape 3 - Add PLC Project for tcMulti
Add Existing Item
Navigate to g:\Design\TwinCAT3\tcMulti_6_24
Select the .Plcproj file
Copy Project to solution file
Étape 4 - Add PLC Project for Reset
On PLC, right click and Add Existing Item
Navigate to g:\Design\TwinCAT3\PLC_Reset_1_1
Select the .Plcproj file
Copy Project to solution file
Navigate to tcMulti_6_24 project->POUs->MAIN
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
Your goal is to ensure the correct machine is highlighted and the incorrect ones are commented out (in green)
Click Save All
...Check the date next to the machine types - you will want the latest one
Étape 6 - Add TwinSAFE project
...From Z071 there is no twinSAFE project as the Estop circuit is hard wired
Étape 7 - Add the route to the PLC
From Dropdown box select the Build number (If it does not exist we will need to add a new route)
If there is a request for a platform change, click Yes
On success, the Route dropdown will not read Error
Étape 8 - Scan for Devices
Expand IO
Right click on devices, Scan
Click OK on the Hint:
Untick RT-Ethernet
Untick COM-Port
Just have the EtherCAT ports
Scan for boxes - Yes
If there is a request for New Device Type, Click Apply to All, Click Yes
Étape 9 - Check EtherCAT validity
Check the Devices and boxes match the expected EtherCAT setup
...Check the green lights on the etherCAT boxes for connection status. Flickering Green means it is OK
Repeat steps 7 and 8 until the physical network matches the scanned network
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 10 - Name all EtherCAT devices according to network
...Do not start this step until the EtherCAT network is fully verified. You will waste a lot of time if you ignore this!
Click twice on each device (not double click) to enable the device to be renamed
rename to convention
Étape 11 - Map all IO References
Using the circuit diagrams, map all the IO ref numbers to the associated IO channels
Double click a field-bus box or slice
Ensure you can see the input / Output list (may need some screen resizing
Double click an IO channel
Enter the number in the search box
Double click the associated IO Ref number from ibInputArray(inputs) or qbOutputArray(outputs)
...Click Save All regularly so you do not loose progress, as this process can take a considerable time
...Be very vigilant and ensure you only click on ibInputArray or qbOutputArray
Repeat for all IO
Étape 12 - Double check all IO references with someone else
Any mistakes made will save hours if spotted here
Étape 13 - Install Drive Manager 2 Project
Note which Device number has the drive in it
Left-click on FILE. A new context menu open
Move the mouse to Add.
Left-click on New Project .
Select TwinCAT Drive manager 2 on left
Click on TwinCAT Drive manager 2 Project on right
Save with filename "[BuildNo] Drive Manager" in the folder for the project (c:\TwinCAT\Stuga\[BuildNo])
EtherCAT master will be the device that has the drive in from Step 1
Leave the basic settings, click OK
This should link up the drives set in previous steps to a Drive Manager project
Étape 14 - Add Axis Task
A smooth setup will have detected the axes and added them under the MOTION tab already.
if not, an axis task may need to be added under the MOTION tree:
Add New Item
NC/PTP Configuration
Leave the Name as default
Étape 15 - Add Axes
...This step may not be necessary if the Device scan added them automatically
If the axes do not exist under MOTION->NC Task->Axes, add them
Right Click Add axis
Name to convention nn Axis
Repeat for each axis on machine
Axis naming and configuration for different machines can be found here
Étape 16 - Map Axes
...This step may not be necessary if the Device scan added them automatically
Double click an axis
Settings tab
Click Link To IO
Connect to associated Drive
Click Link to PLC
Use the reference here to get the Axis Numbers
Repeat for each axis
...Make sure you select the correct channel number / letter is it is a dual drive
Étape 17 - Add PLC_Reset to tc3Multi Link
...An output from tcMulti needs to be set up to an input on PLC reset to allow the PLC to reset itself. This is linke a physical wire between two PLCs but just exists in the software
Expand PLC_Reset Instance to get to ibResetPLC
Double Click ibResetPLC to open the properties
Link to qbResetPLC (this is very far down the list)
Activate configuration
Étape 18 - Activate configuration
en
none
0
Draft
Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #
Pas encore enregistré ? Créez un compte pour profiter de toutes les fonctionnalités du service !
Copiez-collez le code ci-dessous à intégrer sur votre page