Siemens Simatic S7-200 System Manual page 223

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Change Direction Modes 0, 1, or 2
The following steps describe how to configure HSC1 for Change Direction for Single Phase
Counter with Internal Direction (Modes 0, 1, or 2):
1.
Load SM47 to write the desired direction:
SM47 = 16#90
SM47 = 16#98
2.
Execute the HSC instruction to cause the S7-200 to program HSC1.
Load a New Current Value (Any Mode)
The following steps describe how to change the counter current value of HSC1 (any mode):
Changing the current value forces the counter to be disabled while the change is made.
While the counter is disabled, it does not count or generate interrupts.
1.
Load SM47 to write the desired current value:
SM47 = 16#C0
2.
Load SM48 (double word size) with the desired current value (load with 0 to clear it).
3.
Execute the HSC instruction to cause the S7-200 to program HSC1.
Load a New Preset Value (Any Mode)
The following steps describe how to change the preset value of HSC1 (any mode):
1.
Load SM47 to write the desired preset value:
SM47 = 16#A0
2.
Load SM52 (double word size value) with the desired preset value.
3.
Execute the HSC instruction to cause the S7-200 to program HSC1.
Disable a High-Speed Counter (Any Mode)
The following steps describe how to disable the HSC1 high-speed counter (any mode):
1.
Load SM47 to disable the counter:
SM47 = 16#00
2.
Execute the HSC instruction to disable the counter.
Although the above sequences show how to change direction, current value, and preset
value individually, you may change all or any combination of them in the same sequence by
setting the value of SM47 appropriately and then executing the HSC instruction.
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
Enables the counter
Sets the direction of the HSC to count down
Enables the counter
Sets the direction of the HSC to count up
Enables the counter
Writes the new current value
Enables the counter
Writes the new preset value
Disables the counter
Instruction Set
10-35

Advertisement

Table of Contents
loading

Table of Contents