newww0
newww0

Reputation: 181

variable mapping using Beckhoff device

i'm new to PLC programming and i have a problem with connection to the beckhoff device. I used a EL1008 device which has 8 Inputs. On the beckhoff website i found this table below. I'm confused when assigning variable to the inputs, which variable is mapped to %IX0.0 %IX0.1 %IX0.3

enter image description here

Upvotes: 2

Views: 7018

Answers (3)

Stucky
Stucky

Reputation: 613

%IX0.0, %IX0.1 and %IX0.3 are just the address in the register.

If you're using TwinCAT 3, usually these variables are declared in the Global Variable List. Alternatively, you can also use %I* to let the software automatically map the variable to the register address.

enter image description here

This, however, does not map your variable to the hardware (in your case, a Digital Input). To do that, you have to get to the I/O tree and assign the variables to each Digital Input channel.

Make sure to build your solution first, or else your variables won't be found.

enter image description here

Find your EL1008 device, open the tree and link the hardware to a variable.

enter image description here

enter image description here

The variable is now mapped to the device. Activate Configuration and restart TwinCAT in Run Mode.

Upvotes: 5

mrsargent
mrsargent

Reputation: 2442

To answer your question Terminal input 1 goes to %IX0.0., terminal input 2 goes to %IX0.1, etc.

Upvotes: 2

nettogrisen
nettogrisen

Reputation: 115

If you open up your hardware tree and click on your individual inputs, you can see which variable they are linked to, and if they are linked at all.

The most common way to map I/O is to declare globals variable like this:

// Inputs
myInput1 AT %I* : BOOL;
myInput2 AT %I* : BOOL;

// Outputs
myOutput1 AT %Q* : BOOL;
myOutput2 AT %Q* : BOOL;

You then find your physical I/O in the hardware tree, double click them and assign them to your variables.

Upvotes: 4

Related Questions