EasyManuals Logo

Siemens Simatic S7 Series System Manual

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #237 background imageLoading...
Page #237 background image
Program instructions
7.6 Counters
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
237
Example: Updating the current and preset values
LAD
STL
MAIN program network
Update the current count to
1000 and the preset value to
2000 for HSC0 when I2.0
transitions from OFF to ON.
Network 1
LD I2.0
EU
MOVD 1000, SMD38
MOVD 2000, SMD42
= SM37.5
= SM37.6
HSC 0
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.

Table of Contents

Other manuals for Siemens Simatic S7 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens Simatic S7 Series and is the answer not in the manual?

Siemens Simatic S7 Series Specifications

General IconGeneral
CPUVaries by model (e.g., S7-300, S7-400, S7-1200, S7-1500)
Communication InterfacesPROFIBUS, PROFINET, Ethernet, MPI
ProgrammingTIA Portal, STEP 7
Programming LanguagesLAD, FBD, STL, SCL, GRAPH
I/O ModulesDigital, Analog, Specialty modules available
Operating Temperature0°C to 60°C (standard models)
MountingDIN rail mounting
Operating Voltage24V DC or 120/230V AC (varies by model)
Protection ClassIP20 (standard models)
MemoryVaries depending on the S7 model. Includes work memory (RAM) for program execution, load memory (EEPROM or Flash) for program storage, and system memory for operating system functions. Memory sizes range from kilobytes to megabytes.

Related product manuals