Siemens Simatic S7 Series System Manual page 243

Hide thumbs Also See for Simatic S7 Series:
Table of Contents

Advertisement

Change direction in modes 0 and 1
The following steps describe how to configure HSC0 for change direction for single-phase
counter with internal direction (modes 0 and 1):
1. Load SMB37 to write the desired direction:
SMB37 = 16#90
– Enables the counter
– Sets the direction of the HSC to count down
SMB37 = 16#98
– Enables the counter
– Sets the direction of the HSC to count up
2. Execute the HSC instruction to cause the CPU to program HSC0.
Loading a new current value (any mode)
The following steps describe how to change the counter current value of HSC0 (any mode):
1. Load SMB37 to write the desired current value:
SMB37 = 16#C0
– Enables the counter
– Writes the new current value
2. Load SMD38 (double-word-sized value) with the desired current value (load with 0 to
clear it).
3. Execute the HSC instruction to cause the CPU to program HSC0.
Loading a new preset value (any mode)
The following steps describe how to change the preset value of HSC0 (any mode):
1. Load SMB37 to write the desired preset value:
SMB37 = 16#A0
– Enables the counter
– Writes the new preset value
2. Load SMD42 (double-word-sized value) with the desired preset value.
3. Execute the HSC instruction to cause the CPU to program HSC0.
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
Program instructions
7.6 Counters
243

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents