
NOVRAM
CX20x3
55
Version: 1.0
8.2
Creating and linking variables
Once you have created a Retain Handler in TwinCAT, you can declare variables in the PLC and link them to
the Retain Handler. The variables have to be identified in the PLC with the keyword VAR_RETAIN.
Prerequisite for this step:
• A PLC project created in TwinCAT.
Create variables as follows:
1. Create the variables in your PLC project in a VAR RETAIN area.
2. Click on
Build
in the toolbar at the top, then on
Build Solution
.
3. Click on
PLC Instance
in the tree view on the left and then on the tab
Data Area
.