Getting Started With TwinCAT 3
This article describes how to configure a TwinCAT project for use with the Loehnert.Lisrt.IO.Beckhoff package.
Important
- The TwinCAT version must be greater or equal than 3.1.4024.0.
- The environment language must be English to ensure correct variable names.
1. Create a TwinCat 3 Project
Create a new TwinCAT XAE Project.
2. Scan and Add Your Devices With Boxes
Restart TwinCAT in Config Mode and Scan the devices.
3. Rename the Terminals
The names of the terminals must match the name of .Net terminal instance.
Tip
You should use the device label as terminal name, for example +S1-30K12_3.
Important
Do not use dots "." in the name, use an underscore "_" instead.
4. Create a Task and a Variable Link.
At least one variable must be linked to a task, because the EtherCAT device needs a sync master
- Insert a new TwinCAT Task With Image to SYSTEM.Tasks
- Add a variable to the new task Inputs (e.g. of type WORD)
- Link this variable to any IO (e.g. to DevState of the EtherCAT master)
Tip
Set the Cycle ticks property of the task to 1 for the fastest update interval.
5. Enable ADS Server of the EtherCAT Device
The Loehnert.Lisrt.IO.Beckhoff library reads data directly from the EtherCAT device, so the ADS server of the EtherCAT device must be enabled.
Check Enable ADS Server and Create symbols.
The Generate hierarchical symbol names property must not be checked. (Not available in older TwinCAT 3 versions.)
Note
You will need the port on this page later in your LisRT module configuration.