Vous êtes sur la page 1sur 164

Preface, Contents

User Information

Product Overview 1

How the FM 450-1 Counts 2


SIMATIC Installing and Removing the
FM 450-1 3

Wiring the FM 450-1 4


FM 450-1 Counter Function
Module Assigning Parameters to the
FM 450-1 5
Installation and Parameter
Assignment Programming the FM 450-1 6
Programming in M7 with the
Counter Function Library 7
Manual

Starting Up the FM 450-1 8


Reference Information
Operating Modes, Settings,
Parameters and Commands 9
Encoder Signals and Their
Evaluation 10

DB Assignments 11
M7 Reference
Counter Function Library 12

Faults and Diagnostics 13

Appendices

Technical Specifications A

C79000-G7076-C450-01 Spare Parts B

References C
Glossary, Index
Safety Guidelines This manual contains notices which you should observe to ensure your own personal safety, as well as to
protect the product and connected equipment. These notices are highlighted in the manual by a warning
triangle and are marked as follows according to the level of danger:

Danger
! indicates that death, severe personal injury or substantial property damage will result if proper precautions are
not taken.

Warning
! indicates that death, severe personal injury or substantial property damage can result if proper precautions are
not taken.

Caution
! indicates that minor personal injury or property damage can result if proper precautions are not taken.

Note
draws your attention to particularly important information on the product, handling the product, or to a particular
part of the documentation.

Qualified Personnel The device/system may only be set up and operated in conjunction with this manual.
Only qualified personnel should be allowed to install and work on this equipment. Qualified persons are
defined as persons who are authorized to commission, to ground, and to tag circuits, equipment, and sys-
tems in accordance with established safety practices and standards.

Correct Usage Note the following:

Warning
! This device and its components may only be used for the applications described in the catalog or the technical
description, and only in connection with devices or components from other manufacturers which have been
approved or recommended by Siemens.
This product can only function correctly and safely if it is transported, stored, set up, and installed correctly, and
operated and maintained as recommended.

Trademarks SIMATICR and SINECR are registered trademarks of SIEMENS AG.


Third parties using for their own purposes any other names in this document which refer to
trademarks might infringe upon the rights of the trademark owners.

Copyright E Siemens AG 1996 All rights reserved Disclaimer of Liability


The reproduction, transmission or use of this document or its contents is We have checked the contents of this manual for agreement with the
not permitted without express written authority. Offenders will be liable for hardware and software described. Since deviations cannot be precluded
damages. All rights, including rights created by patent grant or registration entirely, we cannot guarantee full agreement. However, the data in this
of a utility model or design, are reserved. manual are reviewed regularly and any necessary corrections included in
subsequent editions. Suggestions for improvement are welcomed.
Siemens AG
Automation Group E Siemens AG 1996
Industrial Automation Systems Technical data subject to change.
Postfach 4848, D-90327 Nürnberg

Siemens Aktiengesellschaft Order No. C79000-G7076-C450

FM 450-1 Counter Function Module


ii C79000 G7076 C450 01
Preface

Purpose This manual describes all the steps required for using the FM 450-1 function
module effectively. It supports you in learning the functionality of the
FM 450-1 quickly and effectively.

Contents of This This manual describes the hardware and software of the FM 450-1. It consists
Manual of an instructional section and a reference section (appendices).
The manual contains the following:
S Basics of counting
S Installation and expansion of the FM 450-1
S Wiring the FM 450-1
S Assigning parameters to the FM 450-1
S Programming the FM 450-1
S Appendices

Audience The manual is aimed at the following audience:


S Installation engineers
S Programmers
S Startup engineers
S Service and maintenance personnel

Scope of This This manual contains the description of the FM 450-1 function module valid
Manual at the time of publication of the manual. We reserve the right to describe any
subsequent changes in the functionality of the FM 450-1 in a Product
Information.

Other References You will find a list of other references on the topic of the S7-400 and pro-
grammable controllers in the appendix.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 iii
Preface

Structure of This To make it easier for you to locate specific information, the manual has been
Manual structured as follows:
S At the beginning of the manual, you will find a complete table of contents
and a list of all the figures and tables contained in the manual.
S In the individual chapters, the information in left margin gives an over-
view of the contents of each section.
S Following the appendices, there is a glossary containing definitions of the
important technical terms used in the manual.
S At the end of the manual, you will find a detailed index giving you fast
access to the information you seek.

Standards The S7-400/M7-400 programmable controller conforms to the IEC 1131 stan-
dard.

Additional If the manual fails to answer any questions concerning products described in
Assistance the manual please contact your Siemens representative at your local Siemens
office. You will find the relevant addresses in the ‘SIEMENS Worldwide’
Appendix of the ‘S7-400 and M7-400 Programmable Controllers’ manual.
If you have any questions or remarks regarding the manual itself, please fill
in the reply sheet at the back of the manual and send it to the address given.
Please also indicate your personal evaluation of the manual in the remarks
form.
We offer courses for entry-level users of the SIMATIC automation system.
Please contact your local training center or the Central Training Center in
D-90327 Nuremberg, Tel. ++49 911/895 3154.

FM 450-1 Counter Function Module


iv C79000-G7076-C450-01
Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1 Product Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.1 What Can the FM 450-1 Do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.2 Application Areas of the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.3 FM 450-1 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.4 FM 450-1 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
2 How the FM 450-1 Counts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2 Gate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
3 Installing and Removing the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1 Preparing the Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 Installing and Removing the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
4 Wiring the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.1 Terminal Assignments of the Front Connector . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.2 Wiring the Front Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.3 Module Status After Switching On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
5 Assigning Parameters to the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.1 Installing and Calling Parameter Assignment Screen Forms . . . . . . . . . . . 5-2
6 Programming the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
6.1 The FC CNT_CTRL Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.2 The FC DIAG_INF Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
6.3 Application Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.4 Technical Specifications of the Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
7 Programming in M7 with the Counter Function Library . . . . . . . . . . . . . . . . . . . . . 7-1
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.2 Basic Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7.3 Initializing and Parameterizing the Counter Channel . . . . . . . . . . . . . . . . . . 7-5
7.4 Transferring the Load Value and Comparison Values . . . . . . . . . . . . . . . . . 7-7
7.5 Control of the Digital Inputs and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8

FM 450-1 Counter Function Module


C79000-G7076-C450-01 v
Contents

7.6 Starting and Stopping the Counter Channel . . . . . . . . . . . . . . . . . . . . . . . . . 7-9


7.7 Reading the Counter Value and the Load Value, Scanning and
Resetting the Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
7.8 Processing Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
7.9 Processing Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
8 Starting Up the FM 450-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1 Mechanical Installation Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.2 Parameter Assignment Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
9 Operating Modes, Settings, Parameters and Commands . . . . . . . . . . . . . . . . . . . 9-1
9.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9.2 Basic Information on Calling Operating Modes, Settings and Commands 9-4
9.3 Continuous Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
9.4 Single Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
9.5 Periodic Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
9.6 Setting: Counting Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
9.7 Setting: Behavior of the Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
9.8 Setting: Pulse Duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
9.9 Command: Open and Close Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
9.10 Command: Set Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19
9.11 Initiating a Process Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24
10 Encoder Signals and Their Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10.2 5 V Differential Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
10.3 24 V Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
10.4 Pulse Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
11 DB Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
12 M7 Reference Counter Function Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
12.1 M7CntDisableOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
12.2 M7CntDisableSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
12.3 M7CntEnableOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
12.4 M7CntEnableSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
12.5 M7CntInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-6
12.6 M7CntLoadAndStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
12.7 M7CntLoadComp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
12.8 M7CntLoadDirect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-11

FM 450-1 Counter Function Module


vi C79000-G7076-C450-01
Contents

12.9 M7CntLoadPrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12


12.10 M7CntPar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13
12.11 M7CntRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-15
12.12 M7CntReadDiag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
12.13 M7CntReadLoadValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-17
12.14 M7CntReadParError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18
12.15 M7CntReadStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
12.16 M7CntResetStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-20
12.17 M7CntStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-21
12.18 M7CntStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-22
12.19 M7CntStopAndRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-23
12.20 M7CNT_DIAGINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24
12.21 M7CNT_PARAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-25
12.22 M7CNT_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-28
12.23 Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-29
13 Faults and Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
13.1 Fault Indication via the Diagnostics LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.2 Initiation of Diagnostics Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
13.3 Data Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6
13.4 Operator Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7
A Technical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
A.1 Technical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
B Spare Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
C References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Glossary-1
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index-1

FM 450-1 Counter Function Module


C79000-G7076-C450-01 vii
Contents

FM 450-1 Counter Function Module


viii C79000-G7076-C450-01
Product Overview 1
This Chapter... This chapter gives you an overview of the FM 450-1 function module.
S You will learn what the FM 450-1 can do.
S You will become familiar with the application areas of the FM 450-1
through examples.
S You will learn how the FM 450-1 is linked into the S7-400/M7-400 pro-
grammable controller and you will become familiar with the most impor-
tant components of the FM 450-1.

Chapter Section Contents Page


Overview 1.1 What Can the FM 450-1 Do? 1-2
1.2 Application Areas of the FM 450-1 1-4
1.3 FM 450-1 Hardware 1-5
1.4 FM 450-1 Software 1-7

FM 450-1 Counter Function Module


C79000-G7076-C450-01 1-1
Product Overview

1.1 What Can the FM 450-1 Do?


1
What Can the The FM 450-1 function module is a high-speed counter module for use in the
FM 450-1 Do? S7-400/M7-400 programmable controller. There are two counters on the
module and they can operate in the following ranges:
S 0 to 4,294,967,295 (0 to 232 – 1) or
S - 2,147,483,648 to + 2,147,483,647 (–231 to 231 – 1).
The maximum input frequency of the counter signals is up to 500 kHz de-
pending on the encoder signal.
You can use the FM 450-1 for the following counting tasks:
S Continuous counting
S Up/down counting once
S Periodic up/down counting
You can start and stop the count either via the user program (software gate)
or via external signals (hardware gate).

Comparison For each counter, you can store on the module two comparison values as-
Values signed to the two relevant outputs on the module. If the counter status
reaches one of the two comparison values, the relevant output can be set to
initiate control actions direct in the process.

Starting Value You can specify a starting value (load value) to the FM 450-1 for each
counter. The counter is set to the starting value if a software or hardware sig-
nal is present at the module.

Process Interrupts The FM 450-1 can trigger a process interrupt in the CPU if the comparison
values are reached, or in the case of overflow, underflow and/or in the case of
zero pass of a counter.

Diagnostics The FM 450-1 can trigger a diagnostics interrupt if any of the following oc-
Interrupts cur:
S Fault in external auxiliary voltage
S Fault in 5.2 VDC encoder supply
S Module not parameterized or errors in parameterization
S Watchdog triggered
S RAM defective
S Process interrupt lost
S Fault in signal A, B or N

FM 450-1 Counter Function Module


1-2 C79000-G7076-C450-01
Product Overview

Pulse Duration You can specify a pulse duration for the digital outputs of the FM 450-1. The
pulse duration specifies how long the relevant digital output is to be set. You
can specify a value between 0 and 500 ms for the pulse duration. This value 1
applies for both outputs. You can adapt the FM 450-1 to existing actuators by
specifying a pulse duration.

Which Signals Can The FM 450-1 can count signals generated by the following encoders:
the FM 450-1
S Incremental 5 V encoders
Count?
S Incremental 24 V encoders
S 24 V pulse encoders with direction level
S 24 V initiators without direction level
for example, light barrier or BERO

Input Filter For the purpose of suppressing interference, you can parameterize input fil-
ters (RC elements) with a uniform filter time for the 24 V inputs A*, B* and
N* and for the digital inputs. The following two input filters are available:

Table 1-1 Input Filters

Features Input Filter 1 Input Filter 2


(Default)
Typical input delay 1 s 15 s
Maximum counting frequency 200 kHz 20 kHz
Minimum pulse width of the count 2.5 s 25 s
signals

FM 450-1 Counter Function Module


C79000-G7076-C450-01 1-3
Product Overview

1.2 Application Areas of the FM 450-1


1
Where Can You The main application area of the FM 450-1 is where signals with high fre-
Use the FM 450-1? quencies are counted and high-speed responses have to be triggered to prede-
fined counter statuses.
Examples include:
S Packaging plants
S Sorting plants
S Dosing or proportioning plants.

Example for the In this example, a carton must be filled with a specific number of parts. One
Use of an FM 450-1 counter of the FM 450-1 counts the parts and controls the motor for trans-
porting the parts and the motor for transporting the carton.
If the carton is in the correct position, conveyor belt A is stopped via the light
barrier, the count is started and the motor for conveyor belt B is switched on.
When the carton contains the programmed number of parts, the FM 450-1
stops the motor for conveyor belt B and switches on the motor for conveyor
belt A for removal of the carton. The count can start again when the next
carton reaches the light barrier.

FM 450-1

Belt A
Motor
Light barrier Motor

Gate
Belt B

Figure 1-1 Example for Using an FM 450-1 in the S7-400

FM 450-1 Counter Function Module


1-4 C79000-G7076-C450-01
Product Overview

1.3 FM 450-1 Hardware


1
View of Module Figure 1-2 shows the FM 450-1 module with front connector attached.

Order number Type plate

Version

Diagnostics
and status LEDs

Front connector Labeling strips

Figure 1-2 Representation of the FM 450-1

Order Number and The full order number of the FM 450-1 is shown on the rating plate.
Version
The abbreviated order number and the version of the FM 450-1 are given at
the top end of the module front.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 1-5
Product Overview

Diagnostics and The FM 450-1 has 16 LEDs that are used both for diagnostics and for indicat-
Status LEDs ing the status of the FM 450-1 and its digital inputs and outputs. Table 1-2
1 gives the labeling, color and function of the LEDs.

Table 1-2 Labeling, Color and Function of the LEDs

Labeling Color Function


INTF red Internal Fault
EXTF red External Fault
CH1 CR green Counter running; status of the least significant bit of counter 1
CH2 CR (CH 1) or counter (CH 2)

CH1 DIR green Direction of count; LED lights up if counter 1 (CH 1) or


CH2 DIR counter 2 (CH 2) is counting down.

CH1 IN 0 green Status of input 1I0 of counter 1 or 2I0 of counter 2


CH2 IN 0
CH1 IN 1 green Status of input 1I1 of counter 1 or 2I1 of counter 2
CH2 IN 1
CH1 IN 2 green Status of input 1I2 of counter 1 or 2I2 of counter 2
CH2 IN 2
CH1 OUT 0 green Status of output 1Q0 of counter 1 or 2Q0 of counter 2
CH2 OUT 0
CH1 OUT 1 green Status of output 1Q1 of counter 1 of 2Q1 of counter 2
CH2 OUT 1

Front Connector The front connector has the following connections:


S 5 V or 24 V encoder signals for counter 1 and 2
S Encoder supply
S Digital input signals for starting, stopping and setting counter 1 and 2
S Digital output signals Q0 and Q1 for counter 1 and 2
S Auxiliary voltage 1L+ for generating the encoder supply voltages
S Load voltage 2L+ for supplying the digital outputs
The front connector must be ordered separately (see Appendix B).

Front Connector When you swing the front connector down into position, the front connector
Coding coding engages. Thereafter, this front connector can only be attached to an
FM 450-1 module.

Labeling Strips Enclosed with the module is a labeling block with four labeling strips on
which you can write your relevant signal names.

FM 450-1 Counter Function Module


1-6 C79000-G7076-C450-01
Product Overview

1.4 FM 450-1 Software


1
FM 450-1 Software To integrate the FM 450-1 into the S7-400, you require a software package
Packages with
S Parameter assignment screen forms
S Software for the CPU
The software for integrating the FM 450-1 into the M7-400 is described in
Chapters 7 and 12.

Parameter The FM 450-1 is adapted to the task in hand via parameters. These parameter
Assignment are stored in an SDB and transferred to the module from the CPU.
Screen Forms
You can specify the parameters via parameter assignment screen forms.
These parameter assignment screen forms are installed on your programming
device and called up within STEP 7.

Software for the The software for the CPU consists of the FC CNT_CTRL function called in
S7-400-CPU the user program of the CPU. This FC enables communication between the
CPU and the FM 450-1. In addition, there is also the FC DIAG_INF function
for the FM 450-1, with which you can transfer diagnostics information into
the DB of the FC CNT_CTRL.
Figure 1-3 shows an S7-400 configuration with an FM 450-1 and several sig-
nal modules.

Programming
device (PG) with STEP 7 and
the parameterization screen
forms

CPU
with user program
and FCs of the
FM 450-1 FM 450-1

Figure 1-3 SIMATIC S7-400 Configuration with an FM 450-1

FM 450-1 Counter Function Module


C79000-G7076-C450-01 1-7
Product Overview

FM 450-1 Counter Function Module


1-8 C79000-G7076-C450-01
How the FM 450-1 Counts 2
This Chapter... This chapter contains explanations of the most important terms for counting
with the FM 450-1.

Chapter Section Contents Page


Overview 2.1 Definitions 2-2
2.2 Gate Functions 2-5

FM 450-1 Counter Function Module


C79000-G7076-C450-01 2-1
How the FM 450-1 Counts

2.1 Definitions

What is Counting? Counting refers to the process of capturing and summing up events. In the
2 case of the FM 450-1 function module, encoder signals are captured and eva-
luated accordingly.

Count Range, The FM 450-1 can count up and down. By selecting the count range, you
Count Limits define the limits within which the FM 450-1 can count.

Count Range Lower Count Limit Upper Count Limit


Count range 1: 32 bits 0 + 4,294,967,295
Count range 2: + 31 bits – 2,147,483,648 + 2,147,483,647

Load Value You can specify a starting value to the FM 450-1 for each of the two count-
ers. Counting starts at this value. The starting value is referred to as the load
value. The load value can be any value within the count limits.

Comparison In order to be able to trigger responses in the process independently of the


Values CPU when a specific counter status is reached, you can use two of the mo-
dule’s digital outputs for each counter. You store two comparison values on
the FM 450-1 for each counter. If the counter status reaches either of the two
comparison values, the digital output assigned to the comparison value is set
and/or a process interrupt is generated.

Example In the example in Section 1.2, the motor for conveyor belt B is to be stopped
as soon as the carton contains the programmed number of parts. For this pur-
pose, you can specify this number to the FM 450-1 as the comparison value
for counter 1, for example, and use the assigned digital output to stop the
motor.

Three Different With the FM 450-1, you can count rectangular pulses in three different ways:
Counting Methods
S Continuous counting, with or without gate function
S Single count, with hardware or software gate
S Periodic counting, with hardware or software gate
The differences between the methods become obvious in the behavior of the
FM 450-1 when a counter has reached a count limit.

FM 450-1 Counter Function Module


2-2 C79000-G7076-C450-01
How the FM 450-1 Counts

Continuous If a counter reaches the upper limit when counting up, and if another count
Counting pulse comes, the counter jumps to the lower count limit and starts to add the
count pulses again; so it continues to count continuously.
If a counter reaches the lower limit when counting down, and if another
count pulse comes, it jumps to the upper count limit and continues to count
down from there.
2
Counter status

Upper count limit

Lower count limit

Time

Figure 2-1 Continuous Counting in the Up Direction

Single Counting In single counting, the counter starts at the load value. If a counter reaches
the upper count limit when counting up, and if another count pulse comes,
the counter jumps to the lower count limit and remains there even if further
count pulses come.
If a counter reaches the lower limit when counting down, and if another
count pulse comes, it jumps to the upper limit and remains there even if fur-
ther count pulses come.

Counter status

Upper count limit

Load value

Lower count limit

Time

Figure 2-2 Single Counting in the Up Direction

FM 450-1 Counter Function Module


C79000-G7076-C450-01 2-3
How the FM 450-1 Counts

Periodic Counting In periodic counting, the counter starts from the load value. When the
counter reaches the upper limit when counting up, and if a another count
pulse comes, it jumps to the load value and starts to add the count pulses
again.

2 If a counter reaches the lower limit when counting down, and if another
count pulse comes, it jumps to the load value and continues to count down
from there.

Counter status

Upper count limit

Load value

Lower count limit

Time

Figure 2-3 Periodic Counting in the Up Direction

FM 450-1 Counter Function Module


2-4 C79000-G7076-C450-01
How the FM 450-1 Counts

2.2 Gate Functions

Counting with Many applications require that the count be started or stopped at a defined
Gate Functions time depending on other events. This starting and stopping of the count is 2
done in the case of the FM 450-1 via a gate function. If the gate is opened,
count pulses can reach a counter and the count is started. If the gate is closed,
count pulses can no longer reach the counter and the count is stopped.

Software Gate and The module has two gate functions for each counter
Hardware Gate
S A software gate controlled via the user program in the CPU.
S A hardware gate controlled via digital inputs 1I0 and 1I1 (counter 1) or
2I0 and 2I1 (counter 2) on the module. When assigning parameters to the
FM 450-1, you define whether the hardware gate is to operate with level
control or with edge control.

Example The gate is opened and the count pulses are counted by setting the gate sig-
nal. If the gate signal is removed, the gate is closed and the count pulses are
no longer captured by the counter. The counter status remains constant.
Figure 2-4 shows the opening and closing of a gate and the counting of the
pulses.

Counter status
1 2 3 4
Count pulses 4

Gate signal
Open Close
gate gate

Figure 2-4 Opening and Closing a Gate

Terminating a When counting with the software gate and when counting with the hardware
Count with the gate, you can terminate the count in each case using the gate stop function.
Gate Stop For this purpose, set the input parameter GATE_STP of the FC CNT_CTRL.
Function

FM 450-1 Counter Function Module


C79000-G7076-C450-01 2-5
How the FM 450-1 Counts

FM 450-1 Counter Function Module


2-6 C79000-G7076-C450-01
Installing and Removing the FM 450-1 3
This Chapter... This chapter contains information on installing and removing the FM 450-1.
S You will learn what you must look out for when installing. You will get
notes and hints on configuring and installing an FM 450-1.
S You will learn, step-by-step, how to install and remove an FM 450-1.

Chapter Section Contents Page


Overview 3.1 Preparing the Installation 3-2
3.2 Installing and Removing the FM 450-1 3-3

FM 450-1 Counter Function Module


C79000-G7076-C450-01 3-1
Installing and Removing the FM 450-1

3.1 Preparing the Installation

Defining the Slots The FM 450-1 function module can, like a signal module, be installed in a
central rack or in an expansion unit.

Mechanical Manual /1/ describes the possibilities open to you for mechanical installation
3 Configuration and how to proceed when configuring.

Determining the The starting address of the FM 450-1 is required for communications be-
Starting Address tween the CPU and the FM 450-1. The starting address is entered in the DB
of the FC CNT_CTRL (see Chapters 6 and 11). The entry is made either with
the help of the program editor or from the user program.
You specify the starting address for the module under STEP 7.

Important Safety There are important rules you must observe for integrating an S7-400 with an
Rules FM 450-1 into a plant or a system.
These rules and regulations are explained in manual /1/.

FM 450-1 Counter Function Module


3-2 C79000-G7076-C450-01
Installing and Removing the FM 450-1

3.2 Installing and Removing the FM 450-1

Rules No special protection measures (ESD guidelines) are required for installing
an FM 450-1.

Tools Required You require a 4.5 mm screwdriver for installing and removing the FM 450-1. 3
Installation Proceed as follows to install an FM 450-1:
Procedure
1. Hook the FM 450-1 in at the top and swing it down into position.
2. Tighten the screw on the FM 450-1
(torque approximately 0.8 to 1.1 Nm).
3. Label the FM 450-1 with its slot number. For this purpose, use the nu-
merical wheel enclosed with the mounting rack.
The numbering scheme and the procedure for determining the slot num-
ber are described in manual /1/.

Procedure for Proceed as follows to remove an FM 450-1:


Removing or
1. Loosen and remove the front connector.
Changing Modules
2. Loosen the fixing screw on the module.
3. Swing the module out of the mounting rack and unhook it.
4. Install the new module, if relevant.

Further Notes Manual /1/ contains further notes on installing and removing modules.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 3-3
Installing and Removing the FM 450-1

FM 450-1 Counter Function Module


3-4 C79000-G7076-C450-01
Wiring the FM 450-1 4
This Chapter... This chapter contains the following information on wiring the FM 450-1:
S Terminal assignments of the front connector.
S The function of the connections.
S Notes on selecting cables.
S The steps you must execute when wiring the front connector.
S The status of the module after wiring and switching on the power supply.

Chapter Section Contents Page


Overview 4.1 Terminal Assignments of the Front Connector 4-2
4.2 Wiring the Front Connector 4-8
4.3 Module Status After Switching On 4-11

FM 450-1 Counter Function Module


C79000-G7076-C450-01 4-1
Wiring the FM 450-1

4.1 Terminal Assignments of the Front Connector

Front Connector You connect the count signals, the digital inputs and outputs, the encoder
supply and the auxiliary voltage and load voltage via the 48-pin front con-
nector. Figure 4-1 shows the front side of the front connector, the strip with
the printed pin assignments and the labeling strips.

Pin assignments Labeling strips


INTF INTF
4
1
EXTF 2 1L+
EXTF
3 1M
CH1 4 CH1
CR 1A CR
5
DIR 1A DIR
6
1B
7
1B
8
1N
9
1N
10
1A*
11
1B*
12
1N*
13
1M
14
DC5.2V
15
DC24V
CH2 16 CH2
2A
CR 17 CR
2A
DIR 18 DIR
2B
19
2B
20
2N
21
2N
22
2A*
23
2B*
24
2N*
25
1M
26
DC5.2V
27
CH1 IN DC24V CH1 IN
28
0 29 0 1I0
1 30 1 1I1
2 31 2 1I2
CH1 OUT 32 CH1 OUT
0 33 0 1Q0
1 34 1 1Q1
35
36
37
38
39
CH2 IN 40 CH2 IN
0 41 0 2I0
1 42 1 2I1
2 43 2 2I2
CH2 OUT 44 CH2 OUT
0 45 0 2Q0
1 46 2L+ 1 2Q1
47 2M
48

Figure 4-1 Front Connector of the FM 450-1

FM 450-1 Counter Function Module


4-2 C79000-G7076-C450-01
Wiring the FM 450-1

Front Connector Table 4-1 shows the front connector assignments.


Assignments
Table 4-1 Front Connector Assignments

Con- Name Input/ Function


nec
nec- Out
Out-
5 V encoder RS 24 V encoder, 24 V encoder with 24 V initiator
tion put
422 symmetric asymmetric direction level
1 –
2 –
3 1L+ INP 24 V auxiliary voltage for encoder supply 4
4 1M INP Auxiliary voltage ground for encoder supply
Counter 1
5 1A INP Encoder signal A –
6 1A INP Encoder signal A –
7 1B INP Encoder signal B –
8 1B INP Encoder signal B –
9 1N INP Encoder signal N –
10 1N INP Encoder signal N –
11 1 A* INP – Encoder signal A*
12 1 B* INP – Encoder signal B* Direction signal –
13 1 N* INP – Encoder signal N* –
14 1M OUTP Ground for encoder supply
15 5.2 VDC OUTP Encoder supply –
ground
5.2 VDC
16 24 VDC OUTP – Encoder supply 24 V
Counter 2
17 2A INP Encoder signal A –
18 2A INP Encoder signal A –
19 2B INP Encoder signal B –
20 2B INP Encoder signal B –
21 2N INP Encoder signal N –
22 2N INP Encoder signal N –
23 2 A* INP – Encoder signal A*
24 2 B* INP – Encoder signal B*, Direction signal
25 2 N* INP – Encoder signal N*
26 1M OUTP Ground for encoder supply
27 5.2 VDC OUTP Encoder supply –
ground
5.2 VDC
28 24 VDC OUTP – Encoder supply 24 V

FM 450-1 Counter Function Module


C79000-G7076-C450-01 4-3
Wiring the FM 450-1

Table 4-1 Front Connector Assignments, Continued

Con- Name Input/ Function


nec
nec- Out
Out-
5 V encoder RS 24 V encoder, 24 V encoder with 24 V initiator
tion put
422 symmetric asymmetric direction level
Counter 1
29 1I0 INP Digital input 1I0
30 1I1 INP Digital input 1I1
31 1I2 INP Digital input 1I2
4 32 –
33 1Q0 OUTP Digital output 1Q0
34 1Q1 OUTP Digital output 1Q1
35 –
36 –
37 –
38 –
39 –
40 –
Counter 2
41 2I0 INP Digital input 2I0
42 2I1 INP Digital input 2I1
43 2I2 INP Digital input 2I2
44 –
45 2Q0 OUTP Digital output 2Q0
46 2Q1 OUTP Digital output 2Q1
47 2L+ INP 24–V load voltage for the digital inputs and outputs
48 2M INP Load voltage ground for the digital inputs and outputs

Note
The circuits for the counter inputs (encoder supply, encoder signals) are non-
isolated to the ground of the CPU, that is, terminal 4 (1M) must have a low-
resistance connection to CPU ground.
If you supply the encoders externally, you must also connect the ground of
this external voltage with the ground of the CPU.

FM 450-1 Counter Function Module


4-4 C79000-G7076-C450-01
Wiring the FM 450-1

Auxiliary Voltage Connect a direct voltage of 24 V to the 1L+ and 1M terminals for the voltage
1L+, 1M supply of the 5 V and 24 V encoders.
An integral diode protects the module from reverse polarity of the auxiliary
voltage.
The module monitors the connection of the auxiliary voltage.

5.2 VDC Encoder The module generates a voltage of 5.2 V from the auxiliary voltage 1L+/1M
Supply at a maximum current of 300 mA per counter channel that is available at
each ‘5.2 VDC’ connection for the voltage supply of a 5 V encoder. This is
short-circuit proof. 4
24 VDC Encoder For the 24 V voltage supply of an encoder, the voltage 1L+/1M is made
Supply available and short-circuit proof at the ‘24 VDC’ output. The encoder supply
is monitored for short-circuit.

5 V Encoder To each encoder you can connect incremental encoders with 5 V differential
Signals A, A, B, B, signals in accordance with RS 422, that is, incremental encoders with the
N and N differential signals, A, A, B, B, N and N.
The signals A, A, B, B, N and N are connected via the terminals so labeled.
The signals N and N are only connected if you want to set the counter to the
zero mark of the encoder.
The inputs are not galvanically isolated from the S7-400 bus (see note fol-
lowing Table 4-1).

24 V Encoder 24 V signals are represented by the letters A*, B* and N*.


Signals A*, B*
You can connect three different encoder types to each counter:
and N*
S Incremental encoders with 24 V signals:
The signals A*, B* and N* are connected via the terminals so labeled.
S Pulse encoders without direction level:
The signal is connected to terminal A*.
S Pulse encoders with direction level:
The count signal is connected to terminal A*. The direction level is con-
nected to terminal B*.
The inputs are not galvanically isolated from the S7-400 bus (see note fol-
lowing Table 4-1).

Input Filter for For the purpose of suppressing interference, you can parameterize input fil-
24 V Encoder ters (RC elements) with a uniform filter time for the 24 V inputs A*, B* and
Signals N. The following two input filters are available:

FM 450-1 Counter Function Module


C79000-G7076-C450-01 4-5
Wiring the FM 450-1

Table 4-2 Input Filters for 24 V Encoder Signals

Features Input Filter 1 Input Filter 2


(Default)

Typical input delay 1 s 15 s


Maximum counting frequency 200 kHz 20 kHz
Minimum pulse width of the count 2.5 s 25 s
signals

4
Digital Inputs You can use the relevant digital inputs 1I0 and 1I1 (counter 1) or 2I0 and 2I1
(counter 2) for the gate control of the two counters. The gate control can be
both level-controlled and edge-controlled (see Chapter 9).
Digital input 1I2 is used for setting counter 1 to the load value.
Digital input 2I2 is used for setting counter 2 to the load value.
The digital inputs are operated with a nominal voltage of 24 V.
The digital inputs are galvanically isolated from the bus and the counter in-
puts.

Input Filter for For the purpose of suppressing interference, you can parameterize input fil-
Digital Inputs ters (RC elements) with a uniform filter time for digital inputs 1I0, 1I1 and
1I2 or 2I0, 2I1 and 2I2. The following two input filters are available:

Table 4-3 Input Filters for Digital Inputs

Features Input Filter 1 Input Filter 2


(Default)
Typical input delay 1 s 15 s
Maximum frequency of the input signals 200 kHz 20 kHz
Minimum pulse width of the input signals 2.5 s 25 s

Digital Outputs The FM 450-1 has the digital outputs 1Q0 and 1Q1 (for counter 1) and 2Q0
and 2Q1 (for counter 2) for direct triggering of control actions. These outputs
are supplied via the load voltage 2L+.
The digital outputs are galvanically isolated from the S7-400 bus and the
counter inputs.
The digital outputs are source outputs and can be loaded with a load current
of 0.5 A. They are protected from overload and short-circuit.

FM 450-1 Counter Function Module


4-6 C79000-G7076-C450-01
Wiring the FM 450-1

Note
Relays and contactors can be connected direct without external circuitry.

The time characteristics of the digital outputs depends on the parameteriza-


tion and is explained in more detail in Chapter 9 ‘Setting: Behavior of the
Digital Outputs’.

Load Voltage
2L+/ 2M
For supplying the digital outputs 1Q0 and 1Q1 or 2Q1 and 2Q2, the module
must be supplied with a load voltage of 24 V via terminals 2L+ and 2M.
4
An integral diode protects the module from polarity reversal of the load volt-
age.
The load voltage 2L+/2M is not monitored by the FM 450-1.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 4-7
Wiring the FM 450-1

4.2 Wiring the Front Connector

Cables There are some rules for you to observe when selecting cables:
S The cables for the digital inputs must be shielded.
S The cable for the counter signals must be shielded.
S You must apply the shields of the counter signal cables both at the pulse
encoder and in the immediate vicinity of the module via the shield attach-
4 ment, for example.
S The cables A, A, B, B and N, N of the incremental 5 V encoder must be
twisted in pairs.
Figure 4-2 shows details of connecting incremental 5 V encoders.

Shield on Shield on
shield attachment housing

Front connector
Counter 1
A
5
A
6
B
7
8 B
N
9
10 N
1M
14
15 5.2 VDC

Counter 2
A
17
A
18
B
19
20 B
N
21
22 N
1M
26
5.2 VDC
27

Shield on Shield on
shield attachment housing
Twisted wires

Figure 4-2 Connecting Incremental 5 V Encoders

FM 450-1 Counter Function Module


4-8 C79000-G7076-C450-01
Wiring the FM 450-1

Terminal 4 (1M) of the front connector must have a low-resistance connec-


tion to the ground of the CPU. If you supply the encoder with an external
voltage, you must also connect the ground of this external voltage with the
ground of the CPU.
Figure 4-3 shows details of connecting incremental 24 V encoders.

Shield on Shield on
shield attachment housing

Front connector 4
Counter 1
A*
11
B*
12
N*
13
1M
14
24 VDC
16

Counter 2
A*
23
B*
24
N*
25
1M
26
24 VDC
28

Shield on Shield on
shield attachment housing

Figure 4-3 Connecting Incremental 24 V Encoders

FM 450-1 Counter Function Module


C79000-G7076-C450-01 4-9
Wiring the FM 450-1

S Use flexible cables with cross-sections of 0.25 to 1.5 mm.

Note
If the encoders are supplied via the module, the cable cross-section must be
large enough to carry the required voltage to the encoder despite voltage
drops over the cable. This applies especially in the case of incremental 5 V
encoders.

4 S A wire end ferrule is not required. If you use wire end ferrules then use
only those without insulation collar in accordance with DIN 46228 Form
A, short version!

Wiring Steps Proceed as follows when wiring the front connector:

Warning
! There is a danger of personal injury.
If you wire the front connector of the FM 450-1 when the power is switched
on, you are in danger of injury from electric shock.
Wire the FM 450-1 only when the power is switched off!

1. Remove the cover from the front connector.


2. Strip the conductors (length 6 mm).
3. Are you using wire end ferrules?
If so: Press-fit the wire end ferrules onto the conductors.
4. Feed the enclosed strain relief clamp into the front connector.
5. Begin wiring at the bottom. Also tighten unassigned terminals in the case
of a front connector with screw-type terminals (tightening torque 0.6 to
0.8 Nm).
6. Tighten the strain relief clamp for the cable chain.
7. Close the front connector.
8. Label the terminals on the enclosed labeling strip.
Manual /1/ contains a detailed description of wiring the front connector.

FM 450-1 Counter Function Module


4-10 C79000-G7076-C450-01
Wiring the FM 450-1

4.3 Module Status After Switching On

Features The status of the module after the power supply has been switched on and
before any data has been transferred, is characterized by the following fea-
tures:
S Counter inputs default for 5 V differential signals, track B not inverted;
single evaluation (see Section 10-4);
S Count mode 32 bits
S Counter status zero
4
S Setting of counter with digital input 1I2 or 2I2 (and zero mark) disabled
S Input delay for the digital inputs: typically 1 s
(max. frequency: 200 kHz, minimum pulse width: 2.5 s)
S Input delay for 24 V counter inputs: typically 1 s
(max. frequency: 200 kHz, minimum pulse width: 2.5 s)
S Outputs 1Q0 and 1Q1 or 2Q0 and 2Q1 switched off
S Pulse duration = 0
S No process interrupts set
S Operating mode ‘Continuous count’ set
S Gate function switched off (that is, gate opened)
S Status signals are updated
This setting corresponds to the default setting of the module.

RESET Status This module status (default setting) is also referred to as the RESET status.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 4-11
Wiring the FM 450-1

FM 450-1 Counter Function Module


4-12 C79000-G7076-C450-01
Assigning Parameters to the FM 450-1 5
This Chapter... In this chapter, you will learn how to install and start parameter assignment
screen forms.
The parameter assignment screen forms have an integral help function that
supports you in parameterizing and starting up the FM 450-1.

Chapter Section Contents Page


Overview 5.1 Installing and Calling Parameter Assignment Screen Forms 5-2

FM 450-1 Counter Function Module


C79000-G7076-C450-01 5-1
Assigning Parameters to the FM 450-1

5.1 Installing and Calling Parameter Assignment Screen Forms

Marginal The following conditions apply for transferring parameter assignment data to
Conditions the CPU:
S STEP 7 must be correctly installed on your programming device
S The programming device must be correctly connected to the CPU
S The CPU must be in STOP

Note
You must not plug in or remove any S7-400 modules during data exchange
over the MPI!

Form of Supply The software is supplied in the form of 3.5” diskettes, MS-DOS operating
system, 1.44 Mbytes. The following information is available on the supply
diskettes:
S Diskette format
S Diskette number and quantity
S Product designation, version and year

Creating a Backup Create a copy of each original diskette and install the parameter assignment
Diskette screen forms from this copy. Keep the original diskettes in a safe place. See
your MS-DOS description or your WINDOWS description to learn how to
copy diskettes.

Installing the Call the SETUP.EXE program on the backup copy of your installation dis-
Parameter kette. This installs not only the parameter assignment screen forms but also
Assignment FC CNT_CTRL and the FC DIAG_INF on your programming device. The
Screen Forms FCs are inserted in the standard library in the catalog ‘FM_CNT_L’. Follow
the instructions displayed in the SETUP menu on the screen.

Example Program During installation, a detailed example program is inserted in the


FM_ZAEHL project in the ‘Examples’ sub-catalog of the STEP 7 catalog.

Reading the The READ ME file may contain important up-to-date information concern-
READ ME File ing the software supplied. You can read this file with the WORDPAD Editor
under Windows.

Calling the The parameter assignment screen forms are displayed automatically after a
Parameter successful installation, if you parameterize the FM 450-1 within the hardware
Assignment configuration.
Screen Forms

Calling the Integral There is an integral Help function for the parameter assignment screen forms
Help Function that you can call in any phase of parameter assignment either with the F1 key
or with the Help button.

FM 450-1 Counter Function Module


5-2 C79000-G7076-C450-01
Programming the FM 450-1 6
This Chapter... This chapter contains all the information necessary for programming the
FM 450-1 in the S7-400. For linking the FM 450-1 into a user program, you
are provided with STEP 7 blocks that make handling the desired functions
easy for you.
This chapter describes these blocks.

ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Block Number Block Name Meaning

ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
FC 0 CNT_CTRL Controlling the counters of the FM 450-1

ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
FC 1 DIAG_INF Read diagnostics data set 1 from the
FM 450-1

In addition, use of the blocks is illustrated in an example program. The ex-


ample program shows block calls and contains the necessary data block.

Chapter Section Contents Page


Overview 6.1 The FC CNT_CTRL Function 6-2
6.2 The FC DIAG_INF Function 6-5
6.3 Application Example 6-6
6.4 Technical Specifications of the Blocks 6-8

FM 450-1 Counter Function Module


C79000-G7076-C450-01 6-1
Programming the FM 450–1

6.1 The FC CNT_CTRL Function

Prerequisite The data required for the FC CNT_CTRL are stored in a DB on the CPU.
The FC CNT_CTRL transfers data cyclically from this DB to the FM and
fetches data from the FM.
You create the DB under STEP 7 as a data block with assigned user-specific
data type. Select UDT 1 as the source. UDT 1 has been copied into the block
library for the counters (FM_CNT) during installation of the FCs. You must
not modify UDT 1. Copy UDT 1 together with the FCs into your project.
Before programming the FM 450-1, the following valid data must be as-
signed to the DB of the FC CNT_CTRL:
S Module address
You set the module address (base address of the FM 450-1) when config-
uring your hardware.

6 S Channel address
The channel address of counter channel 1 is the same as the module ad-
dress in pointer format. The channel address of counter channel 2 is the
same as the module address + 32 in pointer format.
S User data length
The user data length is 32.

Example You will find below an example of how to implement the transfer of the
module address, the channel address and the user data length in OB10. The
symbol table contains the following assignments for this example:

FM450_DB_K1 DB 10 DB with the counter data for channel 1


FM450_DB_K2 DB 11 DB with the counter data for channel 2

Program the transfer as follows in STL:

STL Description
Channel 1
L 512 // Module address = 512
T FM450_DB_K1.MOD_ADR // Transfer of module address
L P# 512.0 // Module address in pointer format
T FM450_DB_K1.CH_ADR // Transfer of the channel address for channel 1
L 32 // User data length = 32
T FM450_DB_K1.U_D_LGTH // Transfer of the user data length
Channel 2
L 512 // Module address = 512
T FM450_DB_K2.MOD_ADR // Transfer of module address
L P# 544.0 // Module address + 32 in pointer format
T FM450_DB_K2.CH_ADR // Transfer of the channel address for channel 2
L 32 // User data length = 32
T FM450_DB_K2.U_D_LGTH // Transfer of the user data length

FM 450-1 Counter Function Module


6-2 C79000-G7076-C450-01
Programming the FM 450–1

Call The FC CNT_CTRL can be called either cyclically or in a time-controlled


program once per counter. Calling FC CNT_CTRL in an interrupt program is
not permissible.
The FC CNT_CTRL call in the STL and LAD methods of representation is

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
given below.

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
STL method of representation LAD method of representation

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
CALL CNT_CTRL,(
DB_NO := , CNT_CTRL

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
SW_GATE
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
GATE_STP
:=
:=
,
,
 EN
 DB_NO
ENO 
OT_ERR 

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
OT_ERR_A

ÁÁÁÁÁÁÁÁÁÁÁ
OT_ERR

ÁÁ
:=
:=
,
,
 SW_GATE
 GATE_STP

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
L_DIRECT := ,  OT_ERR_A

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
 L_DIRECT
L_PREPAR := ,
 L_PREPAR 6
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
T_CMP_V1 := ,
T_CMP_V2 := ,  T_CMP_V1

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
RES_SYNC

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
RES_ZERO
:=
:=
,
)
 T_CMP_V2
 RES_SYNC

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ  RES_ZERO

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ

FM 450-1 Counter Function Module


C79000-G7076-C450-01 6-3
Programming the FM 450–1

FC CNT_CTRL Table 6-1 lists the FC CNT_CTRL parameters.


Parameters

ÁÁÁÁÁ
ÁÁÁÁÁ
Table 6-1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FC CNT_CTRL Parameters

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
Name

ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Declaration
Type
ÁÁÁÁÁÁ
Data Type Meaning The User... The Block...

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
DB_NO INPUT BLOCK_DB Number of the data block enters this scans this

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
SW_GATE INPUT BOOL
with the counter data
Counter control bit ‘SW sets and resets scans this

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
gate (start/stop) this

ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
GATE_STP INPUT BOOL Counter control bit ‘Gate sets and resets scans this

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
stop’ this

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
OT_ERR_A INPUT BOOL Acknowledge operator er- sets and resets scans this
ror this

ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
OT_ERR OUTPUT BOOL Operator error occurred scans this sets and resets
6 this

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
L_DIRECT IN-OUT BOOL Initiation bit for ‘direct sets this scans and resets

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
loading’ of a counter this

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
L_PREPAR IN-OUT BOOL Initiation bit for ‘Prepara- sets this scans and resets

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
tory loading’ of a counter this

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
T_CMP_V1 IN-OUT BOOL Initiation bit for transfer sets this scans and resets
‘Comparison value 1’ this

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
T_CMP_V2
ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
IN-OUT
ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
BOOL Initiation bit for transfer
‘Comparison value 2’
sets this scans and resets
this

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
RES_SYNC IN-OUT BOOL Delete ‘Synchronization’ sets this scans and resets

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
RES_ZERO IN-OUT BOOL
status bit
Delete ‘Zero pass’ status sets this
this
scans and resets

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
bit this

You make a job request for the FM 450-1 via the relevant FC parameters
L_DIRECT, L_PREPAR, T_CMP_V1, T_CMP_V2, RES_SYNC,
RES_ZERO, OT_ERR_A and GATE_STP.
Depending on the job request, you must enter the load value or a comparison
value in the instance DB before calling the FB.
A set in/out parameter (L_DIRECT, L_PREPAR, T_CMP_V1, T_CMP_V2,
RES_SYNC and RES_ZERO) is deleted again by the FC CNT_CTRL after
completion of the job.

Restart As soon as the FC CNT_CTRL detects a restart (CPU restart or FM restart),


Characteristics any pending job is relegated and the restart is acknowledged first. Any job
already initiated by you is continued only after the restart has been completed
and will not be lost.

Error Messages If an operator error occurs in the case of an FC call, this is reported in the
OT_ERR parameter. The error information can then be read out in DB1
(OT_ERR_B variable). With the help of the OT_ERR_A parameter, you can
then acknowledge operator errors. No new operator error will be reported
until you have acknowledged the previous one.

FM 450-1 Counter Function Module


6-4 C79000-G7076-C450-01
Programming the FM 450–1

6.2 The FC DIAG_INF Function

Functionality The FC DIAG_INF function reads data set DS1 from the FM 450-1 and
makes it available to you in the DB of the FC CNT_CTRL. The transfer
works as follows:
S If the initiation parameter is set (IN_DIAG = TRUE), DS1 is read out
from the FM 450-1.
S DS1 is entered in the DB of the FC CNT_CTRL from DW 54. DS1 is
transferred with the help of the SFC RD_REC.
S The return code of the SFC (RET_VAL) is copied to the RET_VAL pa-
rameter of the FC DIAG_INF.
S As soon as the function has been executed, the IN_DIAG initiation pa-
rameter is reset and the transfer is reported to be complete.
Manual /2/ contains a full description of the SFC RD_REC.
6

Call The FC DIAG_INF can be called in the cycle and in the interrupt program.
There is no point in calling it in the time-controlled program.
The FC DIAG_INF call is given in the STL and LAD methods of representa-

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
tion below.

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
STL method of representation LAD method of representation

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
CALL DIAG_INF(
DB_NO := , DIAG_INF

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
RET_VAL
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
IN_DIAG
ÁÁ
:=
:=
,
);
 EN
 DB_NO RET_VAL 
ENO 

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
 IN_DIAG

ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
FC DIAG_INF Table 6-2 lists the FC DIAG_INF parameters.
Parameters

ÁÁÁÁÁ
ÁÁÁÁÁÁ
Table 6-2
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
FC DIAG_INF Parameters

ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁ
Name

ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁ
Declaration

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Type
ÁÁÁÁÁ
Data Type Meaning The User... The Block...

ÁÁÁÁÁ
ÁÁÁÁÁÁ
DB_NO
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
INPUT
ÁÁÁÁÁ
ÁÁÁÁÁÁ BLOCK_DB Number of the FC enters this scans this

ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
CNT_CTRL data block

ÁÁÁÁÁ
ÁÁÁÁÁÁ
RET_VAL
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
OUTPUT
ÁÁÁÁÁ
ÁÁÁÁÁ
WORD Returncode of the SFC 59 scans this enters this

ÁÁÁÁÁ
ÁÁÁÁÁÁ
IN_DIAG

ÁÁÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁ
IN-OUT

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
BOOL Initiation bit read diagnos- sets and scans
tics data set DS1 this
resets this

FM 450-1 Counter Function Module


C79000-G7076-C450-01 6-5
Programming the FM 450–1

6.3 Application Example

Introduction The example below shows how the FC CNT_CTRL can be used for the func-
tions ‘Transfer load value to FM 450-1’ and ‘Start counter’. These functions
are representative of all functions here.

STL Explanation
L +1000; // Enter load value in
T CHANNEL1.LOAD_VAL; // the DB.

A INITIATE;
S LOAD_DIRECT; // DIRECT input parameter

6 R INITIATE;

CALL CNT_CTRL, ( // FC call with the DB


// Channel 1
SW_GATE :=START, // Control software gate
GATE_STP :=GATE_STOP, // Stop gate
OT_ERR_A :=ERR_ACKN, // Acknowledge operator error
OT_ERR :=OPERATOR_ERR, // Operator error occurred
L_DIRECT :=LOAD_DIRECT, // Load new counter value
L_PREPAR :=LOAD_INDIRECT, // Prepare new counter value
T_CMP_V1 :=COMP1_LOAD, // Load new comparison value 1
T_CMP_V2 :=COMP2_LOAD, // Load new comparison value 2
RES_SYNC :=RES_SYNCHRON, // Delete synchronization status bit
RES_ZERO :=RES_ZERO); // Delete zero pass status bit
AN OPERATOR_ERR; // If no error has occurred,
JC CONT; // CONTinue
// *** Error evaluation START ***
L CHANNEL1.OT_ERR_B; // Read and display additional
T OUTPUT; // information.
SET // Generate RLO 1
S ERR_ACKN // Acknowledge error
... // Further error response
JU END; // ***Error evaluation END ***
CONT: .. // Continue with normal execution
AN LOAD_DIRECT; // Load direct function is ready
S START; // Open software gate;
END:

FM 450-1 Counter Function Module


6-6 C79000-G7076-C450-01
Programming the FM 450–1

Description of the Table 6-3 lists the symbols used in the example. You define your own symbol
Symbols assignments in the S7 Symbol Table.

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
Table 6-3

ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
Symbols in the User Program

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Symbol Absolute (Example) Comments

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
CHANNEL1 DB 1 Data block for FC CNT_CTRL

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
CHANNEL1.LOAD_VAL DB1.DBB14 Counter value specified in DB1

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
INITIATE M 10.0 Initiation memory bit generated as a result of the technological

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
requirement

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
LOAD_DIRECT M 20.0 Load counter value direct

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
START M 20.1 Start counter

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
GATE_STOP M 20.2 Close counter gate

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ERR_ACKN

ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
M 20.3

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
LOAD_INDIRECT M 20.4
Acknowledge operator error
Preparatory loading of counter value
6
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
COMP1_LOAD

ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
M 20.5

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load comparison value 1

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
COMP2_LOAD M 20.6 Load comparison value 2

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RES_SYNCHRON M 20.7 Reset synchronization status bit

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RES_ZERO M 21.0 Zero pass status bit, reset overflow and underflow

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
OPERATOR_ERR M 21.1 Operator error occurred

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
CHANNEL1.OT_ERR_B DB1.DBX40.0 Operator error information in DB1

Description of the When the FC is called, the load value of a channel is transferred to the
Sequence FM 450-1. The load value must have previously been entered in the DB1.
Calling the FC CNT_CTRL selects either the parameter L_DIRECT or
L_PREPAR. The selection bit L_DIRECT defines that the load value is trans-
ferred directly into the counter (L_DIRECT=1). The selection bit L_PREPAR
defines that the load value is stored in the load register (L_PREPAR=1). The
load value in the load register is then transferred to the counter when the
counter is next set. A new counter value is prepared L_PREPAR=1. Transfer
of the load value lasts at least 3 FC calls.
The FC must be called until it has reset the selected initiation bit
(L_DIRECT or L_PREPAR). While the job is in progress, the in/out parame-
ter remains set. The FC CNT_CTRL does not output any error messages with
regard to data exchange with the FM.
If the parameter you set is reset by the FC CNT_CTRL, the FM 450-1 has
accepted the FM 450-1. The read-back load value stored in DB1 is updated
by the FC CNT_CTRL.
You must generate the ‘Initiation’ bit in accordance with your technological
requirements. This bit must only remain at ‘1’ for one cycle. Please note that
the FC must be called until the in/out parameter is reset by the FC
CNT_CTRL.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 6-7
Programming the FM 450–1

6.4 Technical Specifications of the Blocks

Technical Specifications FC CNT_CTRL FC DIAG_INF


Block number FC 0 FC 1
Version 1.0 1.0
Assignment in working 438 bytes 186 bytes
memory
Assignment in load 522 bytes 262 bytes
memory
Assignment in local data – 20 bytes
area
System function called – SFC 59 RD_REC

FM 450-1 Counter Function Module


6-8 C79000-G7076-C450-01
Programming in M7 with the Counter
Function Library 7
This Chapter... If you use an FM 350-1, FM 450-1 counter module or an IF 961-CT1 inter-
face submodule with a CPU from the M7-300/400 product range, you can
create your application in the C programming language. This chapter de-
scribes how to create C application programs with the help of the counter
function library. You will learn:
S which functions are available to you
S which structural principle a C application program has for the counter
module
S how you use the functions of the counter function library in the program
S how to handle any errors occurring in the program sequence

Chapter Overview Section Contents Page


7.1 Overview 7-2
7.2 Basic Program Structure 7-4
7.3 Initializing and Parameterizing the Counter Channel 7-5
7.4 Transferring the Load Value and Comparison Values 7-7
7.5 Control of the Digital Inputs and Outputs 7-8
7.6 Starting and Stopping the Counter Channel 7-9
7.7 Reading the Counter Value and the Load Value, Scanning 7-10
and Resetting the Status
7.8 Processing Interrupts 7-11
7.9 Processing Error Messages 7-12

FM 450-1 Counter Function Module


C79000-G7076-C450-01 7-1
Programming in M7 with the Counter Function Library

7.1 Overview

Overview of the The counter function library offers you functions with which you can do the
Functions following:
S Initialize and parameterize the counter channel
S Transfer the load value and the comparison values
S Start and stop the counter channel
S Control digital inputs and outputs of the counter module
S Scan and reset the counter status
S Read the counter value
S Scan the diagnostics and error information

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
The table below lists the functions in alphabetical order:

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Function Description

7 ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntDisableOut Disable outputs

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntDisableSet Disable SET input

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntEnableOut Enable outputs

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntEnableSet Enable SET input

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntInit Initialize counter channel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntLoadAndStart Load and start counter channel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntLoadComp Transfer comparison values

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntLoadDirect

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntLoadPrep
Load counter channel
Prepare loading

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntPar

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntRead
Parameterize counter channel
Read counter value

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntReadDiag

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntReadLoadValue
Read diagnostics information
Read load value

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntReadParError

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Read parameterization error

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntReadStatus Read counter status

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntResetStatus Reset counter status

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntStart Start counter channel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntStop Stop counter channel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntStopAndRead Stop counter channel and read counter
value

In the following sections you will learn how to use these functions in the user
program.
This chapter does not contain a detailed description of the individual parame-
ters or function arguments. Please see Chapter 12 for these.

FM 450-1 Counter Function Module


7-2 C79000-G7076-C450-01
Programming in M7 with the Counter Function Library

Programming All the system functions and standard functions of the M7-300/400 system
Environment software are available to you for programming in the Borland C/C++ devel-
opment environment in STEP 7.
System functions support you in the following, for example:
S Task management
S Memory management
S Communications
S Interrupt processing
S Diagnostics processing
S Responding to system states
S Accessing process I/O
In addition, you can use the standard functions of the RMOS CRUN library.
You will find descriptions of these functions in the M7-300/400 system soft-
ware manuals.
7
Header File When creating a C program for counter control, you must link in the header
file M7CNT.H in the declaration section. All other necessary header files are
already linked when you work with Borland C programs.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 7-3
Programming in M7 with the Counter Function Library

7.2 Basic Program Structure

Sequence 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 Explanation

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
1 M7LinkIOAlarm Trigger and handle process interrupts. Otherwise, no

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
(from M7-API) process interrupts are reported.

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
2 M7LinkDiagAlarm Trigger and handle diagnostics interrupts. Otherwise,
(from M7-API) no diagnostics interrupts are reported.

7
3
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntInit

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Initialize counter channel (mandatory)

ÁÁÁÁÁÁÁ
M7CntPar

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
4 Parameterize counter channel via the program. Other-
wise, you can parameterize the counter channel under

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
STEP 7 (see ‘Parameter Assignment’ chapter).

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
5 M7CntLoadDirect Communicate a load value to the counter channel.

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Otherwise, the counter channel starts with the value
0.
6
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntLoadComp

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Communicate comparison values to the counter
channel. Otherwise, the comparison values are at 0.
7
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntEnableOut

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Enable outputs if you want to use the digital outputs
of the counter channel.

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
8 M7CntStart 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

9 ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntStop
channel via the START digital input.
Stop counter channel

10
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntRead

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Read counter value, for example, for test purposes or
further processing.

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.

Example The software package includes an example program that clearly illustrates
use of the counter functions and makes it easier for you to start programming.

FM 450-1 Counter Function Module


7-4 C79000-G7076-C450-01
Programming in M7 with the Counter Function Library

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:
S 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).
S Input type (always M7IO_IN or M7IO_OUT, it doesn’t matter which)
S 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) 7
Logical Channel The function supplies the ‘logical’ channel number that you use for all fur-
Number ther accesses to this counter channel.

Example M7CntInit (CNTMODULEADDRESS, M7IO_IN, 1, &LogChannel)


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:
S The operating mode (with software gate or hardware gate)
S The sensor type (24 V or 5 V)
S The interrupt characteristics of the counter channel, etc.
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:
S With STEP 7
S With the M7CntPar function

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 7-5
Programming in M7 with the Counter Function Library

Note
The parameters valid at any one time cannot be read out using STEP 7.

Parameterizing the You can parameterize and reparameterize a counter channel via the user pro-
Counter Channel gram using the M7CntPar function. You specify the new parameterization
with M7CntPar data in the M7CNT_PARAM structure when you call the M7CntPar function
(see the function library). The function transfers the parameterization data to
the counter module and the new settings become effective immediately.

Note
When you call the M7CntPar function, all the current parameterization data
are always completely overwritten and no part parameterizations can be
made.
When reparameterizations are made, any previously stored input or output
7 enables are lost. This means that the M7CntEnableSet and, for example,
M7CntEnableOut functions may have to be called again after M7CntPar.
Reparameterization overwrites already set comparison values and the load
value.
When reparameterizing with the M7CntPar function, counter pulses can also
be lost.
Reparameterization does not affect the other counter channel in the
FM 450-1.

Parameterization Table 12-1 (page 12-26) shows you the assignments between the components
Data of the M7CNT_PARAM structure and the parameterization data, data type,
value range and default value.

FM 450-1 Counter Function Module


7-6 C79000-G7076-C450-01
Programming in M7 with the Counter Function Library

7.4 Transferring the Load Value and Comparison Values

Load Value You can specify a starting value, the load value (LoadVal) to the counter
channel. The default load value is 0.

M7CntLoadDirect The load value can be transferred direct to the counter channel or it can be
M7CntLoadPrep stored temporarily in the counter-internal load register.
The counter channel can be loaded direct with the M7CntLoadDirect func-
tion.
With the M7CntLoadPrep function, the load value is not transferred direct to
the counter channel, but stored temporarily in the counter channel. The
counter channel accepts the load value if:
S a hardware pulse exists at the SET or START input
S an overflow or underflow takes place and a periodic operating mode is set
S the M7CntStart function is called 7
Comparison You can use the comparison values to control the digital outputs and to trig-
Values ger interrupts: As soon as the comparison value has been reached, an output
can be set, thus triggering a control action. In addition, you can stipulate that
a process interrupt is to be triggered as soon as a specific comparison value
has been reached. You determine the behavior of the digital outputs via para-
meterization. Appendix A contains a description of the possible settings and
their effects.
If you control the digital outputs with the comparison values, you must en-
able the digital outputs with the M7CntEnableOut function. This call is also
required after reparameterization of the counter channel.

M7CntLoadComp You can transfer one or two comparison values to the counter channel with
the M7CntLoadComp.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 7-7
Programming in M7 with the Counter Function Library

7.5 Control of the Digital Inputs and Outputs

Digital Inputs The counter module has the digital inputs START, STOP, RESET (IF
961-CT1 only) and SET.
If an operating mode with hardware gate control has been set, you can con-
trol the counter module via hardware signals.
Using the SET digital input, the counter channel can be set to the load value
via an external signal (see Chapter 9).

M7CntEnableSet The SET input is enabled with the M7CntEnableSet function. The SET input
(or the associated loading of the counter channel) can be enabled for the up
count direction, the down count direction or both count directions with only
one function call.

M7CntDisableSet Analogously, the SET input can be disabled via the M7CntDisableSet func-
7 tion. The SET input can be disabled for the up count direction, the down
count direction or both count directions with only one function call in the
same way as it could be enabled.

Digital Outputs The counter module has two digital outputs (per counter channel) that you
can use to trigger responses in the process independently of the CPU.

M7CntEnableOut With the M7CntEnableOut function, one output or two of two possible out-
puts can be enabled with a single function call. The function enables the
physical output.

M7CntDisableOut With the M7CntDisableOut function, each output can be disabled individu-
ally or both outputs can be disabled simultaneously with a single function
call.

FM 450-1 Counter Function Module


7-8 C79000-G7076-C450-01
Programming in M7 with the Counter Function Library

7.6 Starting and Stopping the Counter Channel

Starting the Depending on the operating mode, with hardware or software gate control,
Counter Channel there are two methods of starting the counter channel:
1. Via the software gate with the M7CntStart function
2. Via the hardware gate by a signal at the START digital input.
You set the operating mode via parameterization.

M7CntStart Using the M7CntStart, the counter channel is started via the software gate.
The function opens the software gate.

M7CntLoadAnd- In addition, the counter channel can be started via the M7CntLoadAndStart
Start function. When called, this function transfers a load value direct to the
counter channel. Like M7CntStart, this function also starts the counter chan-
nel via the software gate. 7
Note
In the case of the operating modes with hardware gate control, the
M7CntStart and M7CntLoadAndStart functions initiate a message pointing
out an operator error.

Stopping the There are two methods of stopping the counter channel:
Counter Channel
1. Via the software gate with one of the M7CntStop or M7CntStopandRead
functions.
2. Via the hardware gate by a signal at the STOP digital input

M7CntStop The counter channel is stopped with the M7CntStop function. The gate stop
function of the counter channel is switched on with this function. The func-
tion operates independent of the method of gate control (hardware gate or
software gate).

Note
If a counter channel with hardware gate control is stopped with the
M7CntStop function, the counter channel cannot be started until parameter-
ization or reparameterization (M7CntPar function) has taken place.

M7CntStopAnd- The counter channel can also be stopped via the M7CntStopAndRead func-
Read tion. This function stops the counter channel and reads the counter status.
The function is possible in all operating modes with gate control.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 7-9
Programming in M7 with the Counter Function Library

7.7 Reading the Counter Value and the Load Value, Scanning and Re-
setting the Status

Scanning The functions listed below are used for scanning information such as
Information
S Counter value
S Load value and
S Counter status
The counter status can be reset if required.

M7CntRead The counter status can be read with M7CntRead. The current status of the
counter channel is read and stored in the pActCntV return parameter.

M7CntStop The M7CntStopAndRead function stops the counter channel and reads the
7 AndRead counter status simultaneously. The current counter status is then stored in
pActCntV.

M7CntRead The load value of a counter channel can be read with M7CntReadLoadValue.
LoadValue

Scanning the You can scan the status of the counter channel with the M7CntReadStatus
Counter Status function. The function returns the counter status. See the description of
M7CntReadStatus in Appendix 12 for the meaning of the individual bits in
the counter status. The function can be used, for example, to scan the zero
pass to see if the counter channel is running, if the counter overflow has
taken place, which counter direction is in force, etc.

Resetting the Bits that have been set in M7CntReadStatus can be reset again via the
Counter Status M7CntResetStatus, in order, for example, to detect a renewed zero pass or a
renewed counter synchronization (multiple setting via SET digital input).

FM 450-1 Counter Function Module


7-10 C79000-G7076-C450-01
Programming in M7 with the Counter Function Library

7.8 Processing Interrupts

Registering at the Depending on the parameters assigned, the counter module can initiate pro-
Interrupt Server cess interrupts and/or diagnostics interrupts. In order to receive process inter-
rupts and diagnostics interrupts, the counter channel must be registered with
the interrupt server. For this purpose, you must call the following functions:
S M7LinkIOAlarm, to receive process interrupts
S M7LinkDiagAlarm, to receive diagnostics interrupts
See the System Software for M7-300 and M7-400 Programming Manual for
details of how to work with the interrupt server.

Evaluating Your parameter assignments determine if the counter module is to initiate


Process Interrupts process interrupts and if so which process interrupts it is to initiate (see
Table12-1). If required, you define the responses to process interrupts in the
program.
7
Evaluating If a diagnostics interrupt is signaled by the interrupt server you must evaluate
Diagnostics the signal (data set DS0) in order to determine the cause of the interrupt. You
Interrupts can call the following functions from the counter function library to get addi-
tional information:
S M7CntReadDiag, if the diagnosis is ‘Error in one channel’.
S M7CntReadParError, if the diagnosis is ‘Parameter assignment error’.

M7CntReadDiag By calling the M7CntReadDiag function, you can scan additional informa-
tion on the channel error. When the function is called, the diagnostics data set
DS1 is read. Data set DS1 contains the additional channel-specific diagnos-
tics information. The first 4 bytes of DS1 contain the current DS0 data set.
The diagnostics interrupts and data sets DS0 and DS1 are explained in
Chapter 13.

M7CntRead If the cause of the diagnostics interrupt is a parameter assignment error, you
ParError can scan more detailed information with the M7CntReadParError function.
The M7CntReadParError function returns an error number that indicates a
data error in the M7CNT_PARAM structure. From this you can determine
which parameterization datum contains the error or has been assigned an ille-
gal value and you can reparameterize the counter module accordingly.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 7-11
Programming in M7 with the Counter Function Library

7.9 Processing Error Messages

Error Messages If an error occurs during execution of a function, the function supplies an
error number as a return value. You can determine the exact cause of the er-
ror with the help of this error number. See Chapter 13 for exact descriptions
of the error numbers.

Error Numbers The table shows the ranges of the error numbers and tells you where you can
find more detailed information on evaluating the error numbers:

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Return Value Meaning Description in..

ÁÁÁÁÁÁÁÁ
0
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
1 to 99
ÁÁÁÁÁÁÁÁ
No error
Operator error Chapter 13

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
200 to 400
ÁÁÁÁÁÁÁÁ Parameter assignment error Chapter 13

7 ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
–1 to –999

ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
M7API function error (e.g. System Software for
I/O configuration error) M7-300 and M7-400

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Reference Manual

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
–1000 to –1100 Error in the counter func- Chapter 13
tion library (e.g. channel

ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ number invalid)

FM 450-1 Counter Function Module


7-12 C79000-G7076-C450-01
Starting Up the FM 450-1 8
This Chapter... This chapter contains the checklists for starting up the FM 450-1. These
checklists enable you to:
S check all working steps prior to operating the module
S avoid operating faults in the module

Chapter Section Contents Page


Overview 8.1 Mechanical Installation Checklist 8-2
8.2 Parameter Assignment Checklist 8-4

FM 450-1 Counter Function Module


C79000-G7076-C450-01 8-1
Starting Up the FM 450-1

8.1 Mechanical Installation Checklist

Checklist Use the checklist below to check and document the working steps for me-
chanical installation of the FM 450-1.

Working Step Options/Procedure (X)


Determine slot All slots that are not already occupied or due to be occupied by a power supply
module, a CPU or an IM.
Install FM 450-1 1. Hang module into position and tighten screw
2. Attach slot number
Select cables Observe rules and specifications in Section 4.2
Connect 5 V encoders Counter 1: Terminal Name Function
Incremental 5 V encoder 14 1M Encoder supply ground
with differential signals 15 5.2 VDC 5.2 V encoder supply
A, A, B, B, N and N
5 A Encoder signal A
6 A Encoder signal A
7 B Encoder signal B

8 8
9
B
N
Encoder signal B
Encoder signal N
10 N Encoder signal N
Counter 2: Terminal Name Function
Incremental 5 V encoder 26 1M Encoder supply ground
with differential signals 27 5.2 VDC 5.2 V encoder supply
A, A, B, B, N and N
17 A Encoder signal A
18 A Encoder signal A
19 B Encoder signal B
20 B Encoder signal B
21 N Encoder signal N
22 N Encoder signal N
Connect 24 V Counter 1: Terminal Name Function
encoders Incremental 24 V 14 1M Encoder supply ground
encoder 16 24 VDC 24 V encoder supply
11 A* Encoder signal A *
12 B* Encoder signal B *
13 N* Encoder signal N *

FM 450-1 Counter Function Module


8-2 C79000-G7076-C450-01
Starting Up the FM 450-1

Working Step Options/Procedure (X)


Connect 24 V Counter 2: Terminal Name Function
encoders Incremental 24 V 26 1M Encoder supply ground
encoder 28 24 VDC 24 V encoder supply
23 A* Encoder signal A *
24 B* Encoder signal B *
25 N* Encoder signal N *
Counter 1: Terminal Name Function
24 V pulse encoder with- 14 1M Encoder supply ground
out direction level (initia- 16 24 VDC 24 V encoder supply
tor/BERO)
11 A* Encoder signal A *
Counter 2: Terminal Name Function
24 V pulse encoder with- 26 1M Encoder supply ground
out direction level (initia- 28 24 VDC 24 V encoder supply
tor/BERO)
23 A* Encoder signal A *
Counter 1: Terminal Name Function
24 V pulse encoder with 14 1M Encoder supply ground
direction level 16 24 VDC 24 V encoder supply
11
12
A*
B*
Encoder signal A *
Direction level B*
8
Counter 2: Terminal Name Function
24 V pulse encoder with 26 1M Encoder supply ground
direction level 28 24 VDC 24 V encoder supply
23 A* Encoder signal A *
24 B* Direction level B*
Wiring digital inputs Counter 1: Terminal Name Function
and outputs Digital inputs and outputs 29 1I0 START digital input
30 1I1 STOP digital input
31 1I2 SET digital input
33 1Q0 Q0 digital output
34 1Q1 Q1 digital output
Counter 2: Terminal Name Function
Digital inputs and outputs 41 2I0 START digital input
42 2I1 STOP digital input
43 2I2 SET digital input
45 2Q0 Q0 digital output
46 2Q1 Q1 digital output
Connecting the auxil- Terminal Name Function
iary voltage and the Encoder supply 3 1L+ 24 V auxiliary voltage
load voltage
4 1M Auxiliary voltage ground
Supplying the digital in- 47 2L+ 24 V load voltage
puts and outputs 48 2M Load voltage ground

FM 450-1 Counter Function Module


C79000-G7076-C450-01 8-3
Starting Up the FM 450-1

8.2 Parameter Assignment Checklist

Checklist Use the checklist below to check and document the working steps for para-
meterizing the FM 450-1. Parameterize the FM 450-1 counters one after the
other according to the checklist.

Working Step Options/Procedure (X)


Parameterize the FM Select Encoders for Counter 1
450 1
450-1
5 V encoders with sym- Monitoring A+B+N
metric signals
A+B
A
None
24 V encoders with asym- Interface Sink output
metric signals
Source output/push-pull
Frequency range v 200 kHz/w 2.5 s
Minimum pulse width v 20 kHz/w 25 s
24 V encoders with pulse Interface Sink output
train and direction signal
8 Frequency range
Source output/push-pull
v 200 kHz/w 2.5 s
Minimum pulse width v 20 kHz/w 25 s
24 V initiator
Signal evaluation Single
Double
Quadruple
Frequency and direction (for 24 V encoders)
Select Encoders for Counter 2
5 V encoders with sym- Monitoring A+B+N
metric signals
A+B
A
None
24 V encoders with pulse Interface Sink output
train and direction signal
Source output/push-pull
Frequency range v 200 kHz/w 2.5 s
Minimum pulse width v 20 kHz/w 25 s
24 V encoders with pulse Interface Sink output
train and direction signal
Source output/push-pull
Frequency range v 200 kHz/w 2.5 s
Minimum pulse width v 20 kHz/w 25 s
24 V initiator

FM 450-1 Counter Function Module


8-4 C79000-G7076-C450-01
Starting Up the FM 450-1

Working Step Options/Procedure (X)


Parameterize the Signal evaluation Single
450 1
FM 450-1 Double
Quadruple
Frequency and direction (for 24 V encoders)
Determine operating mode for counter 1
Continuous counting Without gate
With software gate
With hardware gate
Single counting With software gate
With hardware gate
Periodic counting With software gate
With hardware gate
Determine counting mode 0 to +32 bits
–31 bits to +31 bits
Determine operating mode for counter 2
Continuous counting Without gate
With software gate
With hardware gate 8
Single counting With software gate
With hardware gate
Periodic counting With software gate
With hardware gate
Determine counting mode 0 to +32 bits
–31 bits to +31 bits
Determine the behavior of the digital inputs for counter 1
Hardware gate Level-controlled
Edge-controlled
Minimum pulse width w 2.5 s
w 25 s
Set counter Setting once
Multiple setting
Evaluate zero mark for setting
Determine the behavior of the digital inputs for counter 2
Hardware gate Level-controlled
Edge-controlled
Minimum pulse width w 2.5 s
w 25 s
Set counter Setting once
Multiple setting

FM 450-1 Counter Function Module


C79000-G7076-C450-01 8-5
Starting Up the FM 450-1

Working Step Options/Procedure (X)


Evaluate zero mark for setting
Parameterize the Determine the behavior of the digital outputs for counter 1
FM 450-1
450 1
Output 1Q0 Switch off
Active from comparison value 1 to overflow
Active from comparison value 1 to underflow
Active for ‘Pulse duration’ when comparison value 1
is reached in up direction
Active for ‘Pulse duration’ when comparison value 1
is reached in down direction
Active for ‘Pulse duration’ when comparison value 1
is reached in up or down direction
Output 1Q1 Switch off
Active from comparison value 2 to overflow
Active from comparison value 2 to underflow
Active for ‘Pulse duration’ when comparison value 1
is reached in up direction
Active for ‘Pulse duration’ when comparison value 2
8 is reached in down direction
Active for ‘Pulse duration’ when comparison value 2
is reached in up or down direction
Pulse duration 0 to 500 ms
Determine the behavior of the digital outputs for counter 2
Output 2Q0 Switch off
Active from comparison value 1 to overflow
Active from comparison value 1 to underflow
Active for ‘Pulse duration’ when comparison value 1
is reached in up direction
Active for ‘Pulse duration’ when comparison value 1
is reached in down direction
Active for ‘Pulse duration’ when comparison value 1
is reached in up or down direction
Output 2Q1 Switch off
Active from comparison value 2 to overflow
Active from comparison value 2 to underflow
Active for ‘Pulse duration’ when comparison value 1
is reached in up direction
Active for ‘Pulse duration’ when comparison value 2
is reached in down direction
Active for ‘Pulse duration’ when comparison value 2
is reached in up or down direction
Pulse duration 0 to 500 ms

FM 450-1 Counter Function Module


8-6 C79000-G7076-C450-01
Starting Up the FM 450-1

Working Step Options/Procedure (X)


Parameterize the Enable digital outputs
450 1
FM 450-1
CTRL_DQ0 in DB 1
CTRL_DQ1 in DB 1
Determine load value and comparison values for counter 1 and enter in DB
Load value
Comparison value 1
Comparison value 2
Determine load value and comparison values for counter 2 and enter in DB
Load value
Comparison value 1
Comparison value 2
Enter basic data in DB1
Module address
Channel address
User data length 32
Select interrupts for counter 1
Interrupt on opening the gate
Interrupt on closing the gate
8
Interrupt in event of overflow
Interrupt in event of underflow
Interrupt in event of zero pass
Interrupt on reaching comparison value 1 in up direction
Interrupt on reaching comparison value 1 in down direction
Interrupt on reaching comparison value 2 in up direction
Interrupt on reaching comparison value 2 in down direction
Interrupt on setting counter
Select interrupts for counter 2
Interrupt on opening the gate
Interrupt on closing the gate
Interrupt in event of overflow
Interrupt in event of underflow
Interrupt in event of zero pass
Interrupt on reaching comparison value 1 in up direction
Interrupt on reaching comparison value 1 in down direction
Interrupt on reaching comparison value 2 in up direction
Interrupt on reaching comparison value 2 in down direction
Interrupt on setting counter
Link FCs into user pro- Link in FC CNT_CTRL
gram
Link in FC DIAG_INF

FM 450-1 Counter Function Module


C79000-G7076-C450-01 8-7
Starting Up the FM 450-1

FM 450-1 Counter Function Module


8-8 C79000-G7076-C450-01
Operating Modes, Settings, Parameters
and Commands 9
This Chapter... You will find the following in this chapter:
S An overview of the three operating modes, the different settings and the
possible commands and their calls
S A description of the three operating modes
S A description of the settings
S A description of the two commands
S Marginal conditions and notes you must observe when using these func-
tions.

Chapter Section Contents Page


Overview 9.1 Definitions 9-2
9.2 Basic Information on Calling Operating Modes, Settings 9-4
and Commands
9.3 Continuous Counting 9-5
9.4 Single Counting 9-7
9.5 Periodic Counting 9-9
9.6 Setting: Counting Mode 9-11
9.7 Setting: Behavior of the Digital Outputs 9-12
9.8 Setting: Pulse Duration 9-15
9.9 Command: Open and Close Gate 9-16
9.10 Command: Set Counter 9-19
9.11 Initiating a Process Interrupt 9-24

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-1
Operating Modes, Settings, Parameters and Commands

9.1 Definitions

Which Operating When you specify one of the three operating modes, you select the function-
Modes are ality with which you want to operate the FM 450-1. Table 9-1 gives an over-
Available? view of these operating modes.

Table 9-1 The Operating Modes of the FM 450-1

Name Description
Continuous counting The FM 450-1 counts continuously from the current counter
(with or without gate) status.
Single counting with The FM 450-1 counts on opening the gate from the load
software gate or hard- value to the count limit.
ware gate
Periodic counting with The FM 450-1 counts on opening the gate between the load
software gate or with value and the count limit.
hardware gate

You can parameterize the two counters of the FM 450-1 in different modes.
The default setting is the ‘Continuous counting’ mode.
The selection of the count mode, the behavior of the two digital outputs, the
pulse duration, the evaluation of the count signals and the choice of signal for
setting the counter are independent of the operating mode.

9
What Settings are You can adapt the FM 450-1 to your counting task with five settings.
Available? Table 9-2 gives an overview of these settings.

Table 9-2 The Settings of the FM 450-1

Name Description
Count mode With the count mode, you select the counting range
and so the count limits.
Behavior of digital outputs You can choose between six possibilities for the be-
Q0 and Q1 havior of the outputs on reaching the comparison
value.
Pulse duration The pulse duration indicates the time for which the
output is to be set.
Initiating process interrupts The FM 450-1 can initiate a process interrupt in the
case of a variety of selectable events.
Encoder You must specify different settings for the encoder
used. These settings are described in Appendix B.

FM 450-1 Counter Function Module


9-2 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

Which Commands You can influence the count in the FM 450-1 with two commands. Table 9-3
are Available? gives an overview of these commands.

Table 9-3 The Commands of the FM 450-1

Name Description
Open and close gate The count is started by opening a gate and stopped by
closing the gate.
Set counter The counter can be set to the load value via different
signals.

Basic Parameter You carry out basic parameter assignment for each FM 450-1 when you con-
Assignment figure the hardware. Table 9-4 gives the meanings of the relevant parameters.

Table 9-4 Parameters for Basic Parameter Assignment

Name Option Description


Interrupt selec- None You enable the relevant interrupts via this
tion Diagnostics selection
Process
Process and diag-
nostics
Responses to OD STOP Immediate switch off of the outputs

Continue
Termination of count
The module continues
9
Terminate cur- In the case of operating modes with hardware
rent job gate, the single count continues until it termi-
nates itself or until it is terminated by closing
of the hardware gate.
The periodic count is reparameterized to a
single count and terminated in the same way.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-3
Operating Modes, Settings, Parameters and Commands

9.2 Basic Information on Calling Operating Modes, Settings and


Commands

How Do You Select You select the operating modes and settings in the parameter assignment
the Operating screen forms of the FM 450-1.
Modes and
The parameter assignment data are saved automatically on the programming
Settings?
device and transferred automatically to the rack SDB.
You will find notes on installing the parameter assignment screen forms and
on parameterizing the FM 450-1 in the chapter on ‘Assigning Parameters to
the FM 450-1’ and in the integral Help.

How Do You You can change an operating mode or setting in the parameter assignment
Change Operating screen forms. The new operating mode or setting becomes valid after the
Modes and next FM 450-1 start-up.
Settings?

How Do You Give The commands are given either via hardware signals connected to the front
Commands? connector, or you set the relevant input parameter of the FC CNT_CTRL in
the user program in order to influence the count. The input parameters are
stored as control bits in the DB of the FC CNT_CTRL.

Control Bits and In addition to the control bits, there are status bits in the DB that signal the
Status Bits in the status of the count. The DB has two bytes for the control bits and two bytes
9 DB for the status bits (see Chapter 11).

Transferring the You transfer the status bits and the control bits to and from the module with
Status Bits and the the FC CNT_CTRL that you must link into your user program:
Control Bits
The control bits and status bits should, if possible, be addressed symbolically
in the user program. The symbolic names are used in the description of the
FC in this chapter.
You will find the precise description of the FC CNT_CTRL in Chapter 6
‘Programming the FM 450-1’ and you will find the DB assignments in
Chapter 11.

FM 450-1 Counter Function Module


9-4 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

9.3 Continuous Counting

Definition In this operating mode, the counter of the FM 450-1 counts continuously
from the current counter status. If the counter reaches the upper limit when
counting up, it jumps to the lower limit and continues to count from there
without any pulse losses. If the counter reaches the lower limit when count-
ing down, it jumps to the upper limit and continues to count without any
pulse losses.

Selecting the Gate You can select the gate function in this mode. The following possibilities are
Function available to you:
S Without gate (default)
S Software gate
S Hardware gate, level-controlled or edge-controlled

Counter status

Upper count limit

Current counter limit

Lower count limit

Gate start Gate stop Time 9


Figure 9-1 Continuous Counting with Load Value and Gate Function

Opening and You open and close the software gate of the counter in each case with the
Closing the input parameter SW_GATE of the FC CNT_CTRL.
Software Gate

Action ...Is Initiated By


Open software gate Setting SW_GATE
Close software gate Resetting SW_GATE

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-5
Operating Modes, Settings, Parameters and Commands

Opening and You open and close the hardware gate of each counter by applying the rele-
Closing the vant signals to or removing the signals from the inputs 1I0 and 1I1 (counter
Hardware Gate 1) or 2I0 and 2I1 (counter 2).

Action ...Is Initiated By


Open hardware gate (level-controlled) Applying signal to input 1I0 (2I0)
Close hardware gate (level-controlled) Removing signal from input 1I0 (2I0)
Open hardware gate (edge-controlled) Applying positive edge to input 1I0 (2I0)
Close hardware gate (edge-controlled) Applying positive edge to input 1I1 (2I1)

When the hardware gate opens, the counter begins to count again from the
current counter status.

Terminating the You can also terminate the count when counting with the software gate or
Count with the hardware gate by using the gate stop function of the relevant counter. For this
Gate Stop purpose, set the input parameter GATE_STP of the FC CNT_CTRL (see
Function Chapter 6.2).

FM 450-1 Counter Function Module


9-6 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

9.4 Single Counting

Definition In this mode, the counter of the FM 450-1 counts once from the load value to
the count limit.

Selecting the Gate You can select the gate function in this mode. The following possibilities are
Function available to you:
S Software gate
S Hardware gate, level-controlled or edge-controlled

Counter status
STS_OFLW
Upper count limit

Load value

Lower count limit

Gate start Gate stop Gate start Time

Figure 9-2 Single Counting with Load Value and Gate Function

Opening and
Closing the
You open and close the software gate and set the counter to the load value
with the input parameter SW_GATE of the FC CNT_CTRL.
9
Software Gate

Action ...Is Initialized By


Open software gate Setting SW_GATE
Close software gate Resetting SW_GATE

Behavior at the If the counter has reached the upper or lower count limit and a further count
Count Limits, pulse is received, the counter is set to the other count limit, the gate is closed
Software Gate and the count is terminated even if the SW_GATE parameter is still set. The
relevant bit is set in the DB of the FC CNT_CTRL.

Count Limit Reached Bit in DB


Upper limit STS_OFLW is set
Lower limit STS_UFLW is set

If you want to restart the counter, you must reset the SW_GATE parameter.
The counter then begins to count from the load value.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-7
Operating Modes, Settings, Parameters and Commands

Opening and You open and close the hardware gate and set the counter to the load value
Closing the by applying the relevant signals to or removing the signals from the inputs
Hardware Gate 1I0 and 1I1 (counter 1) or 2I0 2I1 (counter 2).

Action ...Is Initiated By


Open hardware gate (level-controlled) Applying signal to input 1I0 (2I0)
Open hardware gate (edge-controlled) Applying positive edge to input 1I0 (2I0)
Close hardware gate (level-controlled) Removing signal from input 1I0 (2I0)
Close hardware gate (edge-controlled) Applying positive edge to input 1I1 (2I1)

In the case of a level-controlled hardware gate, the gate is reopened and each
counter is set to the load value by a signal at input 1I0 (2I0).
If a positive edge is applied again to input 1I0 (2I0) in the case of an edge-
controlled hardware gate, the counter begins to count again from the load
value, regardless of whether the gate is closed or still open (retriggering),
provided input 1I1 (2I1) is not set.

Behavior at the If the counter has reached the upper or lower count limit and a further count
Count Limits, pulse is received, the counter is set to the other count limit, the gate is closed
Hardware Gate and the count is terminated even if the hardware gate is still open. The rele-
vant bit is set in the DB.

Count Limit Reached Bit in DB


9 Upper limit STS_OFLW is set
Lower limit STS_UFLW is set

If you want to restart the counter, you must reset input 1I0 (2I0). The counter
then begins to count from the load value.

Terminating the You can also terminate the count at any time with the gate stop function. For
Count with the this purpose, set the input parameter GATE_STP of the FC CNT_CTRL.
Gate Stop
Function

FM 450-1 Counter Function Module


9-8 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

9.5 Periodic Counting

Definition In this mode, the counter of the FM 450-1 counts from the load value to the
count limit, jumps back to the load value and continues to count.

Selecting the Gate You can select the gate function in this mode. The following possibilities are
Function available to you:
S Software gate
S Hardware gate, level-controlled or edge-controlled

Counter status

Upper count limit

Load value

Lower count limit

Gate start Gate stop Time

Figure 9-3 Periodic Counting with Load Value and Gate Function

Opening and
Closing the
You open and close the software gate and set the counter to the load value by
setting or resetting the relevant bit in the DB of the FC CNT_CTRL in the
9
Software Gate user program (see Chapter 11). When you open the software gate, the
FM 450-1 begins to count from the load value.

Action ...Is Initiated By


Open software gate Setting SW_GATE
Close software gate Resetting SW_GATE

If you want to restart the counter, you must reset the bit. The counter then
begins to count from the load value.

Behavior at the If a counter reaches the upper or lower count limit, it begins to count from
Count Limits, the load value. The count is continued without pulse losses. The relevant bit
Software Gate is set in the DB:

Count Limit Reached Bit in DB


Upper limit STS_OFLW is set
Lower limit STS_UFLW is set

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-9
Operating Modes, Settings, Parameters and Commands

Opening and You open and close the hardware gate and set the counter to the load value
Closing the by applying the relevant signals to or removing the signals from the inputs
Hardware Gate 1I0 and 1I1 (counter 1) or 2I0 and 2I1 (counter 2).

Action ...Is Initiated By


Open hardware gate (level-controlled) Applying signal to input 1I0 (2I0)
Close hardware gate (level-controlled) Removing signal from input 1I0 (2I0)
Open hardware gate (edge-controlled) Applying positive edge to input 1I0 (2I0)
Close hardware gate (edge-controlled) Applying positive edge to input 1I1 (2I1)

If a positive edge is applied again to input 1I0 (2I0) in the case of an edge-
controlled hardware gate, the counter begins to count again from the load
value, regardless of whether the gate is closed or still open (retriggering),
provided input 1I1 (2I1) is not set.

Behavior at the If a counter reaches the upper or lower count limit, it begins to count from
Count Limits, the load value. The count is continued without pulse losses. The relevant bit
Hardware Gate is set in the DB:

Count Limit Reached Bit in DB


Upper limit STS_OFLW is set
Lower limit STS_UFLW is set

9
Terminating the You can also terminate the count at any time with the gate stop function. For
Count with the this purpose, set the input parameter GATE_STP of the FC CNT_CTRL.
Gate Stop
Function

FM 450-1 Counter Function Module


9-10 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

9.6 Setting: Counting Mode

Introduction There is a 32 bit-wide count register on the module. With the count mode,
you select whether the module is to count only in the positive range or
whether the 32nd bit is interpreted as a sign bit thus allowing negative num-
bers to be represented. Both count modes, ‘32 bit’ and ‘+31 bit’, are de-
scribed in this section.

Counting Ranges In both count modes, the FM 450-1 counts in different counting ranges. In
each case, an overflow or underflow is detected at the range limits.
In the ‘+31 bit’ count mode, the counter status is represented in 2’s comple-
ment.

Count Counting Range Overflow Underflow


Mode
32 bit 0 to 4,294,967,295 When the counter status changes When the counter status changes
0 to FFFF FFFFH from 4,294,967,295 to 0 from 0 to 4,294,967,295

"31 bit –2,147,483,648 to When the counter status changes When the counter status changes
2,147,483,647 from +2,147,483,647 to from to –2,147,483,648 to
–2,147,483,648 +2,147,483,647
8000 0000H to 7FFF FFFFH

9
Overflow, In both count modes, a bit is set in the DB of the FC CNT_CTRL in the
Underflow and event of overflow and underflow (see Chapter 11).
Zero Pass
In the case of the ‘+31 bits’ count mode, a bit is also set in the DB in the
event of a zero pass.
In the the ‘32 bits’ count mode, , overflow or underflow is additionally indi-
cated with zero pass, depending on the direction of count.

Event Bit in DB
Overflow STS_OFLW is set
Underflow STS_UFLW is set
Zero pass STS_ZERO is set

Initiating Process You can also signal the overflow, underflow and zero pass events via process
Interrupts interrupts.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-11
Operating Modes, Settings, Parameters and Commands

9.7 Setting: Behavior of the Digital Outputs

Introduction You can store two comparison values (comparison value 1 and 2) on the
module for each counter. These comparison values are assigned to the two
digital outputs (comparison value 1: 1Q0 or 2Q0, comparison value 2: 1Q1 or
2Q1). The comparison values are compared with the current counter status. If
the counter status reaches a comparison value, the relevant output can be set.

Comparison You enter the two comparison values in the DB of the FC CNT_CTRL
Values 1 and 2 (CMP_V1, CMP_V2) and transfer them to the FM 450-1 by setting the bits
T_CMP_V1 or T_CMP_V2 (see Chapter 11). The count is not affected by
this.
The comparison values must be within the count range of the count mode set
in each case. The comparison value is interpreted in accordance with the
count mode selected. If you give FFFF FFFF H, for example, as the compari-
son value, the number is interpreted as 4,294,967,295 in 32 bit mode, and as
–1 in +31 bit mode.

Enabling the Before the outputs can be set, you must enable them first by setting the rele-
Outputs vant bits in the DB (see Chapter 11). If you reset one of these bits the
associated output is switched off immediately even if you have parameterized
a pulse duration for them.

9 Output ...Is Enabled By


Q0 CTRL_DQ0
Q1 CTRL_DQ1

Status of the You can see the status of the two outputs from the green status LEDs and
Outputs from the relevant bits in the DB.

Status of the Output Status of the LED Status of the Bit


1Q0 (2Q0) set CH 1 OUT 0 (CH2 OUT 0) STS_COMP1 set
lights up
1Q0 (2Q0) reset CH 1 OUT 0 (CH2 OUT 0) STS_COMP1 reset
dark
1Q1 (2Q1) set CH 1 OUT 1 (CH2 OUT 1) STS_COMP2 set
lights up
1Q1 (2Q1) reset CH 1 OUT 1 (CH2 OUT 1) STS_COMP2 reset
dark

FM 450-1 Counter Function Module


9-12 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

Behavior of the
O For both outputs, you can program one of 6 possible responses to reaching
Outputs the comparison value. The various possibilities are shown in the table below.

Behavior of the Outputs


Switch off

Underflow Comparison value Overflow

The output remains deactivated and is not affected by the comparison value, zero pass, over-
flow or underflow events.
Active between com-
parison value and
overflow Underflow Comparison value Overflow

The output is activated if the counter is in the range between the comparison value and over-
flow. Setting the counter to a value between the comparison value and overflow activates the
output.
Active between com-
parison value and un-
derflow Underflow Comparison value Overflow

The output is activated if the counter is in the range between the comparison value and under-
flow. Setting the counter to a value between the comparison value and underflow activates
the output.
Active for ‘Pulse t
duration’ when com-
parison value is
Underflow Comparison value Overflow
9
reached in up direc-
tion The output is activated when the comparison value is reached in the up direction for the ex-
tent of the pulse duration.
Active for ‘Pulse t
duration’ when com-
parison value is
Underflow Comparison value Overflow
reached in down
direction The output is activated when the comparison value is reached in the down direction for the
extent of the pulse duration.
Active for ‘Pulse Up t t Down
duration’ when com-
parison value is Underflow Comparison value Overflow Underflow Comparison value Overflow
reached in up or
down direction The output is activated when the comparison value is reached for the extent of the pulse dura-
tion regardless of count direction.

= output active
t = pulse duration

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-13
Operating Modes, Settings, Parameters and Commands

Marginal If you parameterize the behavior of the digital outputs, you must observe the
Conditions following marginal conditions.

If... Then...
...you want to parameterize an output ‘ac- ...you must ensure that the time between
tive between comparison value and over- these events is greater than the minimum
flow or underflow’ switching time of the outputs (switching
time: 300 s); otherwise, the control pulses
at the outputs are lost.
If the counter status reaches the compari-
son value again while the output is still
active, no new pulse is initiated. A further
pulse can only be initiated when the out-
put is no longer active.

...you want to parameterize an output ‘ac- ...you must not enable a process interrupt
tive for the pulse duration in the up direc- on ‘Reaching comparison value 1 or 2
tion’ down’.
...you want to parameterize an output ‘ac- ...you must not enable a process interrupt
tive for the pulse duration in the down on ‘Reaching comparison value 1 or 2
direction’ up’.

Switching Off the The outputs are switched off by the following events regardless of the param-
Outputs eter assignments:
S Module watchdog triggered (internal error)
9 S Removal of enable bits (CTRL_DQ0 for Q0 and CTR_DQ1 for Q1 in the
DB, see Chapter 11)

Default Setting The outputs are switched off in the default setting.

FM 450-1 Counter Function Module


9-14 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

9.8 Setting: Pulse Duration

Introduction To adapt to the actuators used in your process (contactors, final control ele-
ments, etc.), you can specify the pulse duration during which the outputs are
set when a comparison value is reached. This section describes what you
must observe if you want to define a pulse duration for the outputs.

Using the Pulse The pulse duration defines the minimum time the output must be set. This
Duration setting only takes effect if you preselect the behavior of the output accord-
ingly. The pulse duration is not effective if the output is to be set between the
comparison value and the overflow or underflow.
The pulse duration begins when the output is set. The inaccuracy of the pulse
duration is less than 1 ms.

Value Range You can specify a value between 0 and 500 ms for the pulse duration. This
value applies for both outputs.

Note
If you specify zero as the pulse duration, you must ensure that the count
pulse times are greater than the minimum switching times of the digital out-
puts (switching time: 300 s, that is, count frequency less than 3333 Hz);
otherwise the control pulses at the outputs will be lost.
Check whether your actuator can respond with the switching time of 300 s to 9
cover this eventuality.

Default Value The default value for the pulse duration is 0.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-15
Operating Modes, Settings, Parameters and Commands

9.9 Command: Open and Close Gate

Introduction The counters of the FM 450-1 have the following gates:


S A hardware gate that you can open either with level control or with edge
control.
S A software gate that you can open and close via control bits in the user
program.

Selecting the Gate When you select the operating mode (see Section 9.1), you define which
gate you want to use for the count.
The figures below represent the different methods of opening and closing the
gates of the FM 450-1.

Level-Controlled Figure 9-4 shows level-controlled opening and closing of the hardware gate
Opening and of counter 1.
Closing of the
Hardware Gate

Counter status
1 2 3 4
Count pulses 4

9 Input 1I0
Open gate Close gate

Figure 9-4 Level-Controlled Opening and Closing of the Hardware Gate of Counter 1

As long as input 1I0 is set, the count signals can reach counter 1 and be
counted. If you remove input 1I0, the gate is closed. The count pulses are no
longer counted and counter 1 remains stopped.
If the gate of counter 1 is closed by an overflow or underflow, you must first
reset input 1I0 and apply a positive edge to input 1I0 in order to open the
gate again.

FM 450-1 Counter Function Module


9-16 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

Edge-Controlled Figure 9-5 shows edge-controlled opening and closing of the hardware gate
Opening and of counter 1.
Closing of the
Hardware Gate

Counter status
1 2 3 4
Count pulses 4

Input 1I0
Open gate

Input 1I1
Close gate

Figure 9-5 Edge-Controlled Opening and Closing of the Hardware Gate of Counter 1

In the case of the edge-controlled gate function, the hardware gate of counter
1 is opened by a positive edge at input 1I0. The gate is closed by a positive
edge at input 1I1.
In the event of positive edges occurring simultaneously at inputs 1I0 and 1I1,
an opened gate is closed or a closed gate remains closed. If input 1I1 is set, a
positive edge at input 1I0 cannot open the gate.
The same applies analogously for counter 2 (inputs 2I0 and 2I1).

Status of Inputs The status of the inputs 1I0 (2I0) and 1I1 (2I1) are indicated by the green 9
1I0 (2I0) and LEDs CH1 IN 0 (CH 2 IN 0) and CH 1 IN 1 (CH 2 IN 1) and within the user
1I1 (2I1) program in bit STS_STA and STS_STP of the DB of the FC CNT_CTRL.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-17
Operating Modes, Settings, Parameters and Commands

Opening and Figure 9-6 shows opening and closing of the software gate of counter 1.
Closing the
Software Gate

Counter status
1 2 3 4
Count pulses 4

SW_GATE
Bit set Bit reset

Figure 9-6 Opening and Closing of the Software Gate

The software gate is opened and closed by setting and resetting the
SW_GATE input parameter of the FC CNT_CTRL.
The closed gate can be opened again by setting the SW_GATE input parame-
ter again.

Status of the The status of the software gate is indicated in bit STS_SW_G of the DB of
Software Gate the FC CNT_CTRL.

9 Terminating the
Count with the
You can also terminate the count with the gate stop function of the relevant
counter regardless of the signals applied or the status of the software gate.
Gate Stop For this purpose, set the GATE_STP input parameter of the FC_CNT_CTRL.
Function
If you reset this parameter, you can only open the gate for the relevant
counter again by a positive edge either at input 1I0 or 2I0 (hardware gate) or
by setting the SW_GATE (software gate) input parameter again.

Process Interrupt Opening and closing of a gate (hardware or software) can be used to initiate a
process interrupt (see Chapter 9.11).

Default Setting In the default setting, all gates are open and the count pulses are counted.

FM 450-1 Counter Function Module


9-18 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

9.10 Command: Set Counter

Introduction If you want to start or continue the count from a specific value (the load
value), you must parameterize the signal that is to be used to set this counter
to the load value. You can set the counter as follows:
S With the L_DIRECT input parameter of the FC_CNT_CTRL
S With an external signal either via input 1I2 (2I2) or via the input in con-
junction with the zero mark of the encoder.
This section describes the different methods and the time sequence when set-
ting a counter.

Load Value For the load value of a counter, you can parameterize a number within the
count limits of the count mode.
The load value is interpreted in accordance with the count mode selected.
If you specify FFFF FFFF H as the load value, for example, the number is
interpreted as 4,294,967,295 in 32 bit mode, and as –1 in +31 bit mode.
The load value is entered in the DB of the FC CNT_CTRL.

Setting the You can set a counter with the FC CNT_CTRL using the L_DIRECT input
Counter via the parameter regardless of external events. This can also be done while a count
User Program is in progress.
If you set the counter via the FC_CNT_CTRL call, this can initiate a process
interrupt.
9

Setting the You can select two different external signals with which you can set a
Counter with an counter to the load value.
External Signal
S Input 1I2 (2I2) only
S Input 1I2 (2I2) and zero mark of the encoder
You use the zero mark of the encoder if you want to synchronize the counter
to a specific counter status at a specific point in your process. This achieves
greater accuracy in the count.
The counter is set independently of the operating mode.
After the counter has been set with an external signal, bit STS_SYNC in the
DB is set.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-19
Operating Modes, Settings, Parameters and Commands

Note
Synchronization of a counter with zero mark only makes sense if the gate is
open.
If you have only enabled one count direction when setting a counter with an
external signal, you must note that when the gate is closed the current count
direction is saved (frozen). This enables synchronization of the counter
against the enabled count direction.

Process Interrupt Setting the counter with an external signal can be used to initiate a process
interrupt.

Setting the A counter can be set with the load value via a rising edge at input 1I2 (2I2).
Counter with Input
You can determine the behavior of a counter of the FM 450-1 in the case of a
1I2 (2I2)
positive edge at input 1I2 (2I2) via the ENSET_UP and ENSET_DN vari-
ables in the DB of the FC CNT_CTRL and via parameterization.

Bit Behavior of the FM 450-1


ENSET_UP set The counter is only set in the case of up counting
ENSET_DN set The counter is only set in the case of down counting
ENSET_UP and EN- The counter is set in the case of up and down counting
9 SET_DN set
Parameterization Behavior of the FM 450-1
Parameterization ‘Single The counter is set only at the first rising edge at input 1I2
setting of counter’ (2I2).
If the counter is to be set again, you must first set EN-
SET_UP or ENSET_DN again. The counter is then set
again with the next positive edge at input 1I2 (2I2).
‘Multiple setting of The counter is set at every rising edge at input 1I2 (2I2) as
counter’ parameter long as ENSET_UP and/or ENSET_DN are set.

Note
You must always set one of the two variables ENSET_UP and/or EN-
SET_DN so that the relevant counter can be set via input 1I2 (2I2).

FM 450-1 Counter Function Module


9-20 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

Single Setting with Figure 9-7 shows single setting of counter 1 with input 1I2. The same applies
Input 1I2 (2I2) for counter 2 with input 2I2. In the situation represented, only ENSET_UP is
set, that is, the counter is set in the case of up counting.
With the first rising edge at input 1I2, the relevant counter is set as long as
ENSET_UP is set. If you want to reset this counter you must first reset the
relevant ENSET_UP and set it again. The next positive edge at input 1I2 then
results in the setting of the counter.

Count pulses

Input 1I2

ENSET_UP

Counter set Counter not set Counter not set Counter set

Figure 9-7 Single Setting of Counter 1 with Input 1I2

Multiple Setting Figure 9-8 shows multiple setting of counter 1 with input 1I2. The same ap-
with Input 1I2 (2I2) plies for counter 2 with input 2I2. In the situation represented, only EN-
SET_UP is set, that is, the counter is set in the case of up counting. 9
With every rising edge at input 1I2, the relevant counter is set as long as EN-
SET_UP is set. If you reset ENSET_UP, the counter will not be set by input
1I2. Only when you have set ENSET_UP again, will the next positive edge at
input 1I2 result in the setting of the counter.

Count pulses

Input 1I2

ENSET_UP

Counter set Counter set Counter not set Counter set

Figure 9-8 Multiple Setting of Counter 1 with Input 1I2

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-21
Operating Modes, Settings, Parameters and Commands

Setting the If you parameterize setting of a counter with the zero mark of the encoder,
Counter with the the relevant counter will be set with the rising edge of the zero mark.
Zero Mark
Setting is only carried out if input 1I2 (2I2) of the relevant counter is set at
the time of the rising edge of the zero mark.
You can determine the behavior of a counter of the FM 450-1 in the case of a
rising edge of the zero mark via the ENSET_UP and ENSET_DN variables
in the DB of the FC CNT_CTRL and via parameterization.

Parameterization Behavior of the Counter of the FM 450-1


ENSET_UP set The counter is only set in the case of up counting
ENSET_DN set The counter is only set in the case of down counting
ENSET_UP and EN- The counter is set in the case of up and down counting
SET_DN set
Parameterization Behavior of the Counter of the FM 450-1
Parameterization ‘Single The counter is set only at the first rising of the zero mark.
setting of counter’ If the counter is to be set again, you must first set EN-
SET_UP or ENSET_DN again (edge evaluation). The
counter is then set again with the next rising edge of the
zero mark.
Parameterization ‘Multi- The counter is set at every rising edge of the zero mark as
ple setting of counter’ long as ENSET_UP and/or ENSET_DN are set.

9 Note
You must always set one of the two variables ENSET_UP and/or EN-
SET_DN and input 1I2 (2I2) so that the relevant counter can be set with the
zero mark.

Single Setting with Figure 9-9 shows single setting of counter 1 with the zero mark. In the situa-
Zero Mark tion represented, only ENSET_UP is set, that is, the counter is set in the case
of up counting.
With the first rising edge at input 1I2, the relevant counter is set as long as
ENSET_UP and input 1I2 are set.
If you want to set counter 1 again, you must reset ENSET_UP and then set it
again. If input 1I2 is not set, setting takes place with the first zero mark after
setting of 1I2. If input 1I2 is set, setting takes place with the next zero mark.
The same applies for counter 2 with input 2I2.

FM 450-1 Counter Function Module


9-22 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

Count pulses

Zero mark

Input 1I2

ENSET_UP

Counter set Counter Counter Counter Counter Counter set


not set not set not set not set

Figure 9-9 Single Setting of Counter 1 with the Zero Mark

Multiple Setting Figure 9-10 shows multiple setting of counter 1 with the zero mark. In the
with the Zero Mark situation represented, only ENSET_UP is set, that is, the counter is set in the
case of up counting.
With every rising edge of the zero mark, the counter is set as long as EN-
SET_UP and input 1I2 are set.
The same applies for counter 2 with input 2I2.
9
Count pulses

Zero mark

Input 1I2

ENSET_UP

Counter set Counter set Counter Counter set Counter Counter set
not set not set

Figure 9-10 Multiple Setting of Counter 1 with the Zero Mark

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-23
Operating Modes, Settings, Parameters and Commands

9.11 Initiating a Process Interrupt

Introduction For the individual counters of the FM 450-1, you can set which events are to
initiate a process interrupt. For this purpose, parameterize the counter inter-
rupts in the parameter assignment screen forms.

What is a Process If you want to program a response to a specific event independently of the
Interrupt CPU cycle, each counter of the FM 450-1 can initiate a process interrupt. The
CPU interrupts the cyclic program on receiving the interrupts and executes
the process interrupt OB.

Which Events Can The following events in counter operation of the FM 450-1 can initiate a pro-
Initiate a Process cess interrupt (for each of the two counters independently of the other):
Interrupt?
S Opening of the gate (in the operating modes with hardware or software
gate)
S Closing of the gate (in the operating modes with hardware or software
gate)
S Overflow
S Underflow
S Reaching comparison value 1 in the up direction
S Reaching comparison value 1 in the down direction
9 S Reaching comparison value 2 in the up direction
S Reaching comparison value 2 in the down direction
S Zero pass
S Setting the counter with an external signal
You can select any number of events for process interrupt initiation, provided
the marginal conditions are observed.

Enabling the You enable the interrupts for the module in the parameter assignment screen
Process Interrupt forms when configuring the hardware and you decide whether the module is
to initiate a diagnostics interrupt and/or a process interrupt.

Process Interrupt If a process interrupt occurs, the user program is interrupted, the data is trans-
OB, OB 4x ferred from the module to the start information of OB4x and OB4x is called.
The process interrupt is acknowledged by exiting OB4x.
If there is no OB4x programmed, the CPU goes to STOP. If you then switch
back to RUN, the process interrupt requirements are deleted.

FM 450-1 Counter Function Module


9-24 C79000-G7076-C450-01
Operating Modes, Settings, Parameters and Commands

Start Information The temporary variable OB4x_POINT_ADDR is written in the start informa-
tion of OB4x.
The variable OB4x_POINT_ADDR (bytes 8 to 11) consists of four bytes.
The information concerning the event that has initiated the process interrupt
is entered in these four bytes. The table below shows which bits are set for
which interrupt. All unlisted bits are not significant and are set at zero.

Byte Bit Meaning: Interrupt in the Case of...


Counter 1
0 0 Opening the gate
1 Closing the gate
2 Overflow
3 Underflow
4 Reaching comparison value 1 in the up direction
5 Reaching comparison value 1 in the down direction
6 Reaching comparison value 2 in the up direction
7 Reaching comparison value 2 in the down direction
1 0 Zero pass
5 Setting the counter
Counter 2
2 0 Opening the gate
1
2
Closing the gate
Overflow
9
3 Underflow
4 Reaching comparison value 1 in the up direction
5 Reaching comparison value 1 in the down direction
6 Reaching comparison value 2 in the up direction
7 Reaching comparison value 2 in the down direction
3 0 Zero pass
5 Setting the counter

Lost Process If an event occurs that is to initiate a process interrupt and the same previous
Interrupt event has not yet been acknowledged, no further process interrupt is initiated;
the process interrupt is lost.
This can result in the diagnostics interrupt ‘Process interrupt lost’ depending
on the parameterization.

Default Setting No process interrupt is parameterized in the default setting.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 9-25
Operating Modes, Settings, Parameters and Commands

FM 450-1 Counter Function Module


9-26 C79000-G7076-C450-01
Encoder Signals and Their Evaluation 10
This Chapter... This chapter describes the following:
S The encoders you can connect to the counters of the FM 450-1.
S The time sequence of the signals of the different encoders.
S How the counters of the FM 450-1 can perform multiple evaluations of
the encoder signals.
S How the module monitors the different encoder signals.
S The signals for which you can parameterize input filters.

Chapter Section Contents Page


Overview 10.1 Overview 10-2
10.2 5 V Differential Signals 10-3
10.3 24 V Signals 10-4
10.4 Pulse Evaluation 10-6

FM 450-1 Counter Function Module


C79000-G7076-C450-01 10-1
Encoder Signals and Their Evaluation

10.1 Overview

Introduction The count signals that the counters of the FM 450-1 can process are rectangu-
lar signals generated either by incremental encoders or pulse encoders.
Incremental encoders scan a grating and so generate rectangular electrical
pulses. They differ in pulse height and in the number of signals.
Pulse encoders such as light barriers or initiators (BEROs) supply only a rect-
angular signal with a specific voltage level.

Connecting You can connect different encoders to the counters of the FM 450-1 for sup-
Different Encoders plying the pulses for the count signals. Table 10-1 gives an overview of the
different encoders and the corresponding signals.

Table 10-1 Encoders for the FM 450-1

Encoder Signal
Incremental 5 V encoder Differential signals A, A, B, B and N, N
Incremental 24 V encoder A*, B* and N*
24 V pulse encoder 24 V with direction level
24 V pulse encoder 24 V without direction level

10

FM 450-1 Counter Function Module


10-2 C79000-G7076-C450-01
Encoder Signals and Their Evaluation

10.2 5 V Differential Signals

Incremental The incremental 5 V encoder supplies the differential signals A, A, B, B and


5 V Encoder N, N to the module in accordance with RS 422, where the signals A, B and N
are the inverted signals of A, B and N. The signals A and B are phase-shifted
by 90° each.
In the case of the incremental 5 V encoder, tracks A and B are used for
counting. Track N is used for setting the counter to the load value if parame-
terized accordingly (set counter with zero mark).
Encoders with these six signals are known as symmetric encoders.
Figure 10-1 shows the time sequence of these signals.

Signal A
Signal A

Signal B
Signal B

Signal N
Signal N
Direction of count Up Down

Figure 10-1 Signals of the Incremental 5 V encoder

The module recognizes the direction of count from the ratio of signal A to B.
The figures in the next section (‘Pulse Evaluation’) show which edges of sig-
nals A and B are counted in the down or up direction.
10
Changing the You can change the signals B and B via parameterization and so change the
Count Direction count direction without having to change the wiring.

How are the The module monitors for cable connection and for wirebreak or short-circuit.
Signals
Via parameterization, you can determine which of the three signal pairs are
Monitored?
monitored. You therefore need not wire unused signals if diagnostics for this
signal pair has been switched off via parameterization (set counter with zero
mark).
If all three signals report errors, either the encoder is defective, there is a
short-circuit in the 5.2 VDC encoder supply or there is no encoder connected.
If the module detects an error after you have assigned your parameters, an
entry is made in the diagnostics data sets DS0 and DS1. This can result in a
diagnostics interrupt if the relevant parameters have been assigned.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 10-3
Encoder Signals and Their Evaluation

10.3 24 V Signals

24 V Incremental The incremental 24 V encoder supplies the signals A*, B* and N* in the
Encoder same time ratio as the signals A, B and N in the case of the 5 V incremental
encoder. Signals with a voltage of 24 V are indicated with an asterisk (*).
The signals A* and B* are phase-shifted by 90° each.
Encoders that do not supply inverse signals are known as asymmetric encod-
ers.
In the case of the inputs of 24 V encoder signals, you decide via parameter-
ization whether you connect source outputs or sink outputs to the counters.
See the encoder description for further information on this point.
You can also change the count direction via the ‘Invert, not invert’ parameter
in the same way as for the incremental 5 V encoder.

24 V Pulse The encoder, for example an initiator (BERO) or a light barrier, supplies only
Encoder one count signal that must be connected to terminal A* of the front connec-
Without/With tor.
Direction Level
Additionally to this, you can connect a signal for direction detection to termi-
nal B*. If your encoder does not supply a corresponding signal, you can gen-
erate and connect a corresponding ID within the S7 or you can use a corre-
sponding process signal.
Figure 10-2 shows the sequence over time of the signals of a 24 V pulse en-
coder with direction level and the resulting count pulses.

10 Signal A*

Signal B * as Down
direction
Up
level

Up count
pulses

Down count
pulses

Figure 10-2 Signals of a 24 V Pulse Encoder with Direction Level

The count direction is defined via the parameterization of the encoder inputs.
Table 10-2 shows how the count direction changes in dependence on the in-
put parameterization.

FM 450-1 Counter Function Module


10-4 C79000-G7076-C450-01
Encoder Signals and Their Evaluation

Table 10-2 Count Direction in Dependence on the Input Parameterization

Input Parameterization Terminal B* Count Direction


Current sourcing Unswitched Up
24 V connected Down
Current sinking Unswitched Down
Short-circuited to ground Up

When selecting the encoder, you must select the ‘Frequency and direction’
parameter.
Changing direction by inverting the B* signal is not possible with these count
signals.

Note
With this type of evaluation, the count value in the case of an oscillating
count signal can ‘run away’ at the edge since all the signals are added to-
gether.

Input Filters for To suppress interference, you can parameterize input filters (RC elements)
24 V Count Inputs with a uniform filter time for the 24 V inputs A*, B* and N* and for the digi-
tal inputs. The following two input filters are available:

Table 10-3 Input Filters

Features Input Filter 1


(Default)
Input Filter 2 10
Typical input delay 1 s 15 s
Maximum count frequency 200 kHz 20 kHz
Minimum pulse width of the count sig- 2.5 s 25 s
nals

How are the 24 V count signals are not monitored for wirebreak or short-circuit.
Signals
Monitored?

FM 450-1 Counter Function Module


C79000-G7076-C450-01 10-5
Encoder Signals and Their Evaluation

10.4 Pulse Evaluation

Introduction The counters of the FM 450-1 can count the edges of the signals. Normally,
the edge at A (A*) is evaluated (single evaluation). To achieve a higher reso-
lution, you can decide via parameterization whether the signals are to have
single, double or quadruple evaluation.
Multiple evaluation is only possible in the case of incremental 5 V encoders
with signals A and B displaced by 90°, or in the case of incremental 24 V
encoders with signals A* and B* displaced by 90°.

Single Evaluation Single evaluation means that only one edge of A is evaluated; up count
pulses are captured on a rising edge of A and low level at B, and down count
pulses are captured on a falling edge of A and low level at B.
Figure 10-3 shows single evaluation of the signals.

Signal A (A*)

Signal B (B*)

Up count
pulses
Down count
pulses
Up Down

Figure 10-3 Single Evaluation


10
Double Evaluation Double evaluation means that the rising and falling edge of signal A are eva-
luated; whether up or down count pulses are generated depends on the level
of signal B.
Figure 10-4 shows double evaluation of the signals.

Signal A (A*)

Signal B (B*)

Up count
pulses
Down count
pulses
Up Down

Figure 10-4 Double Evaluation

FM 450-1 Counter Function Module


10-6 C79000-G7076-C450-01
Encoder Signals and Their Evaluation

Quadruple Quadruple evaluation means that the rising and falling edges of A and B are
Evaluation evaluated; whether up or down count pulses are generated, depends on the
levels of signals A and B.
Figure 10-5 shows quadruple evaluation of signals.

Signal A (A*)

Signal B (B*)

Up count
pulses

Down count
pulses Up Down

Figure 10-5 Quadruple Evaluation

Default Value Single evaluation is set as the default.

10

FM 450-1 Counter Function Module


C79000-G7076-C450-01 10-7
Encoder Signals and Their Evaluation

10

FM 450-1 Counter Function Module


10-8 C79000-G7076-C450-01
DB Assignments 11
DB for the All data belonging to one channel of the module are stored in the DB of the
FC CNT_CTRL FC CNT_CTRL. The data structure and the length of the DB are defined by
the variable declaration in the FC CNT_CTRL. Before the module is parame-
terized, the DB must be assigned the following valid data (see Chapter 6):
S Module address (address 6.0)
S Channel starting address (address 8.0)
S User data length (address 12.0)
The DB has been generated from the UDT 1 as a data block with the
associated user-specific data type (see Chapter 6). The DB assignments re-
sulting from this are shown below. The variables in the DB that you must/can
enter or read out while working with the FM 450-1 are shaded gray in
Table 11-1.

Table 11-1 DB Assignments

Address Variable Data Type Initial Comments


Value
0.0 AR1_BUFFER DWORD DW#16#0 AR1 buffer
4.0 FP BYTE B#16#0 Flag byte
5.0 RESERVED BYTE B#16#0 Reserved
6.0 MOD_ADR WORD W#16#0 Module address
8.0 CH_ADR DWORD DW#16#0 Channel address
12.0 U_D_LGTH BYTE B#16#0 User data length
13.0 A_BYTE_0 BYTE B#16#0 Reserved
14.0 LOAD_VAL DINT L#0 New load value (write user)
18.0 CMP_V1 DINT L#0 New comparison value 1 (write user)
22.0 CMP_V2 DINT L#0 New comparison value 2 (write user)

FM 450-1 Counter Function Module


C79000-G7076-C450-01 11-1
DB Assignments

Table 11-1 DB Assignments, Continued

Address Variable Data Type Initial Comments


Value
26.0 A_BIT0_0 BOOL FALSE Reserved
26.1 TFB BOOL FALSE Test free
26.2 A_BIT0_2 BOOL FALSE Reserved
26.3 A_BIT0_3 BOOL FALSE Reserved
26.4 A_BIT0_4 BOOL FALSE Reserved
26.5 A_BIT0_5 BOOL FALSE Reserved
26.6 A_BIT0_6 BOOL FALSE Reserved
26.7 A_BIT0_7 BOOL FALSE Reserved
27.0 ENSET_UP BOOL FALSE Enable setting in up direction (write user)
27.1 ENSET_DN BOOL FALSE Enable setting in down direction (write user)
27.2 A_BIT1_2 BOOL FALSE Reserved
27.3 A_BIT1_3 BOOL FALSE Reserved
27.4 A_BIT1_4 BOOL FALSE Reserved
27.5 A_BIT1_5 BOOL FALSE Reserved
27.6 A_BIT1_6 BOOL FALSE Reserved
27.7 A_BIT1_7 BOOL FALSE Reserved
28.0 CTRL_DQ0 BOOL FALSE Monitor digital output DQ0 (write user)
28.1 CTRL_DQ1 BOOL FALSE Monitor digital output DQ1 (write user)
28.2 A_BIT2_2 BOOL FALSE Reserved
28.3 A_BIT2_3 BOOL FALSE Reserved
28.4 A_BIT2_4 BOOL FALSE Reserved
28.5 A_BIT2_5 BOOL FALSE Reserved
11 28.6 A_BIT2_6 BOOL FALSE Reserved
28.7 A_BIT2_7 BOOL FALSE Reserved
29.0 A_BIT3_0 BOOL FALSE Reserved
29.1 A_BIT3_1 BOOL FALSE Reserved
29.2 A_BIT3_2 BOOL FALSE Reserved
29.3 A_BIT3_3 BOOL FALSE Reserved
29.4 A_BIT3_4 BOOL FALSE Reserved
29.5 A_BIT3_5 BOOL FALSE Reserved
29.6 A_BIT3_6 BOOL FALSE Reserved
29.7 A_BIT3_7 BOOL FALSE Reserved

FM 450-1 Counter Function Module


11-2 C79000-G7076-C450-01
DB Assignments

Table 11-1 DB Assignments, Continued

Address Variable Data Type Initial Comments


Value
30.0 ACT_LOAD DINT L#0 Current load value (read user)
34.0 ACT_CNTV DINT L#0 Current count value (read user)
38.0 DA_ERR_W WORD W#16#0 Data error word (read user)
40.0 OT_ERR_B BYTE B#16#0 Operator error byte (read user)
41.0 E_BIT0_0 BOOL FALSE Reserved
41.1 STS_TFB BOOL FALSE Status test free
41.2 E_BIT0_2 BOOL FALSE Reserved
41.3 E_BIT0_3 BOOL FALSE Reserved
41.4 DATA_ERR BOOL FALSE Data error bit (read user)
41.5 E_BIT0_5 BOOL FALSE Reserved
41.6 E_BIT0_6 BOOL FALSE Reserved
41.7 PARA BOOL FALSE Module parameterized (read user)
42.0 E_BYTE_0 BYTE B#16#0 Reserved
43.0 STS_RUN BOOL FALSE Status counter working
43.1 STS_DIR BOOL FALSE Status count direction (read user)
43.2 STS_ZERO BOOL FALSE Status zero pass (read user)
43.3 STS_OFLW BOOL FALSE Status overflow (read user)
43.4 STS_UFLW BOOL FALSE Status underflow (read user)
43.5 STS_SYNC BOOL FALSE Status counter synchronized (read user)
43.6 STS_GATE BOOL FALSE Status internal gate (read user)
43.7 STS_SW_G BOOL FALSE Status software gate (read user)

11

FM 450-1 Counter Function Module


C79000-G7076-C450-01 11-3
DB Assignments

Table 11-1 DB Assignments, Continued

Address Variable Data Type Initial Comments


Value
44.0 STS_SET BOOL FALSE Status digital input SET (read user)
44.1 E_BIT2_1 BOOL FALSE Reserved
44.2 STS_STA BOOL FALSE Status digital input START (read user)
44.3 STS_STP BOOL FALSE Status digital input STOP (read user)
44.4 STS_CMP1 BOOL FALSE Status output comparison value 1 (read user)
44.5 STS_CMP2 BOOL FALSE Status output comparison value 2 (read user)
44.6 E_BIT2_6 BOOL FALSE Reserved
44.7 E_BIT2_7 BOOL FALSE Reserved
45.0 E_BIT3_0 BOOL FALSE Reserved
45.1 E_BIT3_1 BOOL FALSE Reserved
45.2 E_BIT3_2 BOOL FALSE Reserved
45.3 E_BIT3_3 BOOL FALSE Reserved
45.4 E_BIT3_4 BOOL FALSE Reserved
45.5 E_BIT3_5 BOOL FALSE Reserved
45.6 E_BIT3_6 BOOL FALSE Reserved
45.7 E_BIT3_7 BOOL FALSE Reserved
46.0 ACT_CMP1 DINT L#0 Current comparison value 1 (read user)
50.0 ACT_CMP2 DINT L#0 Current comparison value 2 (read user)
The following diagnostics data are entered by the FC DIAG_INF
54.0 MALFUNC BOOL FALSE Module fault
54.1 MALF_INT BOOL FALSE Internal fault
54.2 MALF_EXT BOOL FALSE External fault
11 54.3 MALF_CHA BOOL FALSE Channel fault
54.4 MALF_AUX BOOL FALSE Auxiliary voltage fault
54.5 FRONTCON BOOL FALSE Front connector
54.6 MIS_PARA BOOL FALSE Missing parameters
54.7 WRG_PARA BOOL FALSE Wrong parameters

FM 450-1 Counter Function Module


11-4 C79000-G7076-C450-01
DB Assignments

Table 11-1 DB Assignments, Continued

Address Variable Data Type Initial Comments


Value
55.0 D_BIT1_0 BOOL FALSE DS1 byte 1 bit 0
55.1 D_BIT1_1 BOOL FALSE DS1 byte 1 bit 1
55.2 D_BIT1_2 BOOL FALSE DS1 byte 1 bit 2
55.3 D_BIT1_3 BOOL FALSE DS1 byte 1 bit 3
55.4 CH_INFO BOOL FALSE Channel information
55.5 MOD_INFO BOOL FALSE Module information
55.6 D_BIT1_6 BOOL FALSE DS1 byte 1 bit 6
55.7 D_BIT1_7 BOOL FALSE DS1 byte 1 bit 7
56.0 INTF_MOD BOOL FALSE Wrong/missing interface submodule
56.1 COMM_ERR BOOL FALSE Communications error
56.2 RUN_STOP BOOL FALSE RUN/STOP operating status indicator
56.3 WATCHDOG BOOL FALSE Watchdog (FM)
56.4 POW_INT BOOL FALSE Fault in internal power supply
56.5 BATTERY BOOL FALSE Battery monitor
56.6 BACKUP BOOL FALSE Backup fault
56.7 D_BIT2_7 BOOL FALSE DS1 byte 2 bit 7
57.0 RACK_FLT BOOL FALSE Mounting rack fault
57.1 PROC_FLT BOOL FALSE CPU fault
57.2 EPROM BOOL FALSE EPROM fault
57.3 RAM_FLT BOOL FALSE RAM fault
57.4 ADU_DAU BOOL FALSE ADC/DAC fault
57.5 FUSE_TRP BOOL FALSE Fuse
57.6 PROC_I BOOL FALSE Process interrupt lost
11
57.7 D_BIT3_7 BOOL FALSE DS1 byte 3 bit 7
58.0 CH_TYPE BYTE B#16#0 Channel type
59.0 LGTH_DIA BYTE B#16#0 Diagnostics data length per channel
60.0 CH_NO BYTE B#16#0 Channel number

FM 450-1 Counter Function Module


C79000-G7076-C450-01 11-5
DB Assignments

Table 11-1 DB Assignments, Continued

Address Variable Data Type Initial Comments


Value
61.0 GRP_ERR1 BOOL FALSE Group error channel 1
61.1 GRP_ERR2 BOOL FALSE Group error channel 2
61.2 D_BIT7_2 BOOL FALSE DS1 byte 7 bit 2
61.3 D_BIT7_3 BOOL FALSE DS1 byte 7 bit 3
61.4 D_BIT7_4 BOOL FALSE DS1 byte 7 bit 4
61.5 D_BIT7_5 BOOL FALSE DS1 byte 7 bit 5
61.6 D_BIT7_6 BOOL FALSE DS1 byte 7 bit 6
61.7 D_BIT7_7 BOOL FALSE DS1 byte 7 bit 7
62.0 CH1_SIGA BOOL FALSE Channel 1, error signal A
62.1 CH1_SIGB BOOL FALSE Channel 1, error signal B
62.2 CH1_SIGZ BOOL FALSE Channel 1, error signal zero
62.3 CH1_BETW BOOL FALSE Channel 1, error between channels
62.4 CH1_5V2 BOOL FALSE Channel 1, error in 5.2 V encoder supply
62.5 D_BIT8_5 BOOL FALSE DS1 byte 8 bit 5
62.6 D_BIT8_6 BOOL FALSE DS1 byte 8 bit 6
62.7 D_BIT8_7 BOOL FALSE DS1 byte 8 bit 7
63.0 D_BYTE9 BYTE B#16#0 DS1 byte 9
64.0 CH2_SIGA BOOL FALSE Channel 2, error signal A
64.1 CH2_SIGB BOOL FALSE Channel 2, error signal B
64.2 CH2_SIGZ BOOL FALSE Channel 2, error signal zero
64.3 CH2_BETW BOOL FALSE Channel 2, error between channels
64.4 CH2_5V2 BOOL FALSE Channel 2, error in 5.2 V encoder supply
11 64.5 D_BIT10_5 BOOL FALSE DS1 byte 10 bit 5
64.6 D_BIT10_6 BOOL FALSE DS1 byte 10 bit 6
64.7 D_BIT10_7 BOOL FALSE DS1 byte 10 bit 7
65.0 D_BYTE11 BYTE B#16#0 DS1 byte 11
66.0 FP_BYTE BYTE B#16#0 1 L-byte reserved

FM 450-1 Counter Function Module


11-6 C79000-G7076-C450-01
M7 Reference Counter Function Library 12
This Chapter... This chapter contains the descriptions of the functions in alphabetical order
as well as the data structures and error codes. It is designed as a reference
chapter.

Chapter Section Contents ÁÁÁÁÁÁÁÁÁ


ÁÁÁÁÁÁÁÁÁ
Description Page

ÁÁÁÁÁÁÁÁÁ
Overview 12.1 M7CntDisableOut Disable outputs 12-2
12.2
12.3
M7CntDisableSet
M7CntEnableOut ÁÁÁÁÁÁÁÁÁ
Disable SET input

ÁÁÁÁÁÁÁÁÁ
Enable outputs
12-3
12-4
12.4
12.5
M7CntEnableSet
M7CntInit ÁÁÁÁÁÁÁÁÁ
Enable SET input

ÁÁÁÁÁÁÁÁÁ
Initialize counter channel
12-5
12-6
12.6
12.7
M7CntLoadAndStart
M7CntLoadComp
ÁÁÁÁÁÁÁÁÁ
Load and start counter channel

ÁÁÁÁÁÁÁÁÁ
Transfer comparison values
12-8
12-9
12.8 M7CntLoadDirect
ÁÁÁÁÁÁÁÁÁ
Load counter channel

ÁÁÁÁÁÁÁÁÁ
12-11

ÁÁÁÁÁÁÁÁÁ
12.9 M7CntLoadPrep Prepare loading 12-12

ÁÁÁÁÁÁÁÁÁ
12.10 M7CntPar Parameterize counter channel 12-13

ÁÁÁÁÁÁÁÁÁ
12.11 M7CntRead Read counter value 12-15

ÁÁÁÁÁÁÁÁÁ
12.12 M7CntReadDiag Read diagnostics information 12-16

ÁÁÁÁÁÁÁÁÁ
12.13 M7CntReadLoadValue Read load value 12-17

ÁÁÁÁÁÁÁÁÁ
12.14 M7CntReadParError Read parameterization error 12-18

ÁÁÁÁÁÁÁÁÁ
12.15 M7CntReadStatus Read counter status 12-19
12.16
12.17
M7CntResetStatus
M7CntStart ÁÁÁÁÁÁÁÁÁ
Reset counter status

ÁÁÁÁÁÁÁÁÁ
Start counter channel
12-20
12-21
12.18 M7CntStop
ÁÁÁÁÁÁÁÁÁ
Stop counter channel 12-22
12.19

12.20
M7CntStopAndRead

M7CNT_DIAGINFO
ÁÁÁÁÁÁÁÁÁ
Stop counter channel and read

ÁÁÁÁÁÁÁÁÁ
counter value
Contains diagnostics informa-
12-23

12-24
tion
12.21 M7CNT_PARAM Contains parameterization data 12-25
12.22 M7CNT_STATUS Contains status information 12-28
12.23 Error codes Error messages 12-29

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-1
M7 Reference Counter Function Library

12.1 M7CntDisableOut

Function Disable outputs

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntDisableOut(
M7CNT_LOGCHANNEL LogChannel,
BOOL SelOut0,
BOOL SelOut1);

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁ
SelOut0
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelOut1
ÁÁÁÁÁÁÁÁÁÁÁÁ
Selection bit for output 0
Selection bit for output 1

Description The two outputs of the counter channel can be disabled with this function.
The two bits SelOut0 and SelOut1 define which of the two outputs is to be
disabled. To disable an output, the desired bit must be set (= TRUE) when
the function is called. Both outputs can also be disabled in just one function
call. If the bit of an output = FALSE, the status of the output will not be
changed: an enabled output remains enabled and a disabled output remains
disabled.
Default: both outputs are disabled.

Return Value 0 The function has been executed successfully


00 An error has occurred

12 Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntEnableOut

FM 450-1 Counter Function Module


12-2 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.2 M7CntDisableSet

Function Disable SET input

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntDisableSet(
M7CNT_LOGCHANNEL LogChannel,
BOOL SelSetUp,
BOOL SelSetDn):

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelSetUp

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelSetDn
Disable SET input for up count direction
Disable SET input for down count direc-

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
tion

Description The SET digital input for setting each counter channel is disabled with this
function. The two bits SelSetUp (up) and SelSetDn (down) determine for
which count direction the SET input is to be disabled. To implement the dis-
able function, the desired bit must be set (= TRUE) when the function is
called. Both count directions can also be disabled with just one function call
(SelSetUp = TRUE and SelSetDn = TRUE). If the bit of a count direction =
FALSE, the status of the SET input is not changed: an enabled SET input
remains enabled and a disabled SET input remains disabled.
Default: the SET input is disabled in both directions.

Return Value 0 The function has been executed successfully


00 An error has occurred
12
Error Code Meaning
M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntEnableSet

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-3
M7 Reference Counter Function Library

12.3 M7CntEnableOut

Function Enable outputs

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntEnableOut (
M7CNT_LOGCHANNEL LogChannel,
BOOL SelOut0,
BOOL SelOut1);

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁ
SelOut0
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelOut1
ÁÁÁÁÁÁÁÁÁÁÁÁ
Selection bit for output 0
Selection bit for output 1

Description The two outputs of the counter channel in each case can be enabled with this
function. The two bits SelOut0 and SelOut1 (down) determine which of the
two outputs is to be enabled. To enable an output, the desired bit must be set
(= TRUE) when the function is called. Both outputs can also be enabled with
just one function call. If the bit of an output = FALSE, the status of the out-
put is not changed: an enabled output remains enabled and a disabled output
remains disabled.
Default: both outputs are disabled

Return Value 0 The function has been executed successfully


00 An error has occurred

12 Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntDisableOut

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
if ((Err = M7CntEnableOut (Ch5, TRUE, TRUE)) != M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


12-4 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.4 M7CntEnableSet

Function Enable SET input

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntEnableSet(
M7CNT_LOGCHANNEL LogChannel,
BOOL SelSetUp,
BOOL SelSetDn)

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelSetUp

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelSetDn
Enable SET input for up count direction
Enable SET input for down count direc-

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
tion

Description The SET digital input for setting the counter channel in each case is enabled
with this function. The two bits SelSetUp (up) and SelSetDn (down) deter-
mine for which count direction the SET input is to be enabled. To implement
the enable function, the desired bit must be set (= TRUE) when the function
is called. Both count directions can also be enabled with just one function
call (SelSetUp = TRUE and SelSetDn = TRUE). If the bit of a count direction
= FALSE, the status of the SET input is not changed: an enabled SET input
remains enabled and a disabled SET input remains disabled.
The actual ‘setting’ of the counter channel is carried out, depending on para-
meterization, either with the rising edge at the SET input or with the zero
mark signal with simultaneously active SET signal.
Default: the SET input is disabled in both directions.
12
Return Value 0 The function has been executed successfully
00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntEnableSet

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-5
M7 Reference Counter Function Library

12.5 M7CntInit

Function Initialize counter channel

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntInit(
M7IO_BASEADDR Baddr ,
UBYTE PType,
UBYTE Channel,
M7CNT_LOGCHANNEL_PTR pLogChannel);

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Baddr

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Base address of the interface submodule or the counter
module

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
PType I/O type of the counter channel. (Please specify one of the

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
values M7IO_IN or M7IO_OUT, it does not matter which)

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Channel Channel number:

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
In the case of single-channel counter modules/submodules,
this is always 1

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
In the case of multi-channel counter modules, this is the
number of the counter channel

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
pLogChannel Logical channel number (return signal)

Description The function must be called once for each counter channel used.
Baddr, Ptype and Channel identify a counter channel. The function assigns a
logical channel number to this counter channel. This logical channel number
is used to access this channel by all other functions of the counter function
library.

12
Return Value 0 The function has been executed successfully
00 An error has occurred

FM 450-1 Counter Function Module


12-6 C79000-G7076-C450-01
M7 Reference Counter Function Library

Error Code Meaning


M7CNTE_CHANNEL_WRONG The channel number specified when calling the
function (Channel parameter) is wrong
M7CNTE_PTYPE_WRONG The I/O type specified when calling the function
(Ptype parameter) is wrong
M7CNTE_TIMEOUT A time overflow has occurred while accessing
the counter channel since the counter channel has
not responded.
M7CNTE_NO_COUNTER The submodule/module at the address specified
is not a counter submodule/module.
M7CNTE_INVALID_BADDR There is no submodule/module at the address
specified

Example #include ”M7CNT.H”


#define CNT_BADDR 320

M7CNT_LOGCHANNEL Ch5;

/* Initialize counter channel 1 of the counter module */


/* The counter channel has I/O type M7IO_IN.*/
/* The logical channel number is returned in Ch5. */

if ((M7CntRet = M7CntInit(CNT_BADDR, M7IO_IN,1,&Ch5))


!= M7CNT_DONE)
{...error handling...}

12

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-7
M7 Reference Counter Function Library

12.6 M7CntLoadAndStart

Function Load and start counter channel (for operating modes with software gate
control)

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntLoadAndStart(
M7CNT_LOGCHANNEL LogChannel,
DWORD LoadVal);

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁ
LoadVal
ÁÁÁÁÁÁÁÁÁÁÁÁ Load value

Description The function transfers the load value specified at the time of calling direct to
the counter channel. Thereafter, the counter channel is started via the soft-
ware gate.
The function only works error-free in the counter operating modes with soft-
ware gate control. In the operating modes with hardware gate control, an op-
erating error is signaled but the load value is transferred anyway.
In the case of the operating modes with hardware gate control, use the
M7CntLoadDirect or M7CntLoadPrep functions to load the counter channel.
Default: the counter channel is preset with 0 and stopped.

Note The load value is interpreted depending on the count mode set for the counter
channel. Please ensure that the load value specified is within the count range
of the count mode set (cf. Table 12-1).
12
Return Value 0 The function has been executed successfully
00 An error has occurred

Error Code Meaning


M7CNTE_FS_NO_START The counter channel cannot be started in this op-
erating mode (with hardware gate control).
M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntLoadDirect, M7CntLoadPrep, M7CntStart,


M7CntReadLoadValue

FM 450-1 Counter Function Module


12-8 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.7 M7CntLoadComp

Function Transfer Comparison Value

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntLoadComp(
M7CNT_LOGCHANNEL LogChannel,
DWORD CmpV1,
DWORD CmpV2,
BOOL SelCmp1,
BOOL SelCmp2);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
CmpV1 Comparison value 1

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
CmpV2 Comparison value 2

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelCmp1 Selection bit for comparison value 1

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
SelCmp2 Selection bit for comparison value 2

Description You can transfer the two comparison values CmpV1 and CmpV2 to the
counter channel in each case using this function. The selection bits SelCmp1
and SelCmp2 determine whether the associated comparison value is to be
transferred (SelCmpx = TRUE) or not (SelCmpx = FALSE). - If SelCmp1 =
TRUE and SelCmp2 = TRUE, both comparison values can also be transferred
simultaneously in one function call. If one selection bit is FALSE, the
associated comparison value will not be transferred and the old value is re-
tained.
Default setting: The comparison values are set to 0 as default.
12
Note The comparison values are interpreted in accordance with the count mode set
for the counter channel. Please ensure that the load value specified is within
the count range of the count mode set (cf. Table 12-1).

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-9
M7 Reference Counter Function Library

See Also Function: M7CntInit

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
DWORD CmpValue1=100;
DWORD CmpValue2=200;
if ((Err = M7CntLoadComp (Ch5, CmpValue1, CmpValue2, TRUE,
TRUE))
!= M7CNT_DONE)
{...error handling...}

12

FM 450-1 Counter Function Module


12-10 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.8 M7CntLoadDirect

Function Load Counter Channel

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntLoadDirect(
M7CNT_LOGCHANNEL LogChannel,
DWORD LoadVal);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
LoadVal
ÁÁÁÁÁÁÁÁÁÁÁ Load value

Description The function transfers the load value (LoadVal) specified when the call was
made, direct to the counter channel in each case. The function is also
executed while the counter channel is operating.
Default: the counter channel is set to 0 and stopped as default.

Note The load value is interpreted in accordance with the count mode set for the
counter channel. Please ensure that the load value specified is within the
count range of the count mode set (cf. Table12-1).

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
12
parameter) is not valid.

See Also Function: M7CntInit, M7CntLoadAndStart, M7CntLoadPrep,


M7CntReadLoadValue

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
DWORD LoadValue=100;
if ((Err = M7CntLoadDirect (Ch5, LoadValue)) != M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-11
M7 Reference Counter Function Library

12.9 M7CntLoadPrep

Function Prepare Loading of the Counter Channel

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntLoadPrep(
M7CNT_LOGCHANNEL LogChannel,
DWORD LoadVal);

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁ
LoadVal
ÁÁÁÁÁÁÁÁÁÁÁÁ Load value

Description The function transfers the load value (LoadVal) specified when the call was
made, into the counter-internal load register. From there, the load value is
transferred into the counter channel and counted further from there if:
S a hardware pulse is present at the SET or START input
S an overflow or an underflow occurs (and a periodic operating mode is set)
S the M7CntStart function is called

Note The load value is interpreted in accordance with the count mode set for the
counter channel. Please ensure that the load value specified is within the
count range of the count mode set (cf. Table 12-1).
You can then read the current load value with the M7CntReadLoadValue
function. However, the function only supplies the new load value when one
of the three conditions has occurred and one count pulse has been received.

12
Return Value 0 The function has been executed successfully
00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntLoadAndStart, M7CntLoadDirect,


M7CntReadLoadValue

FM 450-1 Counter Function Module


12-12 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.10 M7CntPar

Function Parameterize Counter Channel

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntPar(
M7CNT_LOGCHANNEL LogChannel,
M7CNT_PARAM_PTR pCntParam);

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by M7CntInit

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
pCntParam Pointer to the structure M7CNT_PARAM with
the parameterization data

Description The function is called if the current parameters of the counter channel are to
be changed. Before calling the function, you must enter the desired parame-
terization data in the M7CNT_PARAM structure. After this, the function is
called to parameterize the counter channel specified. The new settings be-
come effective immediately.

Note When the M7CntPar function is called, the current parameterization data are
always completely overwritten and part parameterizations cannot be made.
Any previously stored enable of the inputs or outputs will also be lost as a
result of reparameterization. This means that the M7CntEnableSet and, for
example, M7CntEnableOut functions may need to be called again after
M7CntPar.
Reparameterization overwrites already set comparison values and the load
value.
In addition, counter pulses may be lost when reparameterizing with the 12
M7CntPar function.
In the FM 450-1, the other channel remains unaffected by reparameterization.
Errors in parameter assignment result in initiation of a diagnostics interrupt.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-13
M7 Reference Counter Function Library

See Also Function: M7CntInit


Structure: M7CNT_PARAM

Example #include <m7cnt.h>

M7CNT_LOGCHANNEL LogChannel;
M7CNT_PARAM DS128;

/*******Initialisierung des DS128def*******/


DS128.IntMask= M7CNT_NO_INT; /*Int. mask bits: no interrupt enabled*/
DS128.EncSel= M7CNT_ENC_5V; /*Receiver select.: 5 V cnt signal*/
DS128.WireBrk= M7CNT_WIRE_NON; /*Diagn. active: no diagn.*/
DS128.SigEval= M7CNT_SIG_1; /*Signal evaluation: single*/
DS128.FilCnt= M7CNT_FCNT_200KHZ; /*Filter cnt inp.: 200 kHz*/
DS128.FilDI= M7CNT_FDI_200KHZ; /*Filter dig. inp.: 200 kHz*/
DS128.CntMod= M7CNT_CNTMOD_32BIT; /*Cnt mode: 32 bits w/o sign*/
DS128.SynMod= M7CNT_SYNMOD_ONE; /*Synch. type: single*/
DS128.SynZero= M7CNT_SYNZERO_NO; /*Zero mark synch.: w/o zero mark*/
DS128.SigInv= M7CNT_SIGINV_NO; /*Direction change track B: not inv.*/
DS128.ModHWG= M7CNT_HWGATE_LEVEL; /*Gate setting HW gate: level-contr.*/
DS128.ConGate= M7CNT_CONGATE_NO; /*Gate contr. f. cont. cnt.: disabled*/
DS128.ConHWG= M7CNT_CONHWG_NO; /*HW gate for cont. cnt: disabled*/
DS128.ConSWG= M7CNT_CONSWG_NO; /*SW gate for cont. cnt: disabled*/
DS128.MethDQ0= M7CNT_DQ_AB; /*Behavior of output OUT0: switch off*/
DS128.MethDQ1= M7CNT_DQ_AB; /*Behavior of output OUT1: switch off*/
DS128.PulsDur= 200; /*Pulse duration: 200 ms*/
DS128.HystVal= 0x0; /*Hysteresis: 0 pulses*/
DS128.OpMod= M7CNT_CMOD_BA0; /*Mode: continuous counting*/
DS128.Reserved12= 0x0;
DS128.Reserved13= 0x0;
DS128.Reserved14= 0x0;
DS128.Reserved15= 0x0;

/******Parameterization of the counter******/

if (M7CntPar(LogChannel,&DS128)!=M7CNT_DONE)
{ /*error handling*/ }

12

FM 450-1 Counter Function Module


12-14 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.11 M7CntRead

Function Read Counter Value

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntRead(
M7CNT_LOGCHANNEL LogChannel,
DWORD_PTR pActCntV);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
pActCntV Pointer to current counter status

Description The current counter status of the counter channel is read and stored in
pActCntV.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

Note The macros M7InitISADesc and M7LoadISADWord from the M7-API are
available for reading the counter status of an IF counter submodule. Access is
via the high-speed ISA bus. 12
See Also Function: M7CntInit, M7CntStopAndRead

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
DWORD ZaehlerStand;
if ((M7CntRet = M7CntRead (Ch5, &ZaehlerStand)) != M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-15
M7 Reference Counter Function Library

12.12 M7CntReadDiag

Function Read Diagnostics Information

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntReadDiag(
M7CNT_LOGCHANNEL LogChannel,
M7CNT_DIAGINFO_PTR pDiagInfo);

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by M7CntInit

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
pDiagInfo Pointer to M7CNT_DIAGINFO structure with
the diagnostics information

Description When this function is called, the diagnostics data set DS1 is read and stored
in pDiagInfo. You should then call the M7CntReadDiag function if you re-
ceive a diagnostics interrupt ‘Error on the channel’ (diagnostics byte 0, bit
3=1). The M7CNT_DIAGINFO structure supplies you with the diagnostics
data set DS1 which contains additional channel-specific diagnostics informa-
tion.
The structure of the diagnostics data set DS1 is explained in Chapter 13.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel

12 parameter) is not valid.

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
M7CNT_DIAGINFO CntDiagInfo;
if ((Err = M7CntReadDiag(Ch5, &CntDiagInfo)) != M7CNT_DONE)
{...error handling...}

See Also Function: M7CntInit, M7CntReadParError


Structure: M7CNT_DIAGINFO

FM 450-1 Counter Function Module


12-16 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.13 M7CntReadLoadValue

Function Read Load Value

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntReadLoadValue(
M7CNT_LOGCHANNEL LogChannel,
DWORD_PTR pActLoad);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
pActLoad Pointer to the ActLoad load value

Description The function reads the current load value of the counter channel and stores it
in pActLoad.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

See Also Function: M7CntInit, M7CntLoadAndStart, M7CntLoadDirect,


M7CntLoadPrep
12

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-17
M7 Reference Counter Function Library

12.14 M7CntReadParError

Function Read Parameterization Error

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntReadParError(
M7CNT_LOGCHANNEL LogChannel,
WORD_PTR pParError);

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
pParError

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Pointer to pParError parameterization er-
ror

Description You call this function if you have received a diagnostics interrupt (diagnos-
tics byte 0, bit 7=1) due to a parameterization error. The function reads the
last occurring parameterization error and stores it in pParError.
See Table 12-4 for the meanings of the parameterization errors.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

12
See Also Function: M7CntInit, M7CntPar, M7CntReadDiag
Structure: M7CNT_DIAGINFO
Error Codes, Tabelle 12-4.

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
WORD ParError;
if ((Err = M7CntReadParError (Ch5, &pParError))
!= M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


12-18 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.15 M7CntReadStatus

Function Read Counter Status

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntReadStatus(
M7CNT_LOGCHANNEL LogChannel,
M7CNT_STATUS pCntStatus);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
pCntStatus

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Pointer to the M7CNT_STATUS structure
with the counter status

Description When this function is called, the counter status byte and the status of the in-
puts and outputs are read and stored in the M7CNT_STATUS structure. The
structure is designed so that you can access the information bit-by-bit.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

Example #include ”M7CNT.H” 12


M7CNT_LOGCHANNEL Ch5;
if ((Err = M7CntReadStatus (Ch5, &CntStatus)) != M7CNT_DONE)
{...error handling...}

See Also Function: M7CntInit, M7CntResetStatus


Structure: M7CNT_STATUS

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-19
M7 Reference Counter Function Library

12.16 M7CntResetStatus

Function Reset Counter Status

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntResetStatus(
M7CNT_LOGCHANNEL LogChannel,
BOOL SelSynr,
BOOL SelCmpStatus);

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by M7CntInit

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
SelSynr

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
The ‘Counter synchronization reached’ status bit is reset
(TRUE) or not reset (FALSE)

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
SelCmpStatus

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
The ‘Zero pass’, ‘Overflow’, ‘Underflow’ status bits are
reset (TRUE) or not reset (FALSE)

Description The ‘Counter synchronization reached’, ‘Zero pass’, ‘Overflow’, and ‘Under-
flow’ status bits of the counter channel can be reset using this function.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.

12
See Also Function: M7CntInit, M7CntReadStatus
Structure: M7CNT_STATUS

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
if ((Err = M7CntResetStatus (Ch5, TRUE, TRUE)) != M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


12-20 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.17 M7CntStart

Function Start Counter Channel - for Operating Modes with Software Gate
Control

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntStart(M7CNT_LOGCHANNEL LogChannel);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

Description The counter channel is started via the software gate with this function. The
function only works error-free in the counter modes with software gate con-
trol. In the case of the operating modes with hardware gate control, an opera-
tor error is signaled.

Return Value 0 The function has been executed successfully


00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.
M7CNTE_FS_NO_START Operator error: the counter channel cannot be
started in this operating mode

See Also Function: M7CntInit, M7CntLoadAndStart 12


Example #include ”M7CNT.H”
M7CNT_LOGCHANNEL Ch5;
if ((Err = M7CntStart (Ch5)) != M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-21
M7 Reference Counter Function Library

12.18 M7CntStop

Function Stop Counter Channel

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntStop(M7CNT_LOGCHANNEL LogChannel);

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by

ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CntInit

Description The counter channel is stopped with this function. The function is effective in
all operating modes with gate control (hardware and software gate control).
In the continuous counting without gate control mode, an operator error is
signaled. In the operating modes with software gate control, the counter
channel can be restarted with the M7CntLoadAndStart or M7CntStart func-
tions. The counter channel then starts with
S the load value (M7CntStart) already in the load register, or
S the load value transferred when the M7CntLoadAndStart function was
called

Note When the M7CntStop function is called in the operating modes with hard-
ware gate control, the counter channel cannot be started until the parameters
have been reassigned.

Return Value 0 The function has been executed successfully


00 An error has occurred

12 Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.
M7CNTE_FS_NO_STOP Operator error: the counter channel cannot be
stopped in this operating mode

See Also Function: M7CntInit, M7CntLoadAndStart, M7CntStart, M7CntStopAn-


dRead

Example #include ”M7CNT.H”


M7CNT_LOGCHANNEL Ch5;
if ((Err = M7CntStop (Ch5)) != M7CNT_DONE)
{...error handling...}

FM 450-1 Counter Function Module


12-22 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.19 M7CntStopAndRead

Function Stop Counter Channel and Read Counter Value

Syntax #include <m7cnt.h>


M7ERR_CODE M7CntStopAndRead(
M7CNT_LOGCHANNEL LogChannel,
DWORD_PTR pActCntV);

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Parameter Meaning

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
LogChannel Logical channel number, detected by
M7CntInit

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
pActCntV Pointer to current counter status

Description This function stops the counter channel and reads the counter status. The
function is effective in all operating modes with gate control (hardware and
software gate control). In the continuous counting without gate control mode,
an operator error is signaled. In the operating modes with software gate con-
trol, the counter channel can be restarted with the M7CntLoadAndStart or
M7CntStart functions. The counter channel then starts with
S the load value (M7CntStart) already in the load register or
S the load value transferred when the M7CntLoadAndStart function was
called

Note When the M7CntStopAndRead function is called in the operating modes with
hardware gate control, the counter channel cannot be started until the param-
eters have been reassigned.

Return Value 0 The function has been executed successfully


12
00 An error has occurred

Error Code Meaning


M7CNTE_NO_LOGCHANNEL The channel specified when calling (LogChannel
parameter) is not valid.
M7CNTE_FS_NO_STOP Operator error: the counter channel cannot be
stoped in this operating mode.

See Also Function: M7CntInit, M7CntStop, M7CntStart, M7CntLoadAndStart

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-23
M7 Reference Counter Function Library

12.20 M7CNT_DIAGINFO
Function The structure is used for evaluating diagnostics messages with the
M7CntReadDiag function.
Syntax struct {
unsigned MdlDef:1; /* Module fault */
unsigned IntFlt:1; /* Fault, internal */
unsigned ExtFlt:1; /* Fault, external */
unsigned PntInfo:1; /* Fault in one channel */
unsigned ExtVolt:1; /* Ext. aux. voltage */
unsigned FldConn:1; /* Front connector missing */
unsigned NoConfig:1; /* Parameterization missing*/
unsigned ConfigEr:1; /* Parameterization error */
unsigned MdlType:4; /* Type class */
unsigned ChInfo:1; /*Channel information*/
unsigned ModInfo:1; /* Module information */
unsigned :2; /* Reserve */
unsigned SubMdlEr:1; /*Wrong/missing interf. submod. */
unsigned CommFlt:1; /* Communications fault */
unsigned MdlStop:1; /* RUN/STOP operating state */
unsigned WtchDogF:1; /* Watchdog tripped */
unsigned IntPSFlt:1; /* Intern. volt. failure */
unsigned PrimBat:1; /* Battery empty */
unsigned BckupBat:1; /* Backup failed*/
unsigned :1; /* Reserve */
unsigned RackFlt:1; /* Rack fault */
unsigned ProcFlt:1; /* Processor fault*/
unsigned EpromFlt:1; /* EPROM fault */
unsigned RamFlt:1; /* RAM fault */
unsigned ADUFlt:1; /*ADC/DAC fault*/
unsigned FuseFlt:1; /* Fuse tripped */
unsigned HWIntrF:1; /* Process interrupt lost */
unsigned :1; /* Reserve */
UBYTE ChType; /* Channel type */
UBYTE LgthDia; /*Diagn. info length per channel*/
UBYTE ChNo; /* Channel number */
unsigned GrpErr1:1; /*Channel group error 1 */
12 unsigned GrpErr2:1;
unsigned :6;
/* Channel group error 2 */
/* Reserve */
unsigned Ch1SigA:1; /* Channel 1, signal A fault */
unsigned Ch1SigB:1; /* Channel 1, signal B fault */
unsigned Ch1SigZ:1; /* Channel 1, signal N fault */
unsigned Ch1Betw:1; /* Channel 1, fault between channels*/
unsigned Ch15V2:1; /* Channel 1, 5.2 V encoder supply */
unsigned :3; /* Reserve */
unsigned Ch2SigA:1; /* Channel 2, signal A fault */
unsigned Ch2SigB:1; /* Channel 2, signal B fault */
unsigned Ch2SigZ:1; /* Channel 2, signal N fault */
unsigned Ch2Betw:1; /* Channel 2, fault between channels*/
unsigned Ch25V2:1; /* Channel 2, 5.2 V encoder supply */
unsigned :3; /* Reserve */
UBYTE Reserved11; /* Reserve */
} M7CNT_DIAGINFO;

FM 450-1 Counter Function Module


12-24 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.21 M7CNT_PARAM

Function The structure is used for parameterizing the counter channel with the
M7CntPar function.

Syntax struct {
UWORD IntMask; /* Interrupt mask bits */
/* Bit 0: IOpenGate Int. on opening the gate */
/* Bit 1: ICloseGate Int. on closing the gate */
/* Bit 2: Ioflw Int. on overflow*/
/* Bit 3: Iuflw Int. on underflow */
/* Bit 4: ICmp1Up Int. on reaching comp. val.1 up*/
/* Bit 5: ICmp1Dn Int. on reaching comp. val.1 down*/
/* Bit 6: ICmp2Up Int. on reaching comp. val.2 up*/
/* Bit 7: ICmp2Dn Int. on reaching comp. val.2 down*/
/* Bit 8: Izero Int. on zero pass */
/* Bit 9 bis 11: Reserve */
/* Bit 12: Isync Int. on synchronization */
/* Bit 13 bis 15: Reserve */
UWORD EncSel; /* Encoder selection */
UWORD WireBrk; /* Activate wirebreak detector*/
UWORD SigEval; /* Evaluation of the signals */
UWORD FilCnt; /* Input filter counter inputs*/
UWORD FilDI; /* Input filter digital inputs*/
unsigned CntMod:1; /* Count mode */
unsigned SynMod:1; /* Synchronization type */
unsigned SynZero:1; /* Zero mark on synchronization */
unsigned SigInv:1; /* Inv. of cnt inp. signals */
unsigned ModHWG:1; /* Gate setting HW gate */
unsigned ConGate:1; /* Gate contr. for cont. cnt*/
unsigned ConHWG:1; /* HW gate for cont. cnt */
unsigned ConSWG:1; /* SW gate for cont. cnt */
unsigned : 8; /* Reserve */
UWORD MethDQ0; /* Behavior of output Q0 */
UWORD MethDQ1; /* Bahavior of output Q1 */
UWORD PulsDur; /* Pulse duration */
UWORD HystVal; /* Hysteresis */
UWORD OpMod; /* Operating mode */
UWORD Reserved12;
UWORD Reserved13;
/* Reserve */
/* Reserve */
12
UWORD Reserved14; /* Reserve */
UWORD Reserved15; /* Reserve */
} M7CNT_PARAM;

Note The reserve bits and words of the structure must be initialized with 0, other-
wise the counter channel could enter an undefined state.
The hysteresis value cannot be set and the HystVal parameter is not eva-
luated.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-25
M7 Reference Counter Function Library

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Table 12-1
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Detailed Specifications of the Parameterization Data

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Parameter

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
Meaning

ÁÁÁ
ÁÁÁ
Data
Type
Value Range Coding De-
fault
Bit

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Interrupt mask bits (word 0)

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
IOpen-

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Gate

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
nal gate ÁÁÁ
ÁÁÁÁ ÁÁÁ
Interrupt on opening the inter- BOOL

ÁÁÁ
ÁÁÁ
{masked | free} {0|1} 0 0

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
IClose-

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Gate ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Interrupt on closing the inter-

ÁÁÁÁÁÁÁÁÁÁÁÁ
nal gate
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
BOOL {masked | free} {0|1} 0 1

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Ioflw Interrupt on overflow BOOL {masked | free} {0|1} 0 2

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Iuflw
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Interrupt on underflow BOOL {masked | free} {0|1} 0 3

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ICmp1Up

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
Interrupt on reaching compar- BOOL

ÁÁÁ
ÁÁÁ
ison value 1 in up direction
{masked | free} {0|1} 0 4

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ICmp1Dn

ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
Interrupt on reaching compar- BOOL

ÁÁÁ
ÁÁÁ
ison value 1 in down direc-
{masked | free} {0|1} 0 5

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ
tion

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ICmp2Up Interrupt on reaching compar- BOOL {masked | free} {0|1} 0 6

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ison value 2 in up direction

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ICmp2Dn Interrupt on reaching compar- BOOL {masked | free} {0|1} 0 7
ison value 2 in down direc-

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
tion
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Izero

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Interrupt on zero pass

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
BOOL
BOOL
{masked | free}
{masked | free}
{0|1}
{0|1}
0
0
8
12

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Isync Interrupt on synchronization

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
EncSel Receiver selection WORD {5 V count signal | 24V count sig- {0|1} 0 –
nal} with IF 961-CT1

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ
{5 V count signal | {0|1|2}
24 V count signal source output |

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ 24 V count signal sink output}

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ
with FM 450-1

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
WireBrk Diagnostics active for wire- WORD { A, B, N | A | A,B | {0|1| 0 –

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
break detection on signal pair no diagnostics} 2|3}
12
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
SigEval Evaluation of the signals WORD {single | double | quadruple | {0|1| 0 –

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ
frequency direction} 2 |3}

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
FilCnt; Input filter for counter inputs WORD { 200 kHz | 50 kHz } {0|1} 0 –
with IF 961-CT1

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ
{ 200 kHz | 20 kHz }
with FM 350-1, 450-1

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
FilDI

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Input filter for digital inputs

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
WORD { 200 kHz | 50 kHz }
with IF 961-CT1
{0|1} 0 –

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ { 200 kHz | 20 kHz }

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ
with FM 350-1, 450-1

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
CntMod Count mode BOOL { 32 bit (w/o sign) | {0|1} 0 0

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
+/– 31 bit }

ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ
SynMod Synchronization type BOOL { single | periodic } {0|1} 0 1

FM 450-1 Counter Function Module


12-26 C79000-G7076-C450-01
M7 Reference Counter Function Library

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Table 12-1
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
Detailed Specifications of the Parameterization Data, Continued

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Parameter

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
Meaning

ÁÁ
Data
Type
Value Range Coding De-
fault
Bit

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
SynZero

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
Zero mark on synchronization BOOL

ÁÁ
{with zero mark |
without zero mark }
{0|1} 0 2

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
SigInv Change of direction with BOOL { not inverted | {0|1} 0 3

ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
track B inverted }

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ModHWG Gate setting hardware gate BOOL {level-controlled| {0|1} 0 4
edge-controlled}

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ConGate
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁ
Gate control for continuous
counting mode
BOOL { disabled | enabled } {0|1} 0 5

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ConHWG

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
counting modeÁÁ
Hardware gate for continuous BOOL

ÁÁ
{ disabled | free } {0|1} 0 6

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ConSWG

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
Software gate for continuous

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
counting mode
ÁÁ
BOOL { disabled | free } {0|1} 0 7

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
MethDQ0

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
Behavior of output Q0

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
WORD { switch off | {0| 0 –

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ active from comparison value to 1|

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ overflow |

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ
active from comparison value to
underflow |
2|

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ active for ‘Pulse duration’ on 3|

ÁÁ
MethDQ1 Behavior of output Q1 WORD 0 –
overrange up direction |

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ active for ‘Pulse duration’ on un- 4|

ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
derrange down direction |

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ
active for ‘Pulse duration on over- 5}

ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
range or underrange }*

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
PulsDur

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
Pulse duration

ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
WORD { 0 : 500 } D {0:1F4}
H
0 –

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
HystVal

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Hysteresis

ÁÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁ
WORD { 0 : 255 } D
cannot be set, the parameter is not
evaluated
{ 0:FF }
H
0 –

12
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
OpMod

ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ WORD { Continuous counting (with or {0| 0 –

ÁÁ
Operating mode
without gate) |

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ single counting with SW gate | 1|

ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ single counting with HW gate|

ÁÁ
2|
periodic counting with SW gate |

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
3|

ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
periodic counting with HW gate }
4}
* See Section 9.7 ‘Behavior of the Digital Outputs’

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-27
M7 Reference Counter Function Library

12.22 M7CNT_STATUS

Function The structure is used for status scanning with the M7CntReadStatus function.

Syntax struct {
unsigned StsSet:1; /* Status: SET input 1 = active */
unsigned :1; /* Filler bit*/
unsigned StsSta:1; /* Status: START input 1 = active */
unsigned StsStp:1; /* Status: STOP input 1 = active */
unsigned StsCmp1:1; /* Status:Output comparator 1
1 = on */
unsigned StsCmp2:1; /* Status: Output comparator 2
1 = on */
unsigned :2; /* Reserve */
unsigned StsRun:1; /* Status: Counter is running */
unsigned StsDir:1; /* Status: Direction of count,
0 = up, 1 = down*/
unsigned StsZero:1; /* Status: Zero pass
1 = occurred*/
unsigned StsOflw:1; /* Status:Counter overflow
1 = occurred*/
unsigned StsUflw:1; /* Status: Counter underflow
1 = occurred */
unsigned StsSync:1; /* Status: Counter synchronization
1 = carried out */
unsigned StsGate:1; /*Status gate, 1 = open*/
unsigned StsSWG:1; /* Status SW gate, 1 = open */
} M7CNT_STATUS;

12

FM 450-1 Counter Function Module


12-28 C79000-G7076-C450-01
M7 Reference Counter Function Library

12.23 Error Codes

Return Value The success or failure of a function is indicated by the return value. The re-
turn value is of the M7ERR_CODE data type. The function supplies the fol-
lowing return values:
M7CNT_DONE: Function completed successfully
!=M7CNT_DONE: Error in execution
If an error occurs, the return value will not equal 0. The cause of the error
can be limited with the help of this value. Definitions for the error codes are
stored in the header file M7CNT.H.

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Return Value Meaning

ÁÁÁÁÁÁÁ
0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
1 to 99
No error
Operator error

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
200 to 400

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
–1 to –999
Parameterization error
M7API function error (e.g. I/O configuration error)

ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
–1000 to –1100 Error in the counter function (e.g. invalid channel number)

Table 12-2 Operator Errors

Error Code No. Meaning Remedy


M7CNTE_FS_NO_START 1 The counter cannot be started in Select an operating mode with
this operating mode software gate control
M7CNTE_FS_NO_STOP 2 The counter cannot be stopped in Select an operating mode with
this operating mode software gate control

12

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-29
M7 Reference Counter Function Library

Table 12-3 Counter Function Errors

Error Code No. Meaning Remedy


M7CNTE_CHANNEL_WRONG –1000 The channel number (Channel pa- Channel = 1 for IF counters and
rameter) specified at the call is FM 350-1
wrong Channel = {1/2} for FM 450-1
M7CNTE_PTYPE_WRONG –1001 The I/O type (Ptype parameter) PType={M7IO_IN | M7IO_OUT}
specified at the call is wrong
M7CNTE_NO_LOGCHANNEL –1002 The channel (LogChannel param- Call the M7CntInit function for
eter) specified at the call is invalid the counter channel and use the
returned logical channel number
M7CNTE_TIMEOUT –1003 A time overflow has occurred Check to see if the accessed sub-
when accessing the counter chan- module is a counter module or a
nel since the counter has not re- counter interface submodule or if
sponded the submodule is defective
M7CNTE_NO_COUNTER –1004 The submodule/module at the ad- Check to see if the correct starting
dress specified is not a counter address of the counter module or
submodule/module the counter interface submodule
has been specified in the Baddr
parameter of the M7CntInit func-
tion
M7CNTE_INVALID_BADDR –1005 There is no submodule/module at Check to see if the correct starting
the address specified address of the counter module or
the counter interface submodule
has been specified in the Baddr
parameter of the M7CntInit func-
tion

12

FM 450-1 Counter Function Module


12-30 C79000-G7076-C450-01
M7 Reference Counter Function Library

Table 12-4 Parameterization Errors

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
Error Code No. Meaning Remedy

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_ENC_SEL 201 Coding for receiver selection Please change the relevant param-

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
wrong eter of the M7CNT_PARAM*
structure or – in the case of the

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ FM 350-1 – the coding key.

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_WIRE_BRK
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
202 Coding for diagnostics of the sig-
nal pair wrong

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_SIG_EVAL
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
203 Coding for the evaluation of the
signals wrong

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_FIL_CNT
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
204 Coding for input filter counter in-
put 24 V wrong

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_FIL_DI 205 Coding for input filter digital in-

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
puts wrong

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_SIG_INV 206 Change of direction not permissi-

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ble

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_METH_DQ0 207 Coding for behavior of Q0 wrong

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_METH_DQ1 208 Coding for behavior of Q1 wrong Please change the relevant param-
eter of the M7CNT_PARAM
M7CNT PARAM

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_PULS_DUR 209 Pulse duration too long structure*
st uctu e

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_HYST_VAL
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_OP_MOD
ÁÁÁÁÁÁÁÁÁÁ
210
211
Hysteresis too great
Wrong operating mode

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_SW_HW_GATE 212

ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
Both gate types or no gate type
specified

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_DIR_IMP_AL

ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
215 Direction for pulse output and
process interrupt must be same

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_AL_GATE
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
216 Interrupts from internal gate only
possible in operating mode with

ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
gate

ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
M7CNTE_PAR_AL_METH_DQ 217 Output behavior and interrupt

* See M7CNT_PARAM structure, Table 12-1


mask (first word) do not match**
12
** With IF 961-CT1 counter submodule only: if both digital outputs are enabled, the same behavior (pulse behavior or
range behavior) must be parameterized for both. If only one digital output is enabled any behavior can be parameterized
for it.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 12-31
M7 Reference Counter Function Library

12

FM 450-1 Counter Function Module


12-32 C79000-G7076-C450-01
Faults and Diagnostics 13
This Chapter... Operator errors or incorrect wiring can cause faults that the module must in-
dicate to the user.
Faults are divided into the following classes on the module:
S Faults displayed by the diagnostics LEDs that indicate internal and exter-
nal module faults.
S Faults that can initiate a diagnostics interrupt.
S Operator errors.
These different classes of faults are indicated and displayed at different posi-
tions and must be acknowledged in different ways.
You will find the following described in this chapter:
S The faults that can occur
S Where these faults are indicated
S How you acknowledge the faults.

Chapter Section Contents Page


Overview 13.1 Fault Indication via the Diagnostics LEDs 13-2
13.2 Initiation of Diagnostics Interrupts 13-3
13.3 Data Errors 13-6
13.4 Operator Errors 13-7

FM 450-1 Counter Function Module


C79000-G7076-C450-01 13-1
Faults and Diagnostics

13.1 Fault Indication via the Diagnostics LEDs

Where is the Fault If one of the two red diagnostics LEDs lights up, a fault has occurred either
Indicated? on the module (internal fault = INTF diagnostics LED) or at the cable con-
nections (external fault = EXTF diagnostics LED).

Which Faults are The following faults are indicated by the diagnostics LEDs lighting up:
Indicated?

Type of Fault/LED Cause of Fault Remedy


Internal faults Fault in EPROM TEST Change module
INTF Diagnostics LED Fault in RAM TEST Change module
Watchdog tripped Change module
Lost process interrupt Acknowledged by process interrupt han-
dling
External faults Auxiliary voltage 1L+/1M not connected Correct connection
EXTF diagnostics LED or 24 VDC encoder supply short-cir-
cuited
5.2 VDC encoder supply short-circuited Correct connection
or overloaded
Fault in 5 V encoder signals (wirebreak, Correct connection
short-circuit, cable missing)

Initiating a All faults except the EPROM test fault, can initiate a diagnostics interrupt
Diagnostics provided you have enabled the diagnostics interrupt in the relevant parameter
Interrupt assignment screen form. You can see which fault has caused the LED to light
up from the diagnostics data sets DS0 and DS1. The assignments of the diag-
nostics data sets DS0 and DS1 are described in the next section.

13

FM 450-1 Counter Function Module


13-2 C79000-G7076-C450-01
Faults and Diagnostics

13.2 Initiation of Diagnostics Interrupts

What is a If a user program is to respond to an internal or external fault, you can para-
Diagnostics meterize a diagnostics interrupt that stops the cyclical program of the CPU
Interrupt? and calls the diagnostics interrupt OB (OB82).

Which Events Can The list shows you which events can initiate a diagnostics interrupt:
Initiate a
S Fault in external auxiliary voltage 1L+/1M
Diagnostics
Interrupt? S 5.2 VDC encoder supply short-circuited or overloaded
S Error in module parameterization
S Watchdog tripped
S RAM defective
S Process interrupt lost
S Fault in signal A (wirebreak, short-circuit, cable missing)
S Fault in signal B (wirebreak, short-circuit, cable missing)
S Fault in signal N (wirebreak, short-circuit, cable missing)

Enabling the Diag- You disable or enable the interrupts for the module in the parameter assign-
nostics Interrupt ment screen forms and you decide there whether the module is to initiate a
diagnostics interrupt and/or a process interrupt.

Responses to a If an event occurs that can initiate a diagnostics interrupt, the following hap-
Diagnostics pens:
Interrupt
S The diagnostics information is stored in diagnostics data sets DS0 and
DS1.
S A fault LED lights up.
S The diagnostics interrupt OB is called (OB82).
S The diagnostics data set DS0 is entered in the start information of the
diagnostics interrupt OB.
13
S The count continues unchanged.
If OB82 has not been programmed, the CPU goes to STOP.

Diagnostics Data The information as to which event has initiated a diagnostics interrupt is
Set DS0 and DS1 stored in the diagnostics data sets DS0 and DS1. The diagnostics data set
DS0 comprises four bytes; DS1 comprises 12 bytes with the first four bytes
being identical to DS0.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 13-3
Faults and Diagnostics

Reading the Data The diagnostics data set DS0 is automatically transferred to the start informa-
Set from the tion when the diagnostics OB is called.These four bytes are stored there in
Module the local datum (bytes 8 to 11) of OB82.
You can read out diagnostics data set DS1 (and so also the contents of DS 0)
from the module with the FC DIAG_INF. It only makes sense to do this, if a
fault in a channel is signaled in DS0.

Assignments of Table 13-1 shows the assignments of diagnostics data set DS0 in the start
the Diagnostics information. All unlisted bits are insignificant and take the value zero.
Data Set DS0 in
the Start
Information
Table 13-1 Assignments of Diagnostics Data Set DS0

Byte Bit Meaning Remarks Event No.


0 0 Module in fault Set for every diagnostics event 8:x:00
1 Internal fault Set for all internal faults: 8:x:01
S Faults in the RAM test
S Watchdog tripped
S Lost process interrupt
2 External fault Set for all external faults: 8:x:02
S Auxiliary voltage 1L+/1L- not con-
nected or 5.2 VDC encoder supply
short-circuited
S 5.2 VDC encoder supply short-cir-
cuited or overloaded
S Fault in 5 V signals
S Parameterization error
3 Fault in one channel Always assigned 1 in the case of inter- 8:x:03
nal and external faults
4 Fault in external auxiliary voltage 8:x.04
7 Parameterization error 8:x:07
1 0 ... 3 Type class Always assigned 8
4 Channel information Always assigned 1

13 2
3
3
3
Watchdog tripped
RAM defective
8:x:33
8:x:43
6 Process interrupt lost 8:x:46

FM 450-1 Counter Function Module


13-4 C79000-G7076-C450-01
Faults and Diagnostics

Diagnostics Data The diagnostics data set DS1 consists of 12 bytes. The first 4 bytes are identi-
Set DS1 cal with diagnostics data set DS0. Table 13-2 shows the assignments of the
remaining bytes. All unlisted bits are insignificant and take the value zero.
This data set is entered in DB1 from DW54 by the FC DIAG_INF.

Table 13-2 Assignments of the Bits of Bytes 4 to 12 of Diagnostics Data Set

Byte Bit Meaning Remarks Event No.


4 0 ... 6 Channel type Always assigned 76H
7 Further channel types Always assigned 0
5 0 ... 7 Diagnostics information length Always assigned 2
6 0 ... 7 Number of channels Always assigned 1
7 0 Channel fault vector Bit 0 = 1: Fault on channel 1
Bit 1 = 1: Fault on channel 2
8 0 Fault in signal A channel 1 8:x:B0
1 Fault in signal B channel 1 8:x:B1
2 Fault in signal N channel 1 8:x:B2
4 Fault in 5.2 V encoder supply 8:x:B4
channel 1
9 Reserved
10 0 Fault in signal A channel 2 8:x:B0
1 Fault in signal B channel 2 8:x:B1
2 Fault in signal N channel 2 8:x:B2
4 Fault in 5.2 V encoder supply 8:x:B4
channel 2
11 Reserved
12 Reserved

How Does the If you want to enter the diagnostics message in the diagnostics buffer, you
Diagnostics Text must call the SFC 52 ‘Enter user-specific message in diagnostics buffer’ in
Appear in the the user program. The event number of the diagnostics message in each case
Diagnostics
Buffer?
is specified in the input parameter EVENTN. The interrupt is entered in the
diagnostics buffer with x=1 as incoming and with x=0 as outgoing. The diag- 13
nostics buffer contains the relevant diagnostics text in the ‘Meaning’ column
as well as the time of the entry.

Default Setting The diagnostics interrupt is disabled in the default setting.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 13-5
Faults and Diagnostics

13.3 Data Errors

When Do Data If new parameters are transferred to the module, the FM 450-1 checks these
Errors Occur? parameters. If errors occur during this check, the module signals these data
errors.
Wrong parameters are not accepted by the module.

Where are Data The data errors are entered with their error numbers in DB1 by the FC
Errors Indicated? CNT_CTRL. You can access this data word in the user program via variable
identifier ‘DA_ERR_W’. Table 13-3 shows the number of the data errors and
the meaning of these errors.

Table 13-3 Data Error Numbers and their Meanings

No. Meaning
0 No error
201 Value too great for receiver selection
202 Value too great for diagnostics signal pair
203 Value too great for signal evaluation
204 Value too great for input filter of the 24 V counter signals
205 Value too great for the input filter of the digital inputs
206 Change of direction not permissible
207 Value too great for behavior of the digital output 1Q0 (2Q0)
208 Value too great for behavior of the digital output 1Q1 (2Q1)
209 Pulse duration wrong or too long
211 Wrong operating mode selected
212 No gate specified or both gates specified
215 When parameterizing the process interrupt ‘Reaching the comparison value in
up or down count direction’, a different count direction was specified to that
specified in the parameterization of the behavior of the outputs ‘Output active
for one pulse duration in up or down direction’. The directions must agree.

13 216 Interrupts from the gate control only possible in the operating modes with gate
control.
217 In the case of the behavior of the digital outputs ‘Active between the compari-
son value and overflow’ or ‘Active between comparison value and underflow’,
no interrupt is permissible on reaching the comparison values.

How are Data Correct the values for the parameters in accordance with the specifications.
Errors Transfer the corrected parameter set again to the FM 450-1. The FM 450-1
Acknowledged? checks the parameters again and deletes the data error in DB1.

FM 450-1 Counter Function Module


13-6 C79000-G7076-C450-01
Faults and Diagnostics

13.4 Operator Errors

When Do Operator Operator errors occur when you operate the module wrongly by setting incor-
Errors Occur? rect control signals.

Where are the The operator error numbers are entered in DB1 by the FC CNT_CTRL. You
Operator Errors can access this data word in your program via the variable identifier
Indicated? ‘OT_ERR_B’.

What Operator Table 13-4 shows the possible numbers of the operator errors and their mean-
Errors Exist? ing.

Table 13-4 Numbers of the Operator Errors and their Meaning

Error Number Meaning


0 No error
1 Operating mode cannot be started with software gate
2 Operating mode cannot be aborted
4 Only permissible if OD is active

How are Operator Acknowledge the error with the OT_ERR_A parameter in DB1.
Errors
Acknowledged?

13

FM 450-1 Counter Function Module


C79000-G7076-C450-01 13-7
Faults and Diagnostics

13

FM 450-1 Counter Function Module


13-8 C79000-G7076-C450-01
Technical Specifications A
This Chapter... The technical specifications of the FM 450-1 are listed in this chapter.

Chapter Section Contents Page


Overview A.1 Technical Specifications A-3

UL/CSA Approvals The following approvals are available:


UL-Recognition-Mark
Underwriters Laboratories (UL) to
Standard UL 508
CSA-Certification-Mark
Canadian Standard Association (CSA) to
Standard C 22.2 No. 142

FM 450-1 Counter Function Module


C79000-G7076-C450-01 A-1
Technical Specifications

FM Approval The following FM approval has been issued for the SZ-400:
FM approval to Factory Mutual Approval Standard Class Number 3611,
Class I, Division 2, Group A, B, C, D.

Warning
! Personal injury or property damage can result.
In hazardous areas, personal injury or property damage can result if plug-in
connections are interrupted during operation of an S7-400.
The S7-400 must always be de-energized prior to separating plug-in connec-
tions in hazardous areas.

Warning
! WARNING - DO NOT DISCONNECT WHILE CIRCUIT IS LIVE
UNLESS LOCATION IS KNOWN TO BE NONHAZARDOUS

CE Marking Our products meet the requirements of EU Directive 89/336/EWG “Electro-


magnetic Compatibility” and the harmonized European standards (EN) listed
therein.
In accordance with the above-mentioned EU Directive, Article 10, the EU
declarations of conformity are held at the disposal of the competent authori-
ties at the address below:
Siemens Aktiengesellschaft
Bereich Automatisierungstechnik
AUT E 148
Postfach 1963
D-92209 Amberg
Federal Republic of Germany

Area of SIMATIC products have been designed for use in the industrial area.
Application
They can also be used in the domestic environment (household, business and
trade area, small plants) with individual approval. You must acquire the indi-
vidual approval from the respective national authority or testing body.

Area of Application Requirements


Emitted interference Immunity
Industry EN 50081-2 : 1993 EN 50082-2 : 1995

A Domestic Individual approval EN 50082-1 : 1992

Observing the SIMATIC products meet the requirements if you observe the installation
Installation guidelines described in the manual when installing and operating the equip-
Guidelines ment.

FM 450-1 Counter Function Module


A-2 C79000-G7076-C450-01
Technical Specifications

A.1 Technical Specifications


Dimensions and Weight Data on the Counter Signals and the Digital Inputs
Dimensions W H D (mm) 25290280 and Ouputs (Applies for both Counters)
Weight approx. 650 g Counter inputs 5 V
Voltages, Currents, Potentials S Level In accordance with RS
Auxiliary voltage 1L+/1M 24 VDC 422
S Range, static 20.4 ... 28.8 V S Terminating resistance approx. 220 ohms
dynamic 18.5 ... 30.2 V S Differential input voltage min. 0.5 V
S Reverse polarity protection Yes S Max. counting frequency
Load voltage 2L+/2M 24 VDC S Galvanic isolation to the 500 kHz
S Range, static 20.4 ... 28.8 V S7-400 bus No
dynamic 18.5 ... 30.2 V Counter inputs 24 V
S Reverse polarity protection Yes S Low level – 30 ... + 5 V
S Galvanic isolation Yes, to all other S High level + 11 ... + 30 V
voltages S Input current typ. 9 mA
5 V encoder supply S Minimum pulse width, w 2.5 ms (200 kHz),
S Output voltage 5.2 V " 2% (max. count frequency) w 25 ms (20 kHz)
S Output current max. 300 mA / counter (parameterizable)
channel, short-circuit Digital inputs
protected S Low level – 28.8 ... + 5 V
24 V encoder supply S High level + 11 ... + 28.8 V
S Output voltage 1L+ – 3V S Input current typ. 9 mA
S Output current max. 300 mA / counter S Mimimum pulse width, w 2.5 ms (200 kHz),
channel, short-circuit (max. count frequency) w 25 ms (20 kHz)
protected (parameterizable)
S Non-periodic overvoltage Value: 35 V Digital outputs
Duration: 500 ms
Recovery time: 50 s S Supply voltage 2L+ / 2M
Current consumption S Galvanic isolation Yes, to all others ex-
cept the digital inputs
S From backplane bus approx. 450 mA
S Output voltage
S From 1L+ approx. 40 mA
min. 2L+ – 1.5 V
(without encoder) – High level signal ‘1’
– Low level signal ‘0’ max. 3 V
Power losses of the module approx. 9 W
S Switching current
Status, Interrupts, Diagnostics – Nominal value 0.5 A
Status indication Yes, 14 green LEDs – Range 5 mA to 0.6 A
for status of CR, DIR, S Switching time max. 300 ms
inputs and outputs
S Cutoff voltage (ind.) limited to 2L+ – 39 V
Interrupts S Short–circuit protection Yes
S Process interrupt Yes, parameterizable
S Diagnostics interrupt Yes, parameterizable
Diagnostics functions Yes
S Fault indication for inter-
nal and external faults Yes, 2 red LEDs
S Diagnostics information
read out Yes A
Note
Further relevant data, for example, environmental conditions, are listed in
manual /1/.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 A-3
Technical Specifications

FM 450-1 Counter Function Module


A-4 C79000-G7076-C450-01
Spare Parts B
Spare Parts Table B-1 lists all spare parts of the FM 450-1 that you can order for this
module either additionally or later.

Table B-1 Accessories and Spare Parts

Parts for the FM 450-1 Order Number


Plate block C79459-A1203-C1
Front connector (48-pin) with screw-type termi- 6ES7 492-1AL00-0AA0
nals
Front connector (48-pin) with spring-loaded ter- 6ES7 492-1BL00-0AA0
minals
Front connector (48-pin) with crimp snap-on ter- 6ES7 492-1CL00-0AA0
minals

FM 450-1 Counter Function Module


C79000-G7076-C450-01 B-1
Spare Parts

FM 450-1 Counter Function Module


B-2 C79000-G7076-C450-01
References C
Supplementary The table below lists all the manuals referred to in this manual.
References

No. Title Order Number


/1/ SIMATIC S7: S7-400/M7-400 Programmable 6ES7 040-0AA01-8AA0
Controllers
Hardware and Installation
/2/ SIMATIC; System Software for S7-300 and Included in package:
S7-400 6ES7 810-4BA01-8AR0
System and Standard Functions

FM 450-1 Counter Function Module


C79000-G7076-C450-01 C-1
References

FM 450-1 Counter Function Module


C-2 C79000-G7076-C450-01
Glossary

Asymmetric Asymmetric signals are two pulse trains phase-shifted by 90 degrees and with
Signals a zero mark signal if required.

Configuration Assignment of modules to mounting racks, slots and addresses. When config-
uring the hardware, the user fills in a configuration table under STEP 7.

Double Evaluation Double evaluation means that the rising edges of pulse trains A and B are
evaluated on an incremental encoder.

Encoders Encoders are used for precise acquisition of, among others, rectangular sig-
nals, paths, positions, velocities, rotational speeds, dimensions, etc.

Encoders with Encoders with asymmetric output signals generate two pulse trains phase-
Asymmetric Ouput shifted by 90 degrees and with a zero mark signal if required.
Signals

Encoders with Encoders with symmetric output signals generate two pulse trains phase-
Symmetric Output shifted by 90 degrees, with a zero mark signal if required, and the corre-
Signals sponding inverted signals.

Function (FC) In accordance with IEC 1131-3, a function (FC) is a code block without static
data. A function makes it possible to transfer parameters in the user program.
This makes functions suitable for programming frequently recurring complex
functions.

Function Module A function module (FM) is a module that offloads the CPU of the S7 and M7
(FM) programmable controllers of time-critical or memory-intensive process signal
handling tasks. FMs normally use the internal communications bus for high-
speed data exchange with the CPU. FM applications include: Counting, posi-
tioning, closed-loop control.

Incremental Incremental encoders capture paths, positions, speeds, rotational speeds, di-
Encoders mensions, etc., by counting small increments.

FM 450-1 Counter Function Module


C79000-G7076-C450-01 Glossary-1
Glossary

Increments per Increments per encoder revolution specifies the number of increments that an
Encoder encoder gives in one revolution.
Revolution

Initiator An initiator is a simple BERO switch without direction information. It there-


fore supplies only a counter signal. Only the rising edges of signal A are
counted. The count direction must be specified by the user.

OD The ‘output disable’ (OD) signal switches all modules in an S7 program-


mable controller to the safe state in the STOP and HALT operating modes.
Examples of safe states are when the outputs are not live or when they are
switched with replacement values.

Power Control The power control drives the motor and can consist, for example, of a simple
contactor circuit.

Pulse Duration The pulse duration specifies the minimum time for which an output is to be
set.

Quadruple Quadruple evaluation means that all edges of the pulse trains A and B are
Evaluation evaluated on an incremental encoder.

SFC An SFC (system function) is a function integrated in the operating system of


the CPU that can be called in the STEP 7 user program when required.

Single Evaluation Single evaluation means that the rising edge of pulse train A is evaluated on
an incremental encoder.

STOP STOP is an internationally recognized term, for example, as an operating


mode command.

Zero Mark The zero mark is located on the second track of an incremental encoder. The
zero mark supplies a zero mark signal after each revolution.

Zero Mark Signal The zero mark signal is output by an incremental encoder after every revolu-
tion.

FM 450-1 Counter Function Module


Glossary-2 C79000-G7076-C450-01
Index

Symbols Count limits, 2-2


Count range, 2-2
“+/–31 bits” count mode, 9-11
CSA, A-1
“32 bits” count mode, 9-11

D
Numbers
Data errors, 13-6
24 V encoder signals, 4-5
Diagnostic data set DS0, assignments, 13-4
input filter, 1-3, 4-5, 10-5
Diagnostics data set DS1, assignments, 13-5
24 V signals, 10-4
Diagnostics interrupt, 13-2, 13-3
24 VDC encoder supply, 4-5
enabling, 13-3
5 V differential signals, 10-3
OB 82, 13-3
Diagnostics LEDs, 13-2
Digital input I0, status, 9-17
A Digital input I1, status, 9-17
Approbation. Siehe Approvals Digital input modules, A-3
Approvals Digital inputs, 4-6
CSA, A-1 input filter, 4-6
FM, A-1 Digital outputs, 4-6
UL, A-1 behavior, 9-13
Auxiliary voltage 1L+, 1M, 4-5 enabling, 9-12
status, 9-12
switching off, 9-14
B
Basic parameter assignment, 9-3
Behavior of the digital outputs, marginal condi- E
tions, 9-14 ENSET_DN, 9-20
ENSET_UP, 9-20
External faults, 13-2
C
CE, marking, A-2
Checklist F
mechanical installation, 8-2 FM 350-1
parameterization, 8-4 overview of commands, 9-3
Command: open and close gate, 9-16 overview of settings, 9-2
Command: set counter, 9-19 FM 450-1
Commands, 9-3 overview of operating modes, 9-2
give, 9-4 S7–400 configuration, 1-7
Comparison value, 1-2, 2-2, 9-12 Front connector, 1-6, 4-2
Continuous counting, 2-3 terminal assignments, 4-2
Control bits, 9-4 Front connector of the FM 450-1, 4-2

FM 450-1 Counter Function Module


C79000-G7076-C450-01 Index-1
Index

G P
Gate stop function, 9-8, 9-10, 9-18 Parameter assignment screen forms
calling, 5-2
installing, 5-2
H integral help function, 5-2
Periodic counting, 2-4
Hardware gate, 2-5
Process interrupt, 1-2, 9-24
edge-controlled opening and closing, 9-17
enabling, 9-24
level-controlled opening and closing, 9-16
initiate, 9-24
status, 9-17
OB 40, 9-24
Hysteresis, 1-3
Pulse duration
default value, 9-15
value range, 9-15
I
Input delay, 4-6
Input filter, 4-6 Q
Internal faults, 13-2
Q0. Siehe Digital outputs
Q1. Siehe Digital outputs
Quadruple evaluation, 10-7
L
Labeling strips, 1-6
LEDs, meaning, 1-6 R
Load value, 1-2, 2-2, 9-19
READ ME file, 5-2
RESET status, 4-11
M
Main application area, 1-4 S
Marking, CE, A-2
Selecting the gate function, 9-5, 9-7, 9-9
SET, 9-19
Siehe auch Digital inputs
O Setting the counter
OB 40, 9-24 via the user program, 9-19
OB 4x, start information, 9-25 with an external signal, 9-19
OB82, 13-3 with input I2, 9-20
Opening and closing the hardware gate, 9-10 with the zero mark, 9-22
Opening and closing the software gate, 9-5, 9-7, Setting: behavior of the digital outputs, 9-12
9-9 Setting: counting mode, 9-11
Operating mode “continuous counting”, 9-5 Setting: pulse duration, 9-15
Operating mode “periodic counting”, 9-9 Settings, 9-2
Operating mode “single counting”, 9-7 select, 9-4
Operating modes, 9-2 Single counting, 2-3
select, 9-4 Software gate
Operator errors, 13-7 opening and closing, 9-18
Order number, 1-5 status, 9-18

FM 450-1 Counter Function Module


Index-2 C79000-G7076-C450-01
Index

START. Siehe Digital inputs V


Starting address, 3-2
Version, 1-5
Starting value, 1-2
View of module, 1-5
Status bits, 9-4
Voltage supply, of the encoders, 4-5
STOP. Siehe Digital inputs
Symmetric encoders, 10-3
Z
U Zero pass, 9-11
UL, A-1

FM 450-1 Counter Function Module


C79000-G7076-C450-01 Index-3
Index

FM 450-1 Counter Function Module


Index-4 C79000-G7076-C450-01
Siemens AG
AUT E 146

Östliche Rheinbrückenstr. 50
D–76181 Karlsruhe
Federal Republic of Germany

From:
Your Name: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Your Title: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Company Name: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Street: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
City, Zip Code_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Country: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Phone: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Please check any industry that applies to you:

❒ Automotive ❒ Pharmaceutical
❒ Chemical ❒ Plastic
❒ Electrical Machinery ❒ Pulp and Paper
❒ Food ❒ Textiles
❒ Instrument and Control ❒ Transportation
❒ Nonelectrical Machinery ❒ Other _ _ _ _ _ _ _ _ _ _ _
❒ Petrochemical

FM 450-1 Counter Function Module


C79000-G7076-C450-01 1
Remarks Form
Your comments and recommendations will help us to improve the quality and usefulness
of our publications. Please take the first available opportunity to fill out this questionnaire
and return it to Siemens.

Please give each of the following questions your own personal mark within the range
from 1 (very good) to 5 (poor).
1. Do the contents meet your requirements?
2. Is the information you need easy to find?
3. Is the text easy to understand?
4. Does the level of technical detail meet your requirements?
5. Please rate the quality of the graphics/tables:
6.
7.
8.

Additional comments:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

FM 450-1 Counter Function Module


2 C79000-G7076-C450-01

Vous aimerez peut-être aussi