Siemens Simatic S7 Series System Manual page 237

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

Advertisement

Example: Updating the current and preset values
LAD
MAIN program network
Attaching HSC interrupt routines in your program
All counter modes support an interrupt event when the current value of the HSC is equal to
the loaded preset value. Counter modes that use an external reset input support an interrupt
on activation of the external reset. All counter modes except modes 0 and 1 support an
interrupt on a change in counting direction. Each of these interrupt conditions can be
enabled or disabled separately. For a complete discussion on the use of interrupts, see the
section about Interrupt instructions (Page 282).
HSC status byte
A status byte for each high-speed counter provides status memory bits that indicate the
current counting direction and whether the current value is greater or equal to the preset
value. The following table defines these status bits for each high-speed counter.
Note
Status bits are valid only while the high-speed counter interrupt routine is being executed.
The purpose of monitoring the state of the high-speed counter is to enable interrupts for the
events that are of consequence to the operation being performed.
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
Update the current count to
1000 and the preset value to
2000 for HSC0 when I2.0
transitions from OFF to ON.
Program instructions
7.6 Counters
STL
Network 1
LD I2.0
EU
MOVD 1000, SMD38
MOVD 2000, SMD42
= SM37.5
= SM37.6
HSC 0
237

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents