Function description software, Counter functions, Counter command byte – BECKHOFF M3120 User Manual
Page 5
M3120 Incremental encoder 4x
Beckhoff II/O-Lightbus
Date 20.10.94
Version 1.1
Page 5 of 14
2. Function description software
Counter functions
-
The counter commands are sent in data byte D0 to the module M3120.
-
In the data byte D0 the counter status byte is received .
-
the counter command byte can only be written
-
the counter status byte can only be read.
Counter command byte
In order to transmit commands to the module M3120, the following bits of the counter
command byte can be set and then written to the data byte D0 of an II/O-Lightbus telegram.
7
6
5
6
3
2
1
0
*
*
*
*
EL
SC
RL
RC
Bit
Value
Signal
Function
0
RC=1
READ
COUNTER
Read 24 bit counter
(D1 = LOW byte, D2 = MID byte, D3 = HIGH byte)
1
RL=1
READ
LATCH
Read 24 bit zero point latch
(D1 = LOW byte, D2 = MID byte, D3 = HIGH byte)
The zero point value (see EL command) is only valid, if the LATCH
VALID bit LV is set in the counter status byte. Only a single read
command can be executed at a time. If in a command byte RC=1 and
RL=1, then no value is read
.
2
SC=1
SET
COUNTER
Set counter
The counter is only set, if 0001xxxxb is the value in the control byte
of the II/O telegram.
3
EL=1
ENABLE
LATCH
Activate the zero point latch
the counter is stored in a 24 bit register at the first zero impulse after
the EL command was transmitted. Using the RL command the value
can be read many times at any time, The LV bit is only deleted after
the EL command was transmitted. It is only set again, if a zero point
value was stored. The EL command is only executed, if 0001xxxxb
is the value in the control byte of the II/O telegram.