Variable links from the System Manager

Normally, input and output variables between controller and hardware are created in one task – either in the PLC or in an additional task. These variables are then linked with the corresponding hardware variables in the System Manager.

However, in the Beckhoff TwinCAT software, another way is possible: scan the existing hardware (or configure it manually) and generate PLC variables on this basis (or have them generated). This way will be described below – "Create linked variable in".

Procedure

A hardware variable should now be linked to a task (PLC) from the hardware configuration, even though no corresponding variable has been defined there at all yet.

Create a hardware configuration in the System Manager manually or by scanning. Create a task that will administer the hardware. Fig. 1 shows the project "Test" with the task "Standard", the already existing inputs "InVar1" to "InVar4" and several outputs.

Variable links from the System Manager 1:

A right mouse-click on the desired hardware variable (here: output channel 2 of a KL2012) opens the dialog for creating a linked variable in a task. A new variable will be created in the selected task; see fig. 2.

Variable links from the System Manager 2:

Since this type of variable can be used in both directions (input/output), the symbol is blue and is given a double arrow. This type of variable is created in the normal process data area (here: IndexGroup 0xF03x) like all other output variables, input variables correspondingly in the input process image.

The PLC project must still be informed of this new variable; see fig. 3.

Variable links from the System Manager 3:

In fig. 3 the start address for PLC variables created in this manner is changeable, calculated with binary prefixes. In fig. 3 the start address is at 7 KB = 7186dec bytes = E000hex bytes.

Task variables created in this manner are adopted into the PLC project via "Save Export Variables". An import file appears in the PLC; see fig. 4:

Variable links from the System Manager 4: