Special Signal modules
5-16
Programmable Logic Controllers S7-300 Module Data
A5E00105505-03
Example of access to encoder values and use of the freeze function
You want to read out and evaluate the value of the encoder at the encoder inputs.
The module start address is 256.
AWL Explanation
L PED 256 //
T MD 100 //
U M 100.7 //
= M 99.0 //
L PED 260 //
T MD 104 //
U M 104.7 //
= M 99.1 //
L PED 264 //
T MD 108 //
U M 108.7 //
= M 99.2 //
L MB99//
T PAB 256 //
Read encoder value in the address range for
encoder input 0
Store encoder value in marker double word
Acquire and store freeze status for later
acknowledgment
Read encoder value in the address range for
encoder input 1
Store encoder value in marker double word
Acquire and store freeze status for later
acknowledgment
Read encoder value in the address range for
encoder input 2
Store encoder value in marker double word
Acquire and store freeze status for later
acknowledgment
Load and acknowledge freeze condition
(SM 338: output address 256)
Afterwards you can further process the encoder values from the marker range MD
100, MD 104 and MD 108. The encoder value is contained in bits 0 to 30 of the
marker double word.