Initializing And Parameterizing The Counter Channel - Siemens SIMATIC FM 450-1 Manual

Counter function module installation and parameter assignment
Table of Contents

Advertisement

7.3

Initializing and Parameterizing the Counter Channel

M7CntInit
Counter channels are initialized via the M7CntInit function. The M7CntInit
Initializing the
function must be called once for each counter channel used. It assigns a 'log-
Counter Channel
ical' channel number to the address of the counter channel. You specify the
address of the counter channel as a parameter. It consists of the following:
Logical Channel
The function supplies the 'logical' channel number that you use for all fur-
Number
ther accesses to this counter channel.
Example
M7CntInit
The parameter &LogChannel contains the return value of the function, the
'logical' channel number.
Parameterizing the
Parameterizing sets the counter module to the requirements of your applica-
Counter Channel
tion. You select the following, for example:
See Chapter 9 for explanations of the settings.
The counter module must be parameterized. If a counter channel is not para-
meterized, you will receive an error message. There are two basic methods of
parameterizing the counter channel:
Parameterizing
You can parameterize the counter module in a user-friendly manner via
with STEP 7
screen forms in STEP 7 (see Chapter 5). The parameterization data set with
STEP 7 are transferred to the counter module when the M7-300/400 is started
up. This means that you must execute a SIMATIC M7 restart each time you
change the parameterization data.
FM 450-1 Counter Function Module
C79000-G7076-C450-01
www.gkbpx.com
Programming in M7 with the Counter Function Library
The module starting address. With M7-300, you can specify the slot-de-
pendent default starting address or an address parameterized with STEP 7.
With M7-400, you specify the starting address parameterized with
STEP 7.
If you have assigned a symbol to the address, you can import this symbol
into your user program (see 'ProC/C++ for M7-300/400' User Manual).
Input type (always M7IO_IN or M7IO_OUT, it doesn't matter which)
Channel number. The channel number can take the following values:
in the FM 350-1 and IF counters the value is equal to 1 (1 channel)
in the FM 450-1 the value is {1/2} (2 channels)
(CNTMODULEADDRESS, M7IO_IN, 1, &LogChannel)
The operating mode (with software gate or hardware gate)
The sensor type (24 V or 5 V)
The interrupt characteristics of the counter channel, etc.
With STEP 7
With the M7CntPar function
该文档是极速PDF编辑器生成,
如果想去掉该提示,请访问并下载:
http://www.jisupdfeditor.com/
7
7-5

Advertisement

Table of Contents
loading

Table of Contents