Linking to IO task
In this step the functionality without a PLC project is demonstrated. If the terminals are connected to a PLC project, this step is not required. In this case the terminals are addressed by the PLC task.
In order for the connected terminals to be addressed cyclically without a PLC project, the EtherCAT device, in this example "Device 2", must be linked to an IO task.
Proceed as follows:
- 1. Click Add New Item under SYSTEM > Tasks on the left side of the tree view.
- 2. Assign a name to the task and select the option TwinCAT Task With Image.
- 3. Accept the default values for the task.
- 4. Right-click Inputs on the left side of the tree view, then click Add New Item.
- 5. Create a UINT variable with a size of two bytes.
- 6. Link the UINT variable to the EtherCAT device, in this example "Device 2“.
- 7. To do this, right-click on the created UINT variable in the tree view on the left, then click Change Link.
- All variables of type UINT are available for selection.
- 8. Now link the UINT variable to a variable of the EtherCAT device, e.g. SlaveCount.
- 9. Activate the configuration and restart the TwinCAT system when requested.
- 10. For the first binary output, click the Online tab and set the value under PresentValue to "active“. The digital output is activated.
Alternatively, you can connect a switch to a digital input of the EL1004 terminal. When the switch is operated, the value "active" appears under PresentValue of the BACnet object“.
- This completes the sample configuration. If your PC has a network chipset from Intel, you can now operate this PC as a BACnet client, scan the BACnet network, add the CX8191 and control the digital output with the BACnet client. Ensure that you are in the same IP network.