Linking variables

Once the PLC project has been successfully appended in TwinCAT you can link the newly created input and output variables from the PLC project with the inputs and outputs of your hardware.

Requirements for this step:

Link the variables as follows:

1. Double-click on the input or output variables in the tree view under PLC.
The Attach Variable window appears and shows which inputs or outputs can be linked with the variables from the PLC project.
Linking variables 1:
2. Double-click on the inputs or outputs of the hardware in the Attach Variable window.
Link the input variables with the inputs and the output variables with the outputs of the hardware.
Linking variables 2:
Variables that are already linked are indicated with a small arrow icon in TwinCAT.
3. In the toolbar click on Activate Configuration.
Linking variables 3:
4. Confirm the request whether TwinCAT is to start in Free Run mode with Yes.
You have successfully linked variables with the hardware. Use Activate Configuration to save and activate the current configuration.

Next, the configuration can be loaded to the Embedded PC in order to start TwinCAT automatically in Run mode and then start the PLC project.