@ Philip Lydin
You may have already done this, but you need to setup the EL5151 itself. If you bought the terminal used, then I would do a factory reset to clear whatever someone did before you and then set it up. Like Dominik Braun (DB1981) said years ago, you never know what someone has done before you.
If you don’t have Twincat, then you can do it from the command line (CoE). Make sure to put the correct terminal number for the -p. I have -p1 below as that would put it right behind the EK1100. After the command, wait a few seconds, then power cycle the Beckhoff hardware. (there are 2 hyphens before type)
sudo ethercat download -p1 0x1011 0x01 0x64616F6C --type uint32
The above will put it in quadrature. If you want “counter mode”, then do the following command. Don’t forget to wait and power cycle again after the new command.
sudo ethercat download -p1 0x8000 0x03 --type bool 1
If it’s already in counter mode with C reset, then you should be able to find out before doing the above commands with
sudo ethercat upload -p1 0x8000 0x01 - -type bool
If it’s in counter mode with C reset, then you should get something like
0x01 1
Just don’t forget to put the correct terminal location for the -p as you don’t want to “brick” one of your other terminals. Twincat is totally safe to do anything with the terminals, but you can permanently brick one doing CoE. Even though Twincat is free, I still do CoE most of the time.
Like Hakan stated, Beckhoff’s manuals have everything, just a matter of finding the answer.
Hope it helps,
Robert