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, V2.3, 07/2017, A5E03822230-AF
Program instructions
7.6 Counters
281