Other signal modules
7.4 Position decoder module SM 338; POS-INPUT; (6ES7338-4BC01-0AB0)
S7-300 Automation System Module data
7-18 Manual, 08/2006, A5E00105505-04
Reading data areas
You can read the data areas in your user program using the
STEP 7
operation L PED "xyz."
Example of access to encoder values and use of the freeze function
You want to read and evaluate the values at the encoder inputs. The module start address is
256.
STL Explanation
L PED 256 // Read encoder value in the address area for encoder input 0
T MD 100 // Save encoder value to memory double word
V M 100.7 // Freeze state for subsequent acknowledgement
= M 99.0 // determine and save
L PED 230 // Read encoder value in the address area for encoder input 1
T MD 104 // Save encoder value to memory double word
V M 104.7 // Freeze state for subsequent acknowledgement
= M 99.1 // determine and save
L PED 264 // Read encoder value in the address area for encoder input 2
T MD 108 // Save encoder value to memory double word
V M 108.7 // Freeze state for subsequent acknowledgement
= M 99.2 // determine and save
L MB 99 // Load freeze state and
T POB 256 // acknowledge (SM 338: output address 256)
You can then process the encoder values from the bit memory address areas MD 100, MD
104 and MD 108. The encoder value is set in bits 0 to 30 of the memory double word.