Create a TwinCAT Project from Scratch : Différence entre versions

[version en cours de rédaction][version en cours de rédaction]
Ligne 39 : Ligne 39 :
 
|Step_Picture_02=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125632.jpg
 
|Step_Picture_02=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125632.jpg
 
|Step_Picture_02_annotation={"version":"2.4.6","objects":[{"type":"image","version":"2.4.6","originX":"left","originY":"top","left":0,"top":0,"width":939,"height":530,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":0.64,"scaleY":0.64,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://stuga.dokit.app/images/1/16/Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125632.jpg","filters":[]},{"type":"wfnumberedbullet","version":"2.4.6","originX":"left","originY":"top","left":238,"top":17,"width":25,"height":25,"fill":"rgb(0,0,0)","stroke":"#FF0000","strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"objects":[{"type":"circle","version":"2.4.6","originX":"center","originY":"center","left":0,"top":0,"width":24,"height":24,"fill":"#FF0000","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"radius":12,"startAngle":0,"endAngle":6.283185307179586},{"type":"text","version":"2.4.6","originX":"center","originY":"center","left":0,"top":0,"width":7.79,"height":15.82,"fill":"rgba(255,255,255,255)","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"text":"5","fontSize":14,"fontWeight":"normal","fontFamily":"arial","fontStyle":"normal","lineHeight":1.16,"underline":false,"overline":false,"linethrough":false,"textAlign":"left","textBackgroundColor":"","charSpacing":0,"styles":{} }],"number":5}],"height":339,"width":600}
 
|Step_Picture_02_annotation={"version":"2.4.6","objects":[{"type":"image","version":"2.4.6","originX":"left","originY":"top","left":0,"top":0,"width":939,"height":530,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":0.64,"scaleY":0.64,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://stuga.dokit.app/images/1/16/Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125632.jpg","filters":[]},{"type":"wfnumberedbullet","version":"2.4.6","originX":"left","originY":"top","left":238,"top":17,"width":25,"height":25,"fill":"rgb(0,0,0)","stroke":"#FF0000","strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"objects":[{"type":"circle","version":"2.4.6","originX":"center","originY":"center","left":0,"top":0,"width":24,"height":24,"fill":"#FF0000","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"radius":12,"startAngle":0,"endAngle":6.283185307179586},{"type":"text","version":"2.4.6","originX":"center","originY":"center","left":0,"top":0,"width":7.79,"height":15.82,"fill":"rgba(255,255,255,255)","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"text":"5","fontSize":14,"fontWeight":"normal","fontFamily":"arial","fontStyle":"normal","lineHeight":1.16,"underline":false,"overline":false,"linethrough":false,"textAlign":"left","textBackgroundColor":"","charSpacing":0,"styles":{} }],"number":5}],"height":339,"width":600}
 +
}}
 +
{{Tuto Step
 +
|Step_Title=<translate>Add PLC Project for tcMulti</translate>
 +
|Step_Content=<translate># Add Existing Item
 +
# Navigate to g:\Design\TwinCAT3\tcMulti_6_24
 +
# Select the .Plcproj file
 +
# Copy Project to solution file</translate>
 +
|Step_Picture_00=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125825.jpg
 +
|Step_Picture_01=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125934.jpg
 +
|Step_Picture_02=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125956.jpg
 
}}
 
}}
 
{{Tuto Step
 
{{Tuto Step
Ligne 48 : Ligne 58 :
 
|Step_Picture_00=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125825.jpg
 
|Step_Picture_00=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125825.jpg
 
|Step_Picture_01=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125913.jpg
 
|Step_Picture_01=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125913.jpg
|Step_Picture_02=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125956.jpg
 
}}
 
{{Tuto Step
 
|Step_Title=<translate>Add PLC Project for tcMulti</translate>
 
|Step_Content=<translate># Add Existing Item
 
# Navigate to g:\Design\TwinCAT3\tcMulti_6_24
 
# Select the .Plcproj file
 
# Copy Project to solution file</translate>
 
|Step_Picture_00=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125825.jpg
 
|Step_Picture_01=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125934.jpg
 
 
|Step_Picture_02=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125956.jpg
 
|Step_Picture_02=Create_a_TwinCAT_Project_from_Scratch_Annotation_2019-11-20_125956.jpg
 
}}
 
}}

Version du 21 novembre 2019 à 18:55

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

Introduction

...Beckhoff Technical help is available on 01491 410539 option 3

Étape 1 - Add Drive Configurator for AX8000 drives (if not installed already)

...This step needs to be done for the AX8000 drives only
  1. Copy the Drive Manager 2 setup g:\design\TwinCAT3\TE5950-TC3-Drive-Manager-2.zip to Install Files on the PC running Visual Studio
  2. Close Visual Studio
  3. Extract the Zip File
  4. Run the Setup File

Étape 2 - 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 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 - 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 5 - 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 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

  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 8 - Scan for Devices

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


Étape 9 - Install Drive Manager 2 Project

  1. Note which Device number has the drive in it
  2. Left-click on FILE. A new context menu open
  3. Move the mouse to Add.
  4. Left-click on New Project.
  5. Select TwinCAT Drive manager 2 on left
  6. Click on TwinCAT Drive manager 2 Project on right
  7. Save in the folder for the project (c:\TwinCAT\Stuga\[BuildNo])
  8. EtherCAT master will be the device that has the drive in from Step 1
  9. Leave the basic settings, Ok to scan

Étape 10 - 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 11 - 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 12 - Map all IO References

Using the circuit diagrams, map all the IO ref numbers to the associated IO channels

  1. Double click a field-bus box or slice
  2. Ensure you can see the input / Output list (may need some screen resizing
  3. Double click an IO channel
  4. Enter the number in the search box
  5. 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 13 - Add Drive Configurator

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

Étape 14 - Double check all IO references with someone else

Any mistakes made will save hours if spotted here

Étape 15 - Activate configuration



Étape 16 - Add Axis Task

Axis task may need to be added under the MOTION tree:

  1. Add New Item
  2. NC/PTP Configuration
  3. Leave the Name as default


Étape 17 - Add Axes

If the axes do not exist under MOTION->NC Task->Axes, add them

  1. Right Click Add axis
  2. Name to convention nn Axis


Repeat for each axis on machine

Axis naming and configuration for different machines can be found here


Étape 18 - Map Axes

  1. Double click an axis
  2. Settings tab
  3. Click Link To IO
  4. Connect to associated Drive
  5. Click Link to PLC
  6. 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 19 - Map all IO

Using the circuit diagrams, link all the IO refs up to the inputs and outputs

  1. Double click on the slices and Field Bus boxes in turn
  2. Ensure you can see the Input / output channels (may need some resizing
  3. Double click on the relevant IO channel
  4. Type the number in the box
  5. For Inputs, use ibInputArray and match the number. outputs use qbOutputArray


Repeat for all IO


...Make sure you are using ibInputArray and qbOutputArray and not any others
...Once you have used a reference, it disappears. if you have done this wrong, you can right click->clear the link

Étape 20 - Double check all IO references with someone else

Any mistakes made will save hours if spotted here

Étape 21 - Activate configuration



Étape 22 - 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
  1. Expand PLC_Reset Instance to get to ibResetPLC
  2. Double Click ibResetPLC to open the properties
  3. Link to


Commentaires

Draft