Basic Program Structure - Siemens SIMATIC FM 450-1 Manual

Counter function module installation and parameter assignment
Table of Contents

Advertisement

Programming in M7 with the Counter Function Library
7.2

Basic Program Structure

Sequence
7
Example
7-4
www.gkbpx.com
The program structure for the counter module must be adapted to the require-
ments of your application. In most cases however, the program will contain
the following functions in the sequence given, with most of the functions
being optional.
The only strict requirement is that you call the M7CntInit function once per
channel before all other funcitons in the count library.
Function
1
M7LinkIOAlarm
(from M7-API)
2
M7LinkDiagAlarm
(from M7-API)
3
M7CntInit
4
M7CntPar
5
M7CntLoadDirect
6
M7CntLoadComp
M7CntEnableOut
7
8
M7CntStart
9
M7CntStop
10
M7CntRead
You can use all further functions of the counter function library if required in
the user program in the sequence necessary for your application.
The first two functions belong to the M7-API library.
The software package includes an example program that clearly illustrates
use of the counter functions and makes it easier for you to start programming.
Explanation
Trigger and handle process interrupts. Otherwise, no
process interrupts are reported.
Trigger and handle diagnostics interrupts. Otherwise,
no diagnostics interrupts are reported.
Initialize counter channel (mandatory)
Parameterize counter channel via the program. Other-
wise, you can parameterize the counter channel under
STEP 7 (see 'Parameter Assignment' chapter).
Communicate a load value to the counter channel.
Otherwise, the counter channel starts with the value
0.
Communicate comparison values to the counter
channel. Otherwise, the comparison values are at 0.
Enable outputs if you want to use the digital outputs
of the counter channel.
Start counter channel if you have set an operating
mode with software gate. In the case of operating
modes with hardware gate, you start the counter
channel via the START digital input.
Stop counter channel
Read counter value, for example, for test purposes or
further processing.
FM 450-1 Counter Function Module
C79000-G7076-C450-01
该文档是极速PDF编辑器生成,
如果想去掉该提示,请访问并下载:
http://www.jisupdfeditor.com/

Advertisement

Table of Contents
loading

Table of Contents