Reputation: 181
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
Upvotes: 2
Views: 7018
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.
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.
Find your EL1008 device, open the tree and link the hardware to a variable.
The variable is now mapped to the device. Activate Configuration and restart TwinCAT in Run Mode.
Upvotes: 5
Reputation: 2442
To answer your question Terminal input 1 goes to %IX0.0., terminal input 2 goes to %IX0.1, etc.
Upvotes: 2
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