Anda di halaman 1dari 160

Preface, Contents User Information Product Overview How the FM 350 Counts

1 2 3 4 5 6 7 8

SIMATIC FM 350 Counter Function Module Installation and Parameter Assignment


Manual

Installing and Removing the FM 350 Wiring the FM 350 Assigning Parameters to the FM 350 Programming the FM 350 Programming in M7 with the Counter Function Library Starting Up the FM 350 Reference Information Operating Modes, Settings, Parameters and Commands Encoder Signals and Their Evaluation DB Assignments M7 Reference Counter Function Library Faults and Diagnostics Appendices Technical Specifications Spare Parts

9 10 11 12 13

A B C

C79000-G7076-C350-01 References 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 systems 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 not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved.
Siemens AG Automation Group Industrial Automation Systems Postfach 4848, D-90327 Nrnberg

We have checked the contents of this manual for agreement with the hardware and software described. Since deviations cannot be precluded entirely, we cannot guarantee full agreement. However, the data in this manual are reviewed regularly and any necessary corrections included in subsequent editions. Suggestions for improvement are welcomed.
E Siemens AG 1996 Technical data subject to change.

Siemens Aktiengesellschaft

Order No. C79000-G7076-C350

ii

FM 350 Counter Function Module C79000 G7076 C350 01

Preface

Purpose

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

Contents of This Manual

This manual describes the hardware and software of the FM 350. It consists 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 350 S Wiring the FM 350 S Assigning parameters to the FM 350 S Programming the FM 350 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 Manual This manual contains the description of the FM 350 function module valid at the time of publication of the manual. We reserve the right to describe any subsequent changes in the functionality of the FM 350 in a Product Information.

Other References

You will find a list of other references on the topic of the S7-300 and programmable controllers in the appendix.

FM 350 Counter Function Module C79000-G7076-C350-01

iii

Preface

Structure of This Manual

To make it easier for you to locate specific information, the manual has been 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 the left margin gives an


overview 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-300/M7-300 programmable controller conforms to the IEC 1131 standard.

Additional Assistance

If the manual fails to answer any questions concerning products described in 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 S7300 Programmable Controller, Installation and Hardware manual and the M7300 Programmable Controller, Installation and Hardware 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 reply 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.

iv

FM 350 Counter Function Module C79000-G7076-C350-01

Contents
1 Product Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 1.2 1.3 1.4 2 What Can the FM 350 Do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Application Areas of the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FM 350 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FM 350 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1-2 1-4 1-5 1-7 2-1 2-2 2-5 3-1 3-2 3-3 4-1 4-2 4-7 4-10 5-1 5-2 6-1 6-2 6-5 6-6 6-8 7-1 7-2 7-4 7-5 7-7 7-8 7-9

How the FM 350 Counts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 2.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Installing and Removing the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 3.2 Preparing the Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing and Removing the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Wiring the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 4.2 4.3 Terminal Assignments of the Front Connector . . . . . . . . . . . . . . . . . . . . . . . . Wiring the Front Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module Status After Switching On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Assigning Parameters to the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 Installing and Calling Parameter Assignment Screen Forms . . . . . . . . . . .

Programming the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 6.2 6.3 6.4 The FC CNT_CTRL Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The FC DIAG_INF Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Application Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Technical Specifications of the Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Programming in M7 with the Counter Function Library . . . . . . . . . . . . . . . . . . . . . 7.1 7.2 7.3 7.4 7.5 7.6 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initializing and Parameterizing the Counter Channel . . . . . . . . . . . . . . . . . . Transferring the Load Value and Comparison Values . . . . . . . . . . . . . . . . . Control of the Digital Inputs and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting and Stopping the Counter Channel . . . . . . . . . . . . . . . . . . . . . . . . .

FM 350 Counter Function Module C79000-G7076-C350-01

Contents

7.7 7.8 7.9 8

Reading the Counter Value and the Load Value, Scanning and Resetting the Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Processing Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Processing Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7-10 7-11 7-12 8-1 8-2 8-4 9-1 9-2 9-4 9-5 9-7 9-9 9-11 9-12 9-15 9-16 9-19 9-24 10-1 10-2 10-3 10-4 10-6 11-1 12-1 12-2 12-3 12-4 12-5 12-6 12-8 12-9

Starting Up the FM 350 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 8.2 Mechanical Installation Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parameter Assignment Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Operating Modes, Settings, Parameters and Commands . . . . . . . . . . . . . . . . . . . 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 9.10 9.11 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic Information on Calling Operating Modes, Settings and Commands Continuous Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Single Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Periodic Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting: Counting Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting: Behavior of the Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting: Pulse Duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command: Open and Close Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command: Set Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initiating a Process Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

Encoder Signals and Their Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 10.2 10.3 10.4 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 V Differential Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 V Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pulse Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11 12

DB Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7 Reference Counter Function Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 M7CntDisableOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7CntDisableSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7CntEnableOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7CntEnableSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7CntInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7CntLoadAndStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M7CntLoadComp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

M7CntLoadDirect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-11 M7CntLoadPrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12

vi

FM 350 Counter Function Module C79000-G7076-C350-01

Contents

12.10 12.11 12.12 12.13 12.14 12.15 12.16 12.17 12.18 12.19 12.20 12.21 12.22 12.23 13

M7CntPar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13 M7CntRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-15 M7CntReadDiag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16 M7CntReadLoadValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-17 M7CntReadParError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18 M7CntReadStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19 M7CntResetStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-20 M7CntStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-21 M7CntStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-22 M7CntStopAndRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-23 M7CNT_DIAGINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24 M7CNT_PARAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-25 M7CNT_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-28 Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-29 13-1 13-2 13-3 13-6 13-7 A-1 A-3 B-1 C-1

Faults and Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13.1 13.2 13.3 13.4 Fault Indication via the Group Error LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initiation of Diagnostics Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operator Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Technical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.1 Technical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

B C

Spare Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FM 350 Counter Function Module C79000-G7076-C350-01

vii

Contents

viii

FM 350 Counter Function Module C79000-G7076-C350-01

Product Overview

This Chapter...

This chapter gives you an overview of the FM 350 function module.

S You will learn what the FM 350 can do. S You will become familiar with the application areas of the FM 350
through examples.

S You will learn how the FM 350 is linked into the S7-300/M7-300 programmable controller and you will become familiar with the most important components of the FM 350. Chapter Overview
Section 1.1 1.2 1.3 1.4 Contents What Can the FM 350 Do? Application Areas of the FM 350 FM 350 Hardware FM 350 Software Page 1-2 1-4 1-5 1-7

FM 350 Counter Function Module C79000-G7076-C350-01

1-1

Product Overview

1.1

What Can the FM 350 Do?

What Can the FM 350 Do?

The FM 350 function module is a high-speed counter module for use in the S7-300/M7-300 programmable controller. There is one counter on the module that 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 depending on the encoder signal. You can use the FM 350 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 Values

You can store two comparison values on the module assigned 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 350 for each counter. The counter is set to the starting value if a software or hardware signal is present at the module.

Process Interrupts

The FM 350 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 Interrupts

The FM 350 can trigger a diagnostics interrupt if any of the following occur:

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

1-2

FM 350 Counter Function Module C79000-G7076-C350-01

Product Overview

Pulse Duration

You can specify a pulse duration for the digital outputs of the FM 350. 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 applies for both outputs. You can adapt the FM 350 to existing actuators by specifying a pulse duration.

Which Signals Can the FM 350 Count?

The FM 350 can count signals generated by the following encoders:

S Incremental 5 V encoders 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 filters (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 Typical input delay Maximum counting frequency Minimum pulse width of the count signals Input Filter 1 (Default) 1 ms 200 kHz 2.5 ms Input Filter 2 15 ms 20 kHz 25 ms

FM 350 Counter Function Module C79000-G7076-C350-01

1-3

Product Overview

1.2

Application Areas of the FM 350

Where Can You Use the FM 350?

The main application area of the FM 350 is where signals with high frequencies are counted and high-speed responses have to be triggered to predefined counter statuses. Examples include:

S Packaging plants S Sorting plants S Dosing or proportioning plants.


Example for the Use of an FM 350 In this example, a carton must be filled with a specific number of parts. One counter of the FM 350 counts the parts and controls the motor for transporting 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 350 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 350-1

Belt A Motor Light barrier Motor

Gate Belt B

Figure 1-1 Example for Using an FM 350 in the S7-300

1-4

FM 350 Counter Function Module C79000-G7076-C350-01

Product Overview

1.3

FM 350 Hardware

View of Module

Figure 1-2 shows the FM 350 module with a front connector and the expansion bus with the front panel closed.

Type plate Front connector with front connector coding Diagnostics and status LEDs

Coding connector

Expansion bus SIMATIC interface Labeling strips

Order number Figure 1-2 FM 350 Module View

Version

Front Connector

The FM 350 offers the following connection possibilities via the front connector:

S 5 V or 24 V encoder signals S Encoder supply S Digital input signals for starting, stopping and setting the counter S Digital output signals Q0 and Q1 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 Coding

When you press the front connector from the wiring position to the operating position, the front connector coding engages. Thereafter, this front connector can only be attached to an FM 350 module.

FM 350 Counter Function Module C79000-G7076-C350-01

1-5

Product Overview

Coding Connector

The coding connector is used to set the FM 350 to the encoder signals used. The following settings are possible:
Coding Connector at Setting... A D ...Corresponds to the Following Encoder Signals 5 V differential signals (state as supplied) 24 V signals

The coding connector is located on the left side of the FM 350. The pin assignments are printed on the inside of the front panel.

Labeling Strips

Enclosed with the module is a labeling strip on which you can write your relevant signal names.

Order Number and Version

The order number and the version of the FM 350 are given at the bottom of the front panel.

Expansion Bus

Communications within one tier of the S7-300/M7-300 takes place over the expansion bus. The expansion bus is supplied with the FM 350.

Status and Diagnostics LEDs

The FM 350 has eight LEDs that can be used both for diagnostics and for indicating the status of the FM 350 and its digital inputs and outputs. Table 1-2 lists the LEDs with their labeling, color and function.
Table 1-2 Label SF CR DIR I0 I1 I2 Q0 Q1 Labeling, Color and Function of the LEDs Color Red Green Green Green Green Green Green Green Group error Counter running; status of the least significant bit of the counter Direction of count; LED lights up, if the counter is counting down Status of input I0 Status of input I1 Status of input I2 Status of output Q0 Status of output Q1 Function

1-6

FM 350 Counter Function Module C79000-G7076-C350-01

Product Overview

1.4

FM 350 Software

FM 350 Software Packages

To integrate the FM 350 into the S7-300, you require a software package with

S Parameter assignment screen forms S Software for the CPU


The software for integrating the FM 350 into the M7-300 is described in Chapters 7 and 12. Parameter Assignment Screen Forms The FM 350 is adapted to the task in hand via parameters. These parameter are stored in an SDB and transferred to the module from the CPU. 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. The software for the CPU consists of the FC CNT_CTRL function called in the user program of the CPU. This FC enables communication between the CPU and the FM 350. In addition, there is also the FC DIAG_INF function for the FM 350, with which you can transfer diagnostics information into the DB of the FC CNT_CTRL. Figure 1-3 shows an S7-300 configuration with an FM 350 and several signal modules.

Software for the S7-300-CPU

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

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

FM 350-1

Figure 1-3 SIMATIC S7-300 Configuration with an FM 350

FM 350 Counter Function Module C79000-G7076-C350-01

1-7

Product Overview

1-8

FM 350 Counter Function Module C79000-G7076-C350-01

How the FM 350 Counts

2
Contents Page 2-2 2-5

This Chapter...

This chapter contains explanations of the most important terms for counting with the FM 350.
Section 2.1 2.2 Definitions Gate Functions

Chapter Overview

FM 350 Counter Function Module C79000-G7076-C350-01

2-1

How the FM 350 Counts

2.1

Definitions

What is Counting?

2
Count Range, Count Limits

Counting refers to the process of capturing and summing up events. In the case of the FM 350 function module, encoder signals are captured and evaluated accordingly.

The FM 350 can count up and down. By selecting the count range, you define the limits within which the FM 350 can count.
Count Range Count range 1: 32 bits Count range 2: + 31 bits 0 2,147,483,648 Lower Count Limit Upper Count Limit + 4,294,967,295 + 2,147,483,647

Load Value

You can specify a starting value to the FM 350 with which the count is to be started. 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 Values

In order to be able to trigger responses in the process independently of the CPU when a specific counter status is reached, you can use the two digital outputs on the module. You store two comparison values on the FM 350. If the counter status reaches either of the two comparison values, the associated digital output 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 purpose, you can specify this number to the FM 350 as the comparison value and use the associated digital output to stop the motor.

Three Different Counting Methods

With the FM 350, you can count rectangular pulses in three different ways:

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 350 when a counter has reached a count limit.

2-2

FM 350 Counter Function Module C79000-G7076-C350-01

How the FM 350 Counts

Continuous Counting

If a counter reaches the upper limit when counting up, and if another count 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.
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 further count pulses come.
Counter status Upper count limit Load value Lower count limit Time Figure 2-2 Single Counting in the Up Direction

FM 350 Counter Function Module C79000-G7076-C350-01

2-3

How the FM 350 Counts

Periodic Counting

In periodic counting, the counter starts from the load value. When the counter reaches the upper counting 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. 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

2-4

FM 350 Counter Function Module C79000-G7076-C350-01

How the FM 350 Counts

2.2

Gate Functions

Counting with Gate Functions

Many applications require that the count be started or stopped at a defined time depending on other events. This starting and stopping of the count is done in the case of the FM 350 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 Hardware Gate

The module has two gate functions for each counter

S A software gate controlled via the user program in the CPU. S A hardware gate controlled via digital inputs I0 and I1 on the module.
When assigning parameters to the FM 350, 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 signal. 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 Count pulses Gate signal Open gate 2 3 4 4

Close gate

Figure 2-4

Opening and Closing a Gate

Terminating a Count with the Gate Stop Function

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

FM 350 Counter Function Module C79000-G7076-C350-01

2-5

How the FM 350 Counts

2-6

FM 350 Counter Function Module C79000-G7076-C350-01

Installing and Removing the FM 350

This Chapter...

This chapter contains information on installing and removing the FM 350.

S You will learn what you must look out for when installing. You will get
notes and hints on configuring, arranging and installing an FM 350.

S You will learn, step-by-step, how to install and remove an FM 350.


Chapter Overview
Section 3.1 3.2 Contents Preparing the Installation Installing and Removing the FM 350 Page 3-2 3-3

FM 350 Counter Function Module C79000-G7076-C350-01

3-1

Installing and Removing the FM 350

3.1

Preparing the Installation


The 350 function module can be installed like a signal module in any of slots 4 to 11. Manual /1/ describes the possibilities open to you for mechanical installation and how to proceed when configuring. The following gives only a few supplementary notes. 1. A maximum of eight SMs or FMs are permissible per rack. 2. The maximum number is restricted by the width of the modules or the length of your DIN rail. The FM 350 requires an installation width of 40 mm. 3. The maximum number is restricted by the total current consumptions of all modules to the right of the CPU from the 5 V backplane bus supply. The current consumption of the FM 350 is 160 mA. 4. The maximum number is restricted by the memory required by the CPU software for communications with the FM 350.

Defining the Slots

Mechanical Configuration

Vertical or Horizontal Arrangement Determining the Starting Address

Horizontal arrangement is preferable. For vertical arrangement, you must observe the restricted ambient temperatures (max. 40C).

The starting address of the FM 350 is required for communications between the CPU and the FM 350. 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 can determine the starting address of the FM 350 in accordance with the rules used to determine the starting address of an analog module.

Fixed Addressing

In the case of fixed addressing, the starting address depends on the slot. See the tables in Manual /1/ for the starting address of an analog module on the different slots. You can also calculate this fixed starting address using the following formula: Addr. = 256 +(mounting rack no. *128)+(slot no. 4)*16

Free Addressing

With free addressing, you specify the starting address of the module using STEP 7.

Important Safety Rules

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

3-2

FM 350 Counter Function Module C79000-G7076-C350-01

Installing and Removing the FM 350

3.2

Installing and Removing the FM 350

Rules

No special protection measures (ESD guidelines) are required for installing an FM 350.

Tools Required

You require a 4.5 mm screwdriver for installing and removing the FM 350.

Setting the Counter Signals (Coding Connector)

Before you install an FM 350 on the DIN rail, you must set the coding connector to the correct position. Table 3-1 assigns the position of the coding connector to the counter signals used. (See also /1/.)
Table 3-1 Possible Positions of the Coding Connector Signal Type 5 V differential signals 24 V signals

Position of the Coding Connector A D

The letter of the coding connector must point to the arrow.

Figure 3-1

Installing the Coding Connector

FM 350 Counter Function Module C79000-G7076-C350-01

3-3

Installing and Removing the FM 350

Installation Procedure

Below is a description of how to proceed when installing the FM 350 on the DIN rail. You will find further notes on installing modules in manual /1/. 1. Switch the CPU to the STOP state. 2. The FM 350 is supplied with an expansion bus. Plug this into the bus connector of the module to the left of the FM 350. (The bus connector is located on the back and you may have to loosen the neighboring module.)

3. Hang the FM 350 onto the rail and swing it down. 4. Tighten the screw on the FM 350 (tightening torque approximately 0.8 to 1.1 Nm). If further modules are to be installed to the right of the FM 350, first connect the expansion bus of the next module to the right-hand backplane bus connector of the FM 350. If the FM 350 is the last module in the rack, do not connect an expansion bus! 5. Label the FM 350 with its slot number. Use the number wheel supplied with the CPU for this purpose. Manual /1/ describes the numbering scheme you must use and how to connect the slot numbers. 6. Install the shield attachment.

Procedure for Disassembling/ Changing Modules

Below is a description of how to dismantle the FM 350. You will find further notes on disassembling modules in manual /1/. 1. Switch off the auxiliary voltage and the load voltage at the front connector. 2. Switch the CPU to the STOP state. 3. Open the front panel. If necessary, remove the labeling strip. 4. Release the front connector and pull it out. 5. Loosen the fixing screw on the module. 6. Swing the module out of the DIN rail and unhook it. 7. Install the new module if applicable.

Further Notes

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

3-4

FM 350 Counter Function Module C79000-G7076-C350-01

Wiring the FM 350

This Chapter...

This chapter contains the following information on wiring the FM 350:

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 Overview
Section 4.1 4.2 4.3 Contents Terminal Assignments of the Front Connector Wiring the Front Connector Module Status After Switching On Page 4-2 4-7 4-10

FM 350 Counter Function Module C79000-G7076-C350-01

4-1

Wiring the FM 350

4.1

Terminal Assignments of the Front Connector


You connect the count signals, the digital inputs and outputs, the encoder supply and the auxiliary voltage and load voltage via the 20-pin front connector. Figure 4-1 shows the front of the module, the front connector and the inside of the front panel with the pin assignments.

Front Connector

4
Front of the module
FM 350
COUNTER MODULE

Front connector

Inside of the front panel

SF CR DIR

1 2 3 4 5 6 7 8 9 1 0

1 2 3 4 5 6 7 8 9 10 1L+ 1M 1M DC 5,2 V SUPPLY DC 24 V A A* A B B* B N N*

1 1 I0 I1 I2 1 1 1 1 Q0 Q1 1 1 1 2 350AH00-0AE0

1 2 3 4 5 6 7 8 9 0

11

13 14 15

17 18 19 20 2 L+ 2M

Figure 4-1 Front Connector of the FM 350

4-2

FM 350 Counter Function Module C79000-G7076-C350-01

Wiring the FM 350

Front Connector Assignments


Table 4-1 Connecnec tion

Table 4-1 shows the front connector assignments.

Front Connector Assignments Name Input / OutOut put Function 5 V encoder RS 422, symmetric 24 V encoder, asymmetric 24 V pulse generator with direction level 24 V initiator

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

1L+ 1M 1M DC5,2V DC24V A A* A B B* B N N* N I0 I1 I2 Q0 Q1 2L+ 2M

INP INP OUTP OUTP OUTP INP INP INP INP INP INP INP INP INP OUTP OUTP INP INP Encoder signal A Encoder signal A Encoder signal B Encoder signal B Encoder signal N Encoder signal N

24 V auxiliary voltage Auxiliary voltage ground Encoder supply ground 5.2 V encoder supply 24 V encoder supply Encoder signal A* Encoder signal B* Direction signal Encoder signal N* Digital input I0 Digital input I1 Digital input I2 Digital output Q0 Digital output Q1 24 V load voltage Load voltage ground for the digital inputs and outputs

Note The circuits for the counter inputs (encoder supply, encoder signals) are nonisolated to the ground of the CPU, that is, terminal 2 (1M) must have a lowresistance 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 350 Counter Function Module C79000-G7076-C350-01

4-3

Wiring the FM 350

Auxiliary Voltage 1L+, 1M

Connect a direct voltage of 24 V to the 1L+ and 1M terminals for the voltage 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 Supply

4
24 VDC Encoder Supply

The module generates a voltage of 5.2 V from the auxiliary voltage 1L+/1M at a maximum current of 300 mA that is available at the 5.2 VDC connection for the short-circuit-proof supply of a 5 V encoder. The encoder supply is checked for short-circuit.

For the 24 V voltage supply of an encoder, the voltage 1L+/1M is made available and short-circuit proof at the 24 VDC output. The encoder supply is monitored for short-circuit.

5 V Encoder Signals A, A, B, B, N and N

You can connect incremental encoders with 5 V differential signals to the front connector in accordance with RS 422, that is, incremental encoders with the 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 on page 4-3).

24 V Encoder Signals A*, B* and N*

24 V signals are represented by the letters A*, B* and N*. You can connect three different encoder types to each counter:

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 connected to terminal B*. The inputs are not galvanically isolated from the S7-300 bus (see note on page 4-3).

Input Filter for 24 V Encoder Signals

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

4-4

FM 350 Counter Function Module C79000-G7076-C350-01

Wiring the FM 350

Table 4-2

Input Filters for 24 V Encoder Signals Features Input Filter 1 (Default) 1 ms 200 kHz 2.5 ms Input Filter 2

Typical input delay Maximum counting frequency Minimum pulse width of the count signals

15 ms 20 kHz 25 ms

4
Digital Inputs I0, I1 and I2 You can use the digital inputs I0 and I1 for the gate control of the counter. The gate control can be both level-controlled and edge-controlled (see Chapter 9). Digital input I2 is used for setting the counter 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 of the S7-300 and the counter inputs.

Input Filter for Digital Inputs

For the purpose of suppressing interference, you can parameterize input filters (RC elements) with a uniform filter time for digital inputs I0, I1 and I2. The following two input filters are available.
Table 4-3 Input Filters for Digital Inputs Features Typical input delay Maximum frequency of the input signals Minimum pulse width of the input signals Input Filter 1 (Default) Input Filter 2

1 ms 200 kHz 2.5 ms

15 ms 20 kHz 25 ms

Digital Outputs Q0 and Q1

The FM 350 has the two digital outputs Q0 and Q1 for direct triggering of control actions. The digital outputs are supplied with the 2L+ load voltage. The digital outputs are galvanically isolated from the S7-300 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. Note Relays and contactors can be connected direct without external circuitry.

FM 350 Counter Function Module C79000-G7076-C350-01

4-5

Wiring the FM 350

The time characteristics of the digital outputs depend on the parameterization and are explained in more detail in Chapter 9 Setting: Behavior of the Digital Outputs.

Load Voltage 2L+/ 2M

For supplying the digital outputs Q0 and Q1, the module must be supplied with a load voltage of 24 V via terminals 2L+ and 2M. An integral diode protects the module from polarity reversal of the load voltage. The load voltage 2L+/2M is not monitored by the FM 350.

4-6

FM 350 Counter Function Module C79000-G7076-C350-01

Wiring the FM 350

4.2

Wiring the Front Connector

Cables

There are some rules for you to observe when selecting cables:

S The cables for digital inputs I0, I1 and I2 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 attachment, 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 to shield attachment Front connector 6 7 8 9 10 11 4 3 A A B B N N DC5.2V 1M

Shield to housing

Twisted conductors Figure 4-2 Connecting an Incremental 5 V Encoder

Terminal 2 (1M) of the front connector must have a low-resistance connection 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.

FM 350 Counter Function Module C79000-G7076-C350-01

4-7

Wiring the FM 350

Figure 4-3 shows details of connecting incremental 24 V encoders.

Shield to shield attachment Front connector A* B* N* DC24V 1M

Shield to housing

8 10 5 3

Figure 4-3 Connecting an Incremental 24 V Encoder

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.

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!

4-8

FM 350 Counter Function Module C79000-G7076-C350-01

Wiring the FM 350

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 350 when the power is switched on, you are in danger of injury from electric shock. Wire the FM 350 only when the power is switched off!

1. Set the front connector to the wiring position and open the front panel. 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. If the wires leave the module at the bottom, begin wiring at the bottom, otherwise begin at the top. Also tighten unassigned terminals (tightening torque 0.6 to 0.8 Nm). 6. Tighten the strain relief clamp for the cable chain. 7. Push the front connector into the operating position. 8. Apply the cable shields to the shield attachment or to the shield bar. 9. Label the terminals on the labeling strip. Figure 4-4 shows the module with shielded cables and shield attachment.

Figure 4-4 Connecting the Shielded Cables to the FM 350

FM 350 Counter Function Module C79000-G7076-C350-01

4-9

Wiring the FM 350

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 features:

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 S Setting the counter with input I2 (and zero mark) disabled S Input delay for digital inputs I0, I1 and I2: typically 1 ms
(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 Q0 and Q1 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
RESET Status This module status (default setting) is also referred to as the RESET status.

4-10

FM 350 Counter Function Module C79000-G7076-C350-01

Assigning Parameters to the FM 350

5
Page 5-2

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 350.

Chapter Overview

Section 5.1

Contents Installing and Calling Parameter Assignment Screen Forms

FM 350 Counter Function Module C79000-G7076-C350-01

5-1

Assigning Parameters to the FM 350

5.1

Installing and Calling Parameter Assignment Screen Forms


The following conditions apply for transferring parameter assignment data to 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-300 modules during data exchange over the MPI!

Marginal Conditions

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 Create a copy of each original diskette and install the parameter assignment 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. Call the SETUP.EXE program on the backup copy of your installation diskette. This installs not only the parameter assignment screen forms but also FC CNT_CTRL and the FC DIAG_INF on your programming device. The FCs are inserted in the standard library in the catalog FM_CNT_L. Follow the instructions displayed in the SETUP menu on the screen. During installation, a detailed example program is inserted in the FM_ZAEHL project in the Examples sub-catalog of the STEP 7 catalog. The READ ME file may contain important up-to-date information concerning the software supplied. You can read this file with the WORDPAD Editor under Windows. The parameter assignment screen forms are displayed automatically after a successful installation, if you parameterize the FM 350 within the hardware configuration. There is an integral Help function for the parameter assignment screen forms that you can call in any phase of parameter assignment either with the F1 key or with the Help button.

Creating a Backup Diskette

Installing the Parameter Assignment Screen Forms

Example Program

Reading the READ ME File

Calling the Parameter Assignment Screen Forms Calling the Integral Help Function

5-2

FM 350 Counter Function Module C79000-G7076-C350-01

Programming the FM 350

This Chapter...

This chapter contains all the information necessary for programming the FM 350 in the S7-300. For linking the FM 350 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.

Chapter Overview

FM 350 Counter Function Module C79000-G7076-C350-01


Block Number Block Name Meaning FC 0 FC 1 CNT_CTRL DIAG_INF Controlling the counters of the FM 350 Read diagnostics data set 1 from the FM 350

In addition, use of the blocks is illustrated in an example program. The example program shows block calls and contains the necessary data block.
Section 6.1 6.2 6.3 6.4 Contents The FC CNT_CTRL Function The FC DIAG_INF Function Application Example Technical Specifications of the Blocks

Page 6-2 6-5 6-6 6-8

6-1

Programming the FM 350

6.1

The FC CNT_CTRL Function


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 350, the following valid data must be assigned to the DB of the FC CNT_CTRL:

Prerequisite

S Module address
You set the module address (base address of the FM 350) when configuring your hardware.

6
Example

S Channel address
The channel address is the same as the module address in pointer format.

S User data length


The user data length is 16. 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:
FM350_DB DB 1 DB with the counter data

Program the transfer as follows in STL:


STL Description

L T L T L T

512 FM350_DB.MOD_ADR P# 512.0 FM350_DB.CH_ADR 16 FM350_DB.U_D_LGTH

// Module address = 512 // Transfer of module address // Module address in pointer format // Transfer of the channel address // User data length = 16 // Transfer of the user data length

Call

The FC CNT_CTRL can be called either cyclically or in a time-controlled program. Calling FC CNT_CTRL in an interrupt program is not permissible.

6-2

FM 350 Counter Function Module C79000-G7076-C350-01


FC CNT_CTRL Parameters
Table 6-1 T_CMP_V2 T_CMP_V1 L_PREPAR L_DIRECT OT_ERR OT_ERR_A GATE_STP SW_GATE DB_NO Name FC CNT_CTRL Parameters IN-OUT IN-OUT IN-OUT IN-OUT OUTPUT INPUT INPUT INPUT INPUT Declaration Type


CALL

FM 350 Counter Function Module C79000-G7076-C350-01

STL method of representation

CNT_CTRL,(

RES_ZERO

RES_SYNC

T_CMP_V2

T_CMP_V1

L_PREPAR

L_DIRECT

OT_ERR

OT_ERR_A

GATE_STP

SW_GATE

DB_NO

Table 6-1 lists the FC CNT_CTRL parameters

The FC CNT_CTRL call in the STL and LAD methods of representation is given below.

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

BLOCK_DB

Data Type

:=

:=

:=

:=

:=

:=

:=

:=

:=

:=

:=

Initiation bit for transfer Comparison value 2

Initiation bit for transfer Comparison value 1

Initiation bit for Preparatory loading of a counter

Initiation bit for direct loading of a counter

Operator error occurred

Acknowledge operator error

Counter control bit Gate stop

Counter control bit SW gate (start/stop)

Number of the data block with the counter data

Meaning

RES_ZERO

RES_SYNC

T_CMP_V2

T_CMP_V1

L_PREPAR

L_DIRECT

OT_ERR_A

GATE_STP

SW_GATE

DB_NO

EN

LAD method of representation

sets this

sets this

sets this

sets this

scans this

sets and resets this

sets and resets this

sets and resets this

enters this

Programming the FM 350

The User...

CNT_CTRL

scans and resets this

scans and resets this

scans and resets this

scans and resets this

sets and resets this

scans this

scans this

scans this

scans this

The Block...

OT_ERR

ENO

6-3

Programming the FM 350

6
Restart Characteristics


Name Declaration Type Data Type Meaning The User... The Block... RES_SYNC RES_ZERO IN-OUT IN-OUT BOOL BOOL Delete Synchronization status bit Delete Zero pass status bit

Table 6-1

FC CNT_CTRL Parameters, Continued

sets this
sets this

scans and resets this scans and resets this

You make a job request for the FM 350 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 DB before calling the FC. 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.

As soon as the FC CNT_CTRL detects a restart (CPU restart or FM restart), 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. 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.

Error Messages

6-4

FM 350 Counter Function Module C79000-G7076-C350-01

Programming the FM 350

6.2

The FC DIAG_INF Function

Functionality

The FC DIAG_INF function reads data set DS1 from the FM 350 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 350.

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 parameter of the FC DIAG_INF.

S As soon as the function has been executed, the IN_DIAG initiation parameter is reset and the transfer is reported to be complete. Manual /2/ contains a full description of the SFC RD_REC.

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 representation below.


STL method of representation
CALL DIAG_INF( DB_NO

LAD method of representation


DIAG_INF

:=

, ,

RET_VAL IN_DIAG

:= :=

EN

ENO

);

DB_NO

RET_VAL

IN_DIAG

FC DIAG_INF Parameters
Table 6-2 Name

Table 6-2 lists the FC DIAG_INF parameters.

FC DIAG_INF Parameters Declaration Type Data Type Meaning The User... The Block...

DB_NO

INPUT

BLOCK_DB WORD BOOL

Number of the FC CNT_CTRL data block

enters this scans this

scans this

RET_VAL IN_DIAG

OUTPUT IN-OUT

Returncode of the SFC 59

enters this resets this

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

FM 350 Counter Function Module C79000-G7076-C350-01

6-5

Programming the FM 350

6.3

Application Example

Introduction

The example below shows how the FC CNT_CTRL can be used for the functions Transfer load value to FM 350 and Start counter. These functions are representative of all functions here.

STL L T +1000; CHANNEL1.LOAD_VAL;

Explanation // Enter load value in // the DB 1.

A S

INITIATE; LOAD_DIRECT; INITIATE; // DIRECT input parameter

CALL

CNT_CTRL, ( DB_NO SW_GATE GATE_STP OT_ERR_A OT_ERR L_DIRECT L_PREPAR T_CMP_V1 T_CMP_V2 RES_SYNC RES_ZERO :=CHANNEL 1 :=START, :=GATE_STOP, :=ERR_ACKN, :=OPERATOR_ERR, :=LOAD_DIRECT, :=LOAD_INDIRECT, :=COMP1_LOAD, :=COMP2_LOAD, :=RES_SYNCHRO, :=RES_ZERO);

// FC call with the DB 1 // Channel 1 // Control software gate // Stop gate // Acknowledge operator error // Operator error occurred // Load new counter value // Prepare new counter value // Load new comparison value 1 // Load new comparison value 2 // Delete synchronization status bit // Delete zero pass status bit // If no error has occurred, // CONTinue // *** Error evaluation START ***

AN JC

OPERATOR_ERR; CONT;

L T SET S ... JU CONT: .. AN S END:

CHANNEL1.OT_ERR_B; OUTPUT;

// Read and display additional // information. // Generate RLO 1

ERR_ACKN

// Acknowledge error // Further error response

END;

// ***Error evaluation END *** // Continue with normal execution

LOAD_DIRECT; START;

// Load direct function is ready // Open software gate;

6-6

FM 350 Counter Function Module C79000-G7076-C350-01

Programming the FM 350

Description of the Symbols


Table 6-3

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

Symbols in the Example Symbol Absolute (Example) Comments


CHANNEL1 DB 1 Data block for FC CNT_CTRL CHANNEL1.LOAD_VAL DB1.DBB14 INITIATE M 10.0 Counter value specified in DB1 Initiation memory bit generated as a result of the technological requirement Load counter value direct Start counter LOAD_DIRECT START M 20.0 M 20.1 M 20.2 M 20.3 M 20.4 M 20.5 M 20.6 M 20.7 M 21.0 M 21.1 GATE_STOP ERR_ACKN Close counter gate Acknowledge operator error LOAD_INDIRECT COMP1_LOAD COMP2_LOAD Preparatory loading of counter value Load comparison value 1 Load comparison value 2 RES_SYNCHRON RES_ZERO Reset synchronization status bit Zero pass status bit, reset overflow and underflow Operator error occurred OPERATOR_ERR CHANNEL1.OT_ERR_B DB1.DBX40.0 Operator error information in DB1

Description of the Sequence

When the FC is called, the load value of a channel is transferred to the FM 350. 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 transferred direct 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 parameter 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 350 has accepted the FM 350. 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 350 Counter Function Module C79000-G7076-C350-01

6-7

Programming the FM 350

6.4

Technical Specifications of the Blocks

Technical Specifications Block number Version Assignment in working memory Assignment in load memory

FC CNT_CTRL FC 0 1.0 438 bytes 522 bytes FC 1 1.0

FC DIAG_INF

186 bytes 262 bytes

Assignment in the data area Data block specified at FC call with a length of 67 bytes. Assignment in local data area Approx. 0.85 ms 20 bytes SFC 59 RD_REC Approx. 2.50 ms

System function called Execution time in the CPU 314

6-8

FM 350 Counter Function Module C79000-G7076-C350-01

Programming in M7 with the Counter Function Library

This Chapter...

If you use an FM 350, FM 350 counter module or an IF 961-CT1 interface submodule with a CPU from the M7-300/400 product range, you can create your application in the C programming language. This chapter describes 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 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 Overview Basic Program Structure Initializing and Parameterizing the Counter Channel Transferring the Load Value and Comparison Values Control of the Digital Inputs and Outputs Starting and Stopping the Counter Channel Reading the Counter Value and the Load Value, Scanning and Resetting the Status Processing Interrupts Processing Error Messages Contents Page 7-2 7-4 7-5 7-7 7-8 7-9 7-10 7-11 7-12

FM 350 Counter Function Module C79000-G7076-C350-01

7-1

Programming in M7 with the Counter Function Library

7.1

Overview

Overview of the Functions

The counter function library offers you functions with which you can do the 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 M7CntDisableOut M7CntDisableSet M7CntEnableOut M7CntEnableSet M7CntInit Disable outputs

7-2


Description Disable SET input Enable outputs Enable SET input Initialize counter channel M7CntLoadAndStart M7CntLoadComp Load and start counter channel Transfer comparison values Load counter channel Prepare loading M7CntLoadDirect M7CntLoadPrep M7CntPar Parameterize counter channel Read counter value M7CntRead M7CntReadDiag Read diagnostics information Read load value M7CntReadLoadValue M7CntReadParError M7CntReadStatus Read parameterization error Read counter status M7CntResetStatus M7CntStart M7CntStop Reset counter status Start counter channel 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 parameters or function arguments. Please see Chapter 12 for these.

FM 350 Counter Function Module C79000-G7076-C350-01

Programming in M7 with the Counter Function Library

Programming Environment

All the system functions and standard functions of the M7-300/400 system software are available to you for programming in the Borland C/C++ development 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 software manuals.

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 350 Counter Function Module C79000-G7076-C350-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 requirements 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 Trigger and handle process interrupts. Otherwise, no process interrupts are reported.

1 2 3

6 7 8

9 10

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.

7-4


M7LinkIOAlarm (from M7-API) M7LinkDiagAlarm (from M7-API) M7CntInit M7CntPar Trigger and handle diagnostics interrupts. Otherwise, no diagnostics interrupts are reported. Initialize counter channel (mandatory) Parameterize counter channel via the program. Otherwise, you can parameterize the counter channel under STEP 7 (see Parameter Assignment chapter). Communicate a load value to the counter channel. Otherwise, the counter channel starts with the value 0. Communicate comparison values to the counter channel. Otherwise, the comparison values are at 0. M7CntLoadDirect M7CntLoadComp M7CntEnableOut M7CntStart Enable outputs if you want to use the digital outputs of the counter channel. Start counter channel if you have set an operating mode with software gate. In the case of operating modes with hardware gate, you start the counter channel via the START digital input. Stop counter channel M7CntStop M7CntRead Read counter value, for example, for test purposes or further processing.
FM 350 Counter Function Module C79000-G7076-C350-01

Programming in M7 with the Counter Function Library

7.3

Initializing and Parameterizing the Counter Channel

M7CntInit Initializing the Counter Channel

Counter channels are initialized via the M7CntInit function. The M7CntInit function must be called once for each counter channel used. It assigns a logical 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-dependent 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 doesnt matter which) S Channel number. The channel number can take the following values:
in the FM 350 and IF counters the value is equal to 1 (1 channel) in the FM 350 the value is {1/2} (2 channels) Logical Channel Number The function supplies the logical channel number that you use for all further 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 Counter Channel

Parameterizing sets the counter module to the requirements of your application. 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 parameterized, 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 with STEP 7 You can parameterize the counter module in a user-friendly manner via 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 350 Counter Function Module C79000-G7076-C350-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 Counter Channel with M7CntPar

You can parameterize and reparameterize a counter channel via the user program using the M7CntPar function. You specify the new parameterization 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 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 350.

Parameterization Data

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

7-6

FM 350 Counter Function Module C79000-G7076-C350-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 M7CntLoadPrep

The load value can be transferred direct to the counter channel or it can be stored temporarily in the counter-internal load register. The counter channel can be loaded direct with the M7CntLoadDirect function. 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
Comparison Values You can use the comparison values to control the digital outputs and to trigger 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 parameterization. Appendix A contains a description of the possible settings and their effects. If you control the digital outputs with the comparison values, you must enable 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 350 Counter Function Module C79000-G7076-C350-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 control 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 function. 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 outputs can be enabled with a single function call. The function enables the physical output.

M7CntDisableOut

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

7-8

FM 350 Counter Function Module C79000-G7076-C350-01

Programming in M7 with the Counter Function Library

7.6

Starting and Stopping the Counter Channel

Starting the Counter Channel

Depending on the operating mode, with hardware or software gate control, 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.

M7CntLoadAndStart

In addition, the counter channel can be started via the M7CntLoadAndStart function. When called, this function transfers a load value direct to the counter channel. Like M7CntStart, this function also starts the counter channel via the software gate. 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 Counter Channel

There are two methods of stopping the 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 function 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 parameterization or reparameterization (M7CntPar function) has taken place.

M7CntStopAndRead

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

FM 350 Counter Function Module C79000-G7076-C350-01

7-9

Programming in M7 with the Counter Function Library

7.7

Reading the Counter Value and the Load Value, Scanning and Resetting the Status

Scanning Information

The functions listed below are used for scanning information such as

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 AndRead

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

M7CntRead LoadValue Scanning the Counter Status

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

You can scan the status of the counter channel with the M7CntReadStatus 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 Counter Status

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

7-10

FM 350 Counter Function Module C79000-G7076-C350-01

Programming in M7 with the Counter Function Library

7.8

Processing Interrupts

Registering at the Interrupt Server

Depending on the parameters assigned, the counter module can initiate process interrupts and/or diagnostics interrupts. In order to receive process interrupts 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 Process Interrupts

Your parameter assignments determine if the counter module is to initiate 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 Diagnostics Interrupts If a diagnostics interrupt is signaled by the interrupt server you must evaluate the signal (data set DS0) in order to determine the cause of the interrupt. You can call the following functions from the counter function library to get additional 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 information on the channel error. When the function is called, the diagnostics data set DS1 is read. Data set DS1 contains the additional channel-specific diagnostics 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 ParError

If the cause of the diagnostics interrupt is a parameter assignment error, you 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 illegal value and you can reparameterize the counter module accordingly.

FM 350 Counter Function Module C79000-G7076-C350-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 error 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:

7-12


Return Value Meaning Description in.. 0 No error 1 to 99 Operator error Chapter 13 200 to 400 1 to 999 Parameter assignment error Chapter 13 M7API function error (e.g. System Software for I/O configuration error) M7-300 and M7-400 Reference Manual Error in the counter function library (e.g. channel number invalid) Chapter 13 1000 to 1100
FM 350 Counter Function Module C79000-G7076-C350-01

Starting Up the FM 350

This Chapter...

This chapter contains the checklists for starting up the FM 350. These checklists enable you to:

S check all working steps prior to operating the module S avoid operating faults in the module
Chapter Overview
Section 8.1 8.2 Contents Mechanical Installation Checklist Parameter Assignment Checklist Page 8-2 8-4

FM 350 Counter Function Module C79000-G7076-C350-01

8-1

Starting Up the FM 350

8.1

Mechanical Installation Checklist

Checklist

Use the checklist below to check and document the working steps for mechanical installation of the FM 350.
Options/Procedure Slot 4 to 11 in rack 0 Slot 4 to 11 in rack 1 Slot 4 to 11 in rack 2 Slot 4 to 11 in rack 3 (X)

Working Step Determine slot

Determine counter sig- 5V differential signals nals (coding connector) 24V signals Install FM 350

Position A Position D

1. 2. 3. 4.

Loosen neighboring module and connect expansion bus Hang module into position and tighten screw Attach slot number Install shield attachment

Select cables

Observe rules and specifications in Section 4.2 Incremental 5 V encoder with differential signals A, A, B, B, N and N Terminal 3 4 6 7 8 9 10 11 Name 1M AA* A BB* B NN* N Name 1M 24 VDC AA* BB* NN* Name 1M 24 VDC AA* Name 1M 24 VDC AA* BB* Function Encoder supply ground Encoder signal A Encoder signal A Encoder signal B Encoder signal B Encoder signal N Encoder signal N Function Encoder supply ground 24 V encoder supply Encoder signal A * Encoder signal B * Encoder signal N * Function Encoder supply ground 24 V encoder supply Encoder signal A * Function Encoder supply ground 24 V encoder supply Encoder signal A * Direction level B*

Connect 5 V encoders

5.2 VDC 5.2 V encoder supply

Connect 24 V encoders

Incremental 24 V encoder

Terminal 3 5 6 8 10

24 V pulse encoder without direction level (initiator/BERO)

Terminal 3 5 6 Terminal 3 5 6 8

24 V pulse encoder with direction level

8-2

FM 350 Counter Function Module C79000-G7076-C350-01

Starting Up the FM 350

Working Step Wiring digital inputs and outputs Digital inputs and outputs

Options/Procedure Terminal 13 14 15 17 18 Name START STOP SET Q0 Q1 Name 1L+ 1M 2L+ 2M Function START digital input STOP digital input SET digital input Q0 digital output Q1 digital output Function 24 V auxiliary voltage Auxiliary voltage ground 24 V load voltage Load voltage ground

(X)

Connecting the auxiliary voltage and the load voltage

Auxiliary voltage and load voltage

Terminal 1 2 19 20

FM 350 Counter Function Module C79000-G7076-C350-01

8-3

Starting Up the FM 350

8.2

Parameter Assignment Checklist


Use the checklist below to check and document the working steps for parameterizing the FM 350.
Options/Procedure Select encoders 5 V encoders with symmetric signals Monitoring A+B+N A+B A Non 24 V encoders with asym- Interface metric signals Frequency range/ Minimum pulse width 24 V encoders with pulse train and direction signal Interface Sink output Source output/ push-pull v 200 kHz/w 2,5 ms v 20 kHz/w 25 ms Sink output Source output/ push-pull Frequency range/ Minimum pulse width 24 V initiator Signal evaluation Single Double Quadruple Frequency and direction (for 24 V encoders) Determine operating mode Continuous counting Without gate With software gate With hardware gate Single counting Periodic counting With software gate With hardware gate With software gate With hardware gate Determine counting mode 0 to +32 bits 31 bits to +31 bits v 200 kHz/w 2,5 ms v 20 kHz/w 25 ms (X)

Checklist
Working Step Parameterize the FM 350

8-4

FM 350 Counter Function Module C79000-G7076-C350-01

Starting Up the FM 350

Working Step Parameterize the FM 350

Options/Procedure Determine the behavior of the digital inputs Hardware gate Level-controlled Edge-controlled Minimum pulse width w 2,5 ms w 25 ms Set counter Setting once Multiple setting Evaluate zero mark for setting Determine the behavior of the digital outputs Output Q0 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 Q1 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 Enable digital outputs CTRL_DQ0 in DB 1 CTRL_DQ1 in DB 1 Determine load value and comparison values and enter in DB Load value Comparison value 1 Comparison value 2 Enter basic data in DB Module address Channel address User data length 16

(X)

FM 350 Counter Function Module C79000-G7076-C350-01

8-5

Starting Up the FM 350

Working Step Parameterize the FM 350

Options/Procedure Select interrupts Interrupt on opening the gate (Hardware or software gate) Interrupt on closing the gate (Hardware or software 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

(X)

Link FCs into user pro- Link in FC CNT_CTRL gram Link in FC DIAG_INF

8-6

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

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

FM 350 Counter Function Module C79000-G7076-C350-01

9-1

Operating Modes, Settings, Parameters and Commands

9.1

Definitions

Which Operating Modes are Available?

When you specify one of the three operating modes, you select the functionality with which you want to operate the FM 350. Table 9-1 gives an overview of these operating modes.
Table 9-1 The Operating Modes of the FM 350 Name Continuous counting (with or without gate) Single counting with software gate or hardware gate Periodic counting with software gate or with hardware gate Description The FM 350 counts continuously from the current counter status. The FM 350 counts on opening the gate from the load value to the count limit. The FM 350 counts on opening the gate between the load value and the count limit.

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.

What Settings are Available?

You can adapt the FM 350 to your counting task with five settings. Table 9-2 gives an overview of these settings.
Table 9-2 The Settings of the FM 350 Name Count mode Behavior of digital outputs Q0 and Q1 Pulse duration Initiating process interrupts Encoder Description With the count mode, you select the counting range and so the count limits. You can choose between six possibilities for the behavior of the outputs on reaching the comparison value. The pulse duration indicates the time for which the output is to be set. The FM 350 can initiate a process interrupt in the case of a variety of selectable events. You must specify different settings for the encoder used. These settings are described in Appendix B.

9-2

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

Which Commands are Available?

You can influence the count in the FM 350 with two commands. Table 9-3 gives an overview of these commands.
Table 9-3 The Commands of the FM 350 Name Open and close gate Set counter Description The count is started by opening a gate and stopped by closing the gate. The counter can be set to the load value via different signals.

Basic Parameter Assignment

You carry out basic parameter assignment for each FM 350 when you configure the hardware. Table 9-4 gives the meanings of the relevant parameters.
Table 9-4 Name Interrupt selection Parameters for Basic Parameter Assignment Option None Diagnostics Process Process and diagnostics Responses to OD STOP Continue Terminate current job Immediate switch off of the outputs Termination of count The module continues In the case of operating modes with hardware gate, the single count continues until it terminates 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. Description You enable the relevant interrupts via this selection

FM 350 Counter Function Module C79000-G7076-C350-01

9-3

Operating Modes, Settings, Parameters and Commands

9.2

Basic Information on Calling Operating Modes, Settings and Commands

How Do You Select the Operating Modes and Settings?

You select the operating modes and settings in the parameter assignment screen forms of the FM 350. The parameter assignment data are saved automatically on the programming device and transferred automatically to the rack SDB. You will find notes on installing the parameter assignment screen forms and on parameterizing the FM 350 in the chapter on Assigning Parameters to the FM 350 and in the integral Help.

How Do You Change Operating Modes and Settings? How Do You Give Commands?

You can change an operating mode or setting in the parameter assignment screen forms. The new operating mode or setting becomes valid after the next FM 350 start-up.

The commands are given either via hardware signals connected to the front 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 Status Bits in the DB

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

Transferring the Control Bits and the Status Bits

You transfer the status bits and the control bits to and from the module with the FC CNT_CTRL that you must link into your user program: 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 350 and you will find the DB assignments in Chapter 11.

9-4

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

9.3

Continuous Counting

Definition

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

Selecting the Gate Function

You can select the gate function in this mode. The following possibilities are 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 Figure 9-1 Continuous Counting with Gate Function Gate stop Time

Opening and Closing the Software Gate

You open and close the software gate of the counter in each case with the input parameter SW_GATE of the FC CNT_CTRL.
Action Open software gate Close software gate ...Is Initiated By Setting SW_GATE Resetting SW_GATE

FM 350 Counter Function Module C79000-G7076-C350-01

9-5

Operating Modes, Settings, Parameters and Commands

Opening and Closing the Hardware Gate

You open and close the hardware gate by applying the relevant signals to or removing the signals from inputs I0 and I1.
Action Open hardware gate (level-controlled) Close hardware gate (level-controlled) Open hardware gate (edge-controlled) Close hardware gate (edge-controlled) ...Is Initiated By Applying signal to input I0 Removing signal from input I0 Applying positive edge to input I0 Applying positive edge to input I1

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

Terminating the Count with the Gate Stop Function

You can also terminate the count when counting with the software gate or hardware gate by using the gate stop function. Set input parameter GATE_STP of FC CNT_CTRL (see Section 6.2) for this purpose.

9-6

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

9.4

Single Counting

Definition

In this mode, the FM 350 counts once from the load value to the count limit.

Selecting the Gate Function

You can select the gate function in this mode. The following possibilities are 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 Figure 9-2 Gate start Time

Single Counting with Load Value and Gate Function

Opening and Closing the Software Gate

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.
Action Open software gate Close software gate ...Is Initialized By Setting SW_GATE Resetting SW_GATE

Behavior at the Count Limits, Software Gate

If the counter has reached the upper or lower count limit and a further count pulse is received, the counter is set to the other count limit, the gate is closed 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 Upper limit Lower limit Bit in DB STS_OFLW is set 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 350 Counter Function Module C79000-G7076-C350-01

9-7

Operating Modes, Settings, Parameters and Commands

Opening and Closing the Hardware Gate

You open and close the hardware gate and set the counter to the load value by applying the relevant signals to or removing the signals from the inputs I0 and I1.
Action Open hardware gate (level-controlled) Open hardware gate (edge-controlled) Close hardware gate (level-controlled) Close hardware gate (edge-controlled) ...Is Initiated By Applying signal to input I0 Applying positive edge to input I0 Removing signal from input I0 Applying positive edge to input I1

In the case of a level-controlled hardware gate, the gate is reopened and the counter is set to the load value by a signal at input I0. If a positive edge is applied again to input 1I0 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 I1 is not set.

Behavior at the Count Limits, Hardware Gate

If the counter has reached the upper or lower count limit and a further count pulse is received, the counter is set to the other count limit, the gate is closed and the count is terminated even if the hardware gate is still open. The relevant bit is set in the DB.
Count Limit Reached Upper limit Lower limit

9
Terminating the Count with the Gate Stop Function

Bit in DB
STS_OFLW is set STS_UFLW is set

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

9-8

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

9.5

Periodic Counting

Definition

In this mode, the FM 350 counts from the load value to the count limit, jumps back to the load value and continues to count.

Selecting the Gate Function

You can select the gate function in this mode. The following possibilities are 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 Figure 9-3 Gate stop Time

Periodic Counting with Load Value and Gate Function

Opening and Closing the Software Gate

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 user program (see Chapter 11). When you open the software gate, the FM 350 begins to count from the load value.
Action Open software gate Close software gate ...Is Initiated By Setting SW_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 Count Limits, Software Gate

If the counter reaches the upper or lower count limit, the FM 350 begins to count anew from the load value. The count is continued without pulse losses. The relevant bit is set in the DB:
Count Limit Reached Upper limit Lower limit Bit in DB STS_OFLW is set STS_UFLW is set

FM 350 Counter Function Module C79000-G7076-C350-01

9-9

Operating Modes, Settings, Parameters and Commands

Opening and Closing the Hardware Gate

You open and close the hardware gate and set the counter to the load value by applying the relevant signals to or removing the signals from inputs I0 and I1.
Action Open hardware gate (level-controlled) Open hardware gate (edge-controlled) Close hardware gate (level-controlled) Close hardware gate (edge-controlled) ...Is Initiated By Applying signal to input I0 Applying positive edge to input I0 Removing signal from input I0 Applying positive edge to input I1

If a positive edge is applied again to input I0 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 I1 is not set.

Behavior at the Count Limits, Hardware Gate

If the counter reaches the upper or lower count limit, the FM 350 begins to count anew from the load value. The count is continued without pulse losses. The relevant bit is set in the DB:
Count Limit Reached Upper limit Lower limit Bit in DB STS_OFLW is set STS_UFLW is set

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

9-10

FM 350 Counter Function Module C79000-G7076-C350-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 numbers to be represented. Both count modes, 32-bit and +31-bit, are described in this section.

Counting Ranges

In both count modes, the FM 350 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 2s complement.

Count Mode 32-bit "31-bit

Counting Range 0 to 4,294,967,295 0 to FFFF FFFFH 2,147,483,648 to 2,147,483,647 8000 0000H to 7FFF FFFFH

Overflow

Underflow

When the counter status changes When the counter status changes from 4,294,967,295 to 0 from 0 to 4,294,967,295 When the counter status changes When the counter status changes from +2,147,483,647 to from to 2,147,483,648 to 2,147,483,648 +2,147,483,647

Overflow, Underflow and Zero Pass

In both count modes, a bit is set in the DB of the FC CNT_CTRL in the event of overflow and underflow (see Chapter 11). 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 indicated with zero pass, depending on the direction of count.
Event Overflow Underflow Zero pass Bit in DB STS_OFLW is set STS_UFLW is set STS_ZERO is set

Initiating Process Interrupts

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

FM 350 Counter Function Module C79000-G7076-C350-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: Q0 , comparison value 2: Q1). The relevant output can be set depending on the counter status and the comparison value. This section describes the various methods of setting the behavior of the outputs.

Comparison Values 1 and 2

You enter the two comparison values in the DB of the FC CNT_CTRL (CMP_V1, CMP_V2) and transfer them to the FM 350 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 comparison value, the number is interpreted as 4,294,967,295 in 32-bit mode, and as 1 in +31-bit mode.

Enabling the Outputs

Before the outputs can be set, you must enable them first by setting the relevant 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
Q0 Q1

Output

...Is Enabled By CTRL_DQ0 CTRL_DQ1

Status of the Outputs

You can see the status of the two outputs from the green status LEDs and from the relevant bits in the DB.
Status of the Output Q0 set Q0 reset Q1 set Q1 reset

Status of the LED Q0 lights up Q0 dark Q1 lights up Q1 dark

Status of the Bit STS_COMP1 set STS_COMP1 reset STS_COMP2 set STS_COMP2 reset

O Behavior of the Outputs

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

9-12

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

Behavior of the Outputs

Inactive
Underflow Comparison value Overflow

The output remains deactivated and is not affected by the comparison value, zero pass, overflow or underflow events. Active from comparison value to overflow *

Underflow

Comparison value

Overflow

The output is activated if the counter is in the range between the comparison value n and overflow. Setting the counter to a value between the comparison value and overflow activates the output. Active from comparison value to underflow *

Underflow

Comparison value

Overflow

The output is activated if the counter is in the range between the comparison value and underflow. Setting the counter to a value between the comparison value and underflow activates the output. Active when up limit exceeded *
Underflow t

Comparison value

Overflow

The output is activated when the comparison value is reached in the up direction for the extent of the pulse duration. Active when down limit exceeded *
Underflow t

Comparison value

Overflow

The output is activated when the comparison value is reached in the down direction for the extent of the pulse duration. Active when up/ down limit exceeded *
Up t t Down

Underflow Comparison value Overflow

Underflow Comparison value Overflow

The output is activated when the comparison value is reached for the extent of the pulse duration regardless of count direction.

* Please note the marginal conditions on the next page


= output active t = pulse duration

FM 350 Counter Function Module C79000-G7076-C350-01

9-13

Operating Modes, Settings, Parameters and Commands

Marginal Conditions

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

...you want to parameterize an output ac- ...you must ensure that the time between tive from comparison value to overflow or these events is greater than the minimum 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 comparison value again while the output is still active, no new pulse is initiated. A further pulse can only be initiated when the output is no longer active. ...you want to parameterize an output ac- ...you must not enable a process interrupt on tive from comparison value to overflow Reaching the (relevant) comparison value up or down. ...you want to parameterize an output ac- ...you must not enable a process interrupt on tive from comparison value to underflow Reaching the (relevant) comparison value up or down. ...you want to parameterize an output ac- ...you must not enable a process interrupt tive on exceeding up limit on Reaching the (relevant) comparison value down. ...you want to parameterize an output ac- ...you must not enable a process interrupt tive on exceeding down limit on Reaching the (relevant) comparison value up.

9
Switching Off the Outputs The outputs are switched off by the following events regardless of the parameter assignments:

S Module watchdog triggered (internal error) 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.

9-14

FM 350 Counter Function Module C79000-G7076-C350-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 elements, 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 Duration

The pulse duration defines the minimum time the output must be set. This pulse duration only takes effect if you preselect the behavior of the output accordingly. 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 outputs (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 cover this eventuality.

Default Value

The default value for the pulse duration is 0.

FM 350 Counter Function Module C79000-G7076-C350-01

9-15

Operating Modes, Settings, Parameters and Commands

9.9

Command: Open and Close Gate

Introduction

The FM 3501 has the following gates:

S A hardware gate that you can operate 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 350.

Level-Controlled Opening and Closing of the Hardware Gate

Figure 9-4 shows level-controlled opening and closing of the hardware gate.

Counter status 1 Count pulses Input 1I0 Open gate Close gate 2 3 4 4

Figure 9-4

Level-Controlled Opening and Closing of the Hardware Gate

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

9-16

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

Edge-Controlled Opening and Closing of the Hardware Gate

Figure 9-5 shows edge-controlled opening and closing of the hardware gate.

1 Count pulses Input I0

Counter status 4

Open gate Input I1 Close gate

Figure 9-5

Edge-Controlled Opening and Closing of the Hardware Gate

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

Status of Inputs I0 and I1

The status of inputs I0 and I1 are indicated by the green LEDs I0 and I1 and within the user program in bit STS_STA and STS_STP of the DB of the FC CNT_CTRL.

FM 350 Counter Function Module C79000-G7076-C350-01

9-17

Operating Modes, Settings, Parameters and Commands

Opening and Closing the Software Gate

Figure 9-6 shows opening and closing of the software gate.

Counter status 1 Count pulses SW_GATE Bit set Bit reset 2 3 4 4

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 reopened by setting input parameter SW_GATE again. Edge-controlled opening and closing of the software gate is not possible.

Status of the Software Gate

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

Terminating the Count with the Gate Stop Function

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. For this purpose, set the GATE_STP input parameter of the FC_CNT_CTRL. If you reset this parameter, you can only open the gate again by a positive edge at input I0 (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.

9-18

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

9.10 Command: Set Counter

Introduction

If you want to start 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 I2 or via the input in conjunction
with the zero mark of the encoder. This section describes the different methods and the time sequence when setting a counter.

Load Value

For the load value 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 Counter via the User Program

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

Setting the Counter with an External Signal

You can select two different external signals with which you can set a counter to the load value:

S Input I2 only S Input I2 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 350 Counter Function Module C79000-G7076-C350-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 Counter with Input I2

A counter can be set with the load value via a rising edge at input I2. You can determine the behavior of the FM 350 in the case of a positive edge at input I2 via the ENSET_UP and ENSET_DN variables in the DB of the FC CNT_CTRL and via parameterization.
Bit ENSET_UP set ENSET_DN set Behavior of the FM 350 The counter is only set in the case of up counting The counter is only set in the case of down counting The counter is set in the case of up and down counting Behavior of the FM 350 The counter is set only at the first rising edge at input I2. If the counter is to be set again, you must first set ENSET_UP or ENSET_DN again. The counter is then set again with the next positive edge at input I2. The counter is set at every rising edge at input I2 as long as ENSET_UP and/or ENSET_DN are set.

ENSET_UP and ENSET_DN set Parameterization Parameterization Single setting of counter

Multiple setting of counter parameter

Note You must always set one of the two variables ENSET_UP and/or ENSET_DN so that the relevant counter can be set via input I2.

9-20

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

Single Setting with Input I2

Figure 9-7 shows single setting of counter 1 with input I2. The same applies 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 I2, the counter is set as long as ENSET_UP is set. If you want to reset the counter, you must first reset the ENSET_UP and set it again. The next positive edge at input I2 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 with Input I2

Multiple Setting with Input I2

Figure 9-8 shows multiple setting of the counter 1 with input I2. In the situation represented, only ENSET_UP is set, that is, the counter is set in the case of up counting. With every rising edge at input I2, the relevant counter is set as long as ENSET_UP is set. If you reset ENSET_UP, the counter will not be set by input I2. Only when you have set ENSET_UP again, will the next positive edge at input I2 result in the setting of the counter.

Count pulses

Input 1I2

ENSET_UP

Counter set Figure 9-8 Multiple Setting with Input I2

Counter set

Counter not set

Counter set

FM 350 Counter Function Module C79000-G7076-C350-01

9-21

Operating Modes, Settings, Parameters and Commands

Setting the Counter with the Zero Mark

If you parameterize setting of a counter with the zero mark of the encoder, the counter will be set with the rising edge of the zero mark. Setting is only carried out if input I2 of the relevant counter is set at the time of the rising edge of the zero mark. You can determine the behavior of the FM 350 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 ENSET_UP set ENSET_DN set ENSET_UP and ENSET_DN set Parameterization Parameterization Single setting of counter Behavior of the FM 350 The counter is only set in the case of up counting The counter is only set in the case of down counting The counter is set in the case of up and down counting Behavior of the FM 350 The counter is set only at the first rising of the zero mark. If the counter is to be set again, you must first set ENSET_UP or ENSET_DN again (edge evaluation). The counter is then set again with the next rising edge of the zero mark. The counter is set at every rising edge of the zero mark as long as ENSET_UP and/or ENSET_DN are set.

Parameterization Multiple setting of counter

Note You must always set one of the two variables ENSET_UP and/or ENSET_DN so that the counter can be set with the zero mark.

Single Setting with Zero Mark

Figure 9-9 shows single setting of the counter with the zero mark. 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 I2, the relevant counter is set as long as ENSET_UP and input I2 are set. If you want to set the counter anew, you must reset ENSET_UP and then set it again. If input I2 is not set, setting takes place with the first zero mark after setting of I2. If input I2 is set, setting takes place with the next zero mark.

9-22

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

Count pulses

Zero mark

Input I2

ENSET_UP Counter set Counter not set Counter not set Counter not set Counter not set Counter set

Figure 9-9

Single Setting of the Counter with the Zero Mark

Multiple Setting with the Zero Mark

Figure 9-10 shows multiple setting of the counter with the zero mark. In the 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 ENSET_UP and input I2 are set.

Count pulses

Zero mark

Input I2

ENSET_UP

Counter set

Counter set

Counter not set

Counter set

Counter not set

Counter set

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

FM 350 Counter Function Module C79000-G7076-C350-01

9-23

Operating Modes, Settings, Parameters and Commands

9.11 Initiating a Process Interrupt

Introduction

With the FM 350, you can set which events are to initiate a process interrupt. For this purpose, parameterize the FM 350 interrupts in the parameter assignment screen forms.

What is a Process Interrupt

If you want to program a response to a specific event independently of the CPU cycle, each counter of the FM 350 can initiate a process interrupt. The CPU interrupts the cyclic program on receiving the interrupts and executes the process interrupt OB 40.

Which Events Can Initiate a Process Interrupt?

The following events during operation of the FM 350 can initiate a process 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

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. For process interrupts on reaching the comparison value, you must observe the marginal conditions on page 9-14.

Enabling the Process Interrupt

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

Process Interrupt OB, OB 40

If a process interrupt occurs, the user program is interrupted, the data is transferred from the module to the start information of OB40 and OB40 is called. The process interrupt is acknowledged by exiting OB40. If there is no OB40 programmed, the CPU goes to STOP. If you then switch back to RUN, the process interrupt requirements are deleted.

9-24

FM 350 Counter Function Module C79000-G7076-C350-01

Operating Modes, Settings, Parameters and Commands

Start Information

The temporary variable OB40_POINT_ADDR is written in the start information of OB40. The variable OB40_POINT_ADDR (bytes 8 to 11) consists of four bytes. The information concerning the event that has initiated the process interrupt is entered in bytes 8 and 9. Table 9-5 shows which bits are set for which interrupt. All unlisted bits are not significant and are set to zero.
Table 9-5 Byte Assignment of the Bits of the Variable OB40_POINT_ADDR Bit Meaning: Interrupt in the Case of...

0 1 2 3 4 5 6 7

Opening the gate Closing the gate Overflow Underflow Reaching comparison value 1 in the up direction Reaching comparison value 1 in the down direction Reaching comparison value 2 in the up direction Reaching comparison value 2 in the down direction Zero pass Setting the counter

0 5

9
Lost Process Interrupt If an event occurs that is to initiate a process interrupt and the same previous 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 350 Counter Function Module C79000-G7076-C350-01

9-25

Operating Modes, Settings, Parameters and Commands

9-26

FM 350 Counter Function Module C79000-G7076-C350-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 350. S The time sequence of the signals of the different encoders. S How the FM 350 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 Overview
Section 10.1 10.2 10.3 10.4 Overview 5 V Differential Signals 24 V Signals Pulse Evaluation Contents Page 10-2 10-3 10-4 10-6

FM 350 Counter Function Module C79000-G7076-C350-01

10-1

Encoder Signals and Their Evaluation

10.1 Overview

Introduction

The count signals that the FM 350 can process are rectangular signals generated either by incremental encoders or by signal 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 rectangular signal with a specific voltage level.

Connecting Different Encoders

You can connect different encoders to the FM 350 for supplying 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 350 Encoder Incremental 5 V encoder Incremental 24 V encoder 24 V pulse encoder 24 V pulse encoder Signal Differential signals A, A, B, B and N, N A*, B* and N* 24 V with direction level 24 V without direction level

10

10-2

FM 350 Counter Function Module C79000-G7076-C350-01

Encoder Signals and Their Evaluation

10.2

5 V Differential Signals

Incremental 5 V Encoder

The incremental 5 V encoder supplies the differential signals A, A, B, B and 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 parameterized accordingly. 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 signals A and B are counted in the down or up direction.

10

Changing the Count Direction How are the Signals Monitored?

You can change the signals B and B via parameterization and so change the count direction without having to change the wiring. The module monitors for cable connection and for wirebreak or short-circuit. Via parameterization, you can determine which of the three signal pairs are 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.

Coding Connector

For this encoder, you must set the coding connector to position A.

FM 350 Counter Function Module C79000-G7076-C350-01

10-3

Encoder Signals and Their Evaluation

10.3 24 V Signals

24 V Incremental Encoder

The incremental 24 V encoder supplies the signals A*, B* and N* in the 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 encoders. In the case of the inputs of 24 V encoder signals, you decide via parameterization 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 Encoder Without/ With Direction Level

The encoder, for example an initiator (BERO) or a light barrier, supplies only one count signal that must be connected to terminal A* of the front connector. Additionally to this, you can connect a signal for direction detection to terminal B*. If your encoder does not supply a corresponding signal, you can generate and connect a corresponding ID within the S7 or you can use a corresponding process signal. Figure 10-2 shows the sequence over time of the signals of a 24 V pulse encoder with direction level and the resulting count pulses.

10

Signal A* Signal B * as direction level Up count pulses Down count pulses Figure 10-2 Signals of a 24 V Pulse Encoder with Direction Level Down Up

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 input parameterization.

10-4

FM 350 Counter Function Module C79000-G7076-C350-01

Encoder Signals and Their Evaluation

Table 10-2

Count Direction in Dependence on the Input Parameterization Terminal B* Unswitched 24 V connected Count Direction Up Down Down Up

Input Parameterization Current sourcing

Current sinking

Unswitched Short-circuited to ground

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 together.

Input Filters for 24 V Count Inputs

To suppress interference, you can parameterize input filters (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 10-3 Input Filters Features Typical input delay Maximum count frequency Minimum pulse width of the count signals Input Filter 1 (Default) 1 ms 200 kHz 2.5 ms Input Filter 2 15 ms 20 kHz 25 ms

10

How are the Signals Monitored? Coding Connector

24 V count signals are not monitored for wirebreak or short-circuit.

For this encoder, you must set the coding connector to position B.

FM 350 Counter Function Module C79000-G7076-C350-01

10-5

Encoder Signals and Their Evaluation

10.4 Pulse Evaluation

Introduction

The counters of the FM 350 can count the edges of the signals. Normally, the edge at A (A*) is evaluated (single evaluation). To achieve a higher resolution, 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 evaluated; 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

10-6

FM 350 Counter Function Module C79000-G7076-C350-01

Encoder Signals and Their Evaluation

Quadruple Evaluation

Quadruple evaluation means that the rising and falling edges of A and B are 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 350 Counter Function Module C79000-G7076-C350-01

10-7

Encoder Signals and Their Evaluation

10

10-8

FM 350 Counter Function Module C79000-G7076-C350-01

DB Assignments

11

DB for the FC CNT_CTRL

All data belonging to one channel of the module are stored in the DB of the FC CNT_CTRL. The data structure and the length of the DB are defined by the UDT 1. Before the module is parameterized, the DB must be assigned the following valid data (see Section 6.1 Prerequisite):

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. The DB assignments resulting from this are shown below. The variables in the DB that you must/can enter or read out while working with the FM 350 are shaded gray in Table 11-1.
Table 11-1 DB Assignments

Address 0.0 4.0 5.0 6.0 8.0 12.0 13.0 14.0 18.0 22.0

Variable

Data Type

Initial Value DW#16#0 AR1 buffer B#16#0 B#16#0 W#16#0 Flag byte Reserved Module address

Comments

AR1_BUFFER DWORD FP RESERVED MOD_ADR CH_ADR U_D_LGTH A_BYTE_0 LOAD_VAL CMP_V1 CMP_V2 BYTE BYTE WORD DWORD BYTE BYTE DINT DINT DINT

DW#16#0 Channel address B#16#0 B#16#0 L#0 L#0 L#0 User data length Reserved New load value (write user) New comparison value 1 (write user) New comparison value 2 (write user)

FM 350 Counter Function Module C79000-G7076-C350-01

11-1

DB Assignments

Table 11-1

DB Assignments, Continued

Address 26.0 26.1 26.2 26.3 26.4 26.5 26.6 26.7 27.0 27.1 27.2 27.3 27.4 27.5 27.6 27.7 28.0 28.1 28.2 28.3

Variable A_BIT0_0 TFB A_BIT0_2 A_BIT0_3 A_BIT0_4 A_BIT0_5 A_BIT0_6 A_BIT0_7 ENSET_UP ENSET_DN A_BIT1_2 A_BIT1_3 A_BIT1_4 A_BIT1_5 A_BIT1_6 A_BIT1_7 CTRL_DQ0 CTRL_DQ1 A_BIT2_2 A_BIT2_3 A_BIT2_4 A_BIT2_5 A_BIT2_6 A_BIT2_7 A_BIT3_0 A_BIT3_1 A_BIT3_2 A_BIT3_3 A_BIT3_4 A_BIT3_5 A_BIT3_6 A_BIT3_7

Data Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL

Initial Value FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE Reserved Test free Reserved Reserved Reserved Reserved Reserved Reserved

Comments

Enable setting in up direction (write user) Enable setting in down direction (write user) Reserved Reserved Reserved Reserved Reserved Reserved Monitor digital output DQ0 (write user) Monitor digital output DQ1 (write user) Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved

11

28.4 28.5 28.6 28.7 29.0 29.1 29.2 29.3 29.4 29.5 29.6 29.7

11-2

FM 350 Counter Function Module C79000-G7076-C350-01

DB Assignments

Table 11-1

DB Assignments, Continued

Address 30.0 34.0 38.0 40.0 41.0 41.1 41.2 41.3 41.4 41.5 41.6 41.7 42.0 43.0 43.1 43.2 43.3 43.4 43.5 43.6 43.7

Variable ACT_LOAD ACT_CNTV DA_ERR_W OT_ERR_B E_BIT0_0 STS_TFB E_BIT0_2 E_BIT0_3 DATA_ERR E_BIT0_5 E_BIT0_6 PARA E_BYTE_0 STS_RUN STS_DIR STS_ZERO STS_OFLW STS_UFLW STS_SYNC STS_GATE STS_SW_G

Data Type DINT DINT WORD BYTE BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BYTE BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL

Initial Value L#0 L#0 W#16#0 B#16#0 FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE B#16#0 FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

Comments Current load value (read user) Current count value (read user) Data error word (read user) Operator error byte (read user) Reserved Status test free Reserved Reserved Data error bit (read user) Reserved Reserved Module parameterized (read user) Reserved Status counter working Status count direction (read user) Status zero pass (read user) Status overflow (read user) Status underflow (read user) Status counter synchronized (read user) Status internal gate (read user) Status software gate (read user)

11

FM 350 Counter Function Module C79000-G7076-C350-01

11-3

DB Assignments

Table 11-1

DB Assignments, Continued

Address 44.0 44.1 44.2 44.3 44.4 44.5 44.6 44.7 45.0 45.1 45.2 45.3 45.4 45.5 45.6 45.7 46.0 50.0

Variable STS_SET E_BIT2_1 STS_STA STS_STP STS_CMP1 STS_CMP2 E_BIT2_6 E_BIT2_7 E_BIT3_0 E_BIT3_1 E_BIT3_2 E_BIT3_3 E_BIT3_4 E_BIT3_5 E_BIT3_6 E_BIT3_7 ACT_CMP1 ACT_CMP2

Data Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL DINT DINT

Initial Value FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE L#0 L#0

Comments Status digital input SET (read user) Reserved Status digital input START (read user) Status digital input STOP (read user) Status output comparison value 1 (read user) Status output comparison value 2 (read user) Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved

The following diagnostics data are entered by the FC DIAG_INF 54.0 MALFUNC MALF_INT MALF_EXT MALF_CHA MALF_AUX FRONTCON MIS_PARA WRG_PARA BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE Module fault Internal fault External fault Channel fault (Broken down from DW 58) Auxiliary voltage fault Front connector Missing parameters Wrong parameters

11

54.1 54.2 54.3 54.4 54.5 54.6 54.7

11-4

FM 350 Counter Function Module C79000-G7076-C350-01

DB Assignments

Table 11-1

DB Assignments, Continued

Address 55.0 55.1 55.2 55.3 55.4 55.5 55.6 55.7 56.0 56.1 56.2 56.3 56.4 56.5 56.6 56.7 57.0 57.1 57.2 57.3 57.4 57.5 57.6 57.7 58.0 59.0 60.0

Variable D_BIT1_0 D_BIT1_1 D_BIT1_2 D_BIT1_3 CH_INFO MOD_INFO D_BIT1_6 D_BIT1_7 INTF_MOD COMM_ERR RUN_STOP WATCHDOG POW_INT BATTERY BACKUP D_BIT2_7 RACK_FLT PROC_FLT EPROM RAM_FLT ADU_DAU FUSE_TRP PROC_I D_BIT3_7 CH_TYPE LGTH_DIA CH_NO

Data Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BYTE BYTE BYTE

Initial Value FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE B#16#0 B#16#0 B#16#0 DS1 byte 1 bit 0 DS1 byte 1 bit 1 DS1 byte 1 bit 2 DS1 byte 1 bit 3

Comments

Channel information Module information DS1 byte 1 bit 6 DS1 byte 1 bit 7 Wrong/missing interface submodule Communications error RUN/STOP operating status indicator Watchdog (FM) Fault in internal power supply Battery monitor Backup fault DS1 byte 2 bit 7 Mounting rack fault CPU fault EPROM fault RAM fault ADC/DAC fault Fuse Process interrupt lost DS1 byte 3 bit 7 Channel type Diagnostics data length per channel Channel number

11

FM 350 Counter Function Module C79000-G7076-C350-01

11-5

DB Assignments

Table 11-1

DB Assignments, Continued

Address 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 62.0 62.1 62.2 62.3 62.4 62.5 62.6 62.7 63.0 64.0 64.1 64.2

Variable GRP_ERR1 GRP_ERR2 D_BIT7_2 D_BIT7_3 D_BIT7_4 D_BIT7_5 D_BIT7_6 D_BIT7_7 CH1_SIGA CH1_SIGB CH1_SIGZ CH1_BETW CH1_5V2 D_BIT8_5 D_BIT8_6 D_BIT8_7 D_BYTE9 CH2_SIGA CH2_SIGB CH2_SIGZ CH2_BETW CH2_5V2 D_BIT10_5 D_BIT10_6 D_BIT10_7 D_BYTE11 FP_BYTE

Data Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BYTE BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BYTE BYTE

Initial Value FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE B#16#0 FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE B#16#0 B#16#0

Comments Group error channel 1 Not assigned on the FM 350 DS1 byte 7 bit 2 DS1 byte 7 bit 3 DS1 byte 7 bit 4 DS1 byte 7 bit 5 DS1 byte 7 bit 6 DS1 byte 7 bit 7 Channel 1, error signal A Channel 1, error signal B Channel 1, error signal zero Channel 1, error between channels Channel 1, error in 5.2 V encoder supply DS1 byte 8 bit 5 DS1 byte 8 bit 6 DS1 byte 8 bit 7 DS1 byte 9 Channel 2, error signal A Channel 2, error signal B Channel 2, error signal zero Channel 2, error between channels Channel 2, error in 5.2 V encoder supply DS1 byte 10 bit 5 DS1 byte 10 bit 6 DS1 byte 10 bit 7 DS1 byte 11 1 L-byte reserved

11

64.3 64.4 64.5 64.6 64.7 65.0 66.0

11-6

FM 350 Counter Function Module C79000-G7076-C350-01

M7 Reference Counter Function Library


This Chapter...

12
On Page 12-2 12-3 12-4 12-5 12-6 12-8 12-9 12-11 12-12 12-13 12-15 12-16 12-17 12-18 12-19 12-20 12-21 12-22 12-23 12-24 12-25 12-28 12-29

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.
In Chapter 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 12.10 12.11 12.12 12.13 12.14 12.15 12.16 12.17 12.18 12.19 12.20 12.21 12.22 12.23 You Will Find M7CntDisableOut M7CntDisableSet M7CntEnableOut M7CntEnableSet M7CntInit M7CntLoadAndStart M7CntLoadComp M7CntLoadDirect M7CntLoadPrep M7CntPar M7CntRead M7CntReadDiag M7CntReadLoadValue M7CntReadParError M7CntReadStatus M7CntResetStatus M7CntStart M7CntStop M7CntStopAndRead M7CNT_DIAGINFO M7CNT_PARAM M7CNT_STATUS Error codes

Chapter Overview

FM 350 Counter Function Module C79000-G7076-C350-01


Description Disable outputs Disable SET input Enable outputs Enable SET input Initialize counter channel Load and start counter channel Transfer comparison values Load counter channel Prepare loading Parameterize counter channel Read counter value Read diagnostics information Read load value Read parameterization error Read counter status Reset counter status Start counter channel Stop counter channel Stop counter channel and read counter value Contains diagnostics information Contains parameterization data Contains status information Error messages

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);

Description

Return Value

12

See Also

12-2


Parameter Meaning LogChannel SelOut0 SelOut1 Logical channel number, detected by M7CntInit Selection bit for output 0 Selection bit for output 1

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.

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

Function: M7CntInit, M7CntEnableOut

FM 350 Counter Function Module C79000-G7076-C350-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):

Description

Return Value

See Also

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel SelSetUp SelSetDn Logical channel number, detected by M7CntInit Disable SET input for up count direction Disable SET input for down count direction

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 disable 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.

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

12

M7CNTE_NO_LOGCHANNEL

Function: M7CntInit, M7CntEnableSet

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);

Description

Return Value

12

See Also

Example

12-4


Parameter Meaning LogChannel SelOut0 SelOut1 Logical channel number, detected by M7CntInit Selection bit for output 0 Selection bit for output 1

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 output is not changed: an enabled output remains enabled and a disabled output remains disabled. Default: both outputs are disabled

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

Function: M7CntInit, M7CntDisableOut

#include M7CNT.H M7CNT_LOGCHANNEL Ch5;

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

FM 350 Counter Function Module C79000-G7076-C350-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)

Description

Return Value

See Also

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel SelSetUp SelSetDn Logical channel number, detected by M7CntInit Enable SET input for up count direction Enable SET input for down count direction

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) determine 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 parameterization, 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

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

Function: M7CntInit, M7CntEnableSet

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);

Description

12

Return Value

12-6


Parameter Meaning Baddr PType Base address of the interface submodule or the counter module I/O type of the counter channel. (Please specify one of the values M7IO_IN or M7IO_OUT, it does not matter which) 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 Logical channel number (return signal) Channel pLogChannel

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.

0 00

The function has been executed successfully An error has occurred

FM 350 Counter Function Module C79000-G7076-C350-01

M7 Reference Counter Function Library

Error Code M7CNTE_CHANNEL_WRONG M7CNTE_PTYPE_WRONG M7CNTE_TIMEOUT

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

M7CNTE_NO_COUNTER M7CNTE_INVALID_BADDR

Example

#include M7CNT.H #define CNT_BADDR M7CNT_LOGCHANNEL

320 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 350 Counter Function Module C79000-G7076-C350-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);

Description

Note

12

Return Value

See Also

12-8


Parameter Meaning LogChannel LoadVal Logical channel number, detected by M7CntInit Load value

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 software gate.

The function only works error-free in the counter operating modes with software gate control. In the operating modes with hardware gate control, an operating 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. 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). 0 00 The function has been executed successfully An error has occurred
Error Code Meaning The counter channel cannot be started in this operating mode (with hardware gate control). The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_FS_NO_START
M7CNTE_NO_LOGCHANNEL

Function: M7CntInit, M7CntLoadDirect, M7CntLoadPrep, M7CntStart, M7CntReadLoadValue

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Note

Return Value

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel CmpV1 CmpV2 Logical channel number, detected by M7CntInit Comparison value 1 Comparison value 2 SelCmp1 SelCmp2 Selection bit for comparison value 1 Selection bit for comparison value 2

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 retained. Default setting: The comparison values are set to 0 as default.

12

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).

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

12-9

M7 Reference Counter Function Library

See Also

Function: M7CntInit

Example

#include M7CNT.H M7CNT_LOGCHANNEL DWORD DWORD Ch5; CmpValue1=100; CmpValue2=200;

if ((Err = M7CntLoadComp (Ch5, CmpValue1, CmpValue2, TRUE, TRUE)) != M7CNT_DONE) {...error handling...}

12

12-10

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Note

Return Value

See Also

Example

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel LoadVal Logical channel number, detected by M7CntInit Load value

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.

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).

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

12

Function: M7CntInit, M7CntLoadAndStart, M7CntLoadPrep, M7CntReadLoadValue

#include M7CNT.H M7CNT_LOGCHANNEL DWORD Ch5; LoadValue=100;

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

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);

Description

Note

12
Return Value 0 00 The function has been executed successfully An error has occurred
Error Code M7CNTE_NO_LOGCHANNEL Meaning The channel specified when calling (LogChannel parameter) is not valid.

See Also

12-12


Parameter Meaning LogChannel LoadVal Logical channel number, detected by M7CntInit Load value

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
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.

Function: M7CntInit, M7CntLoadAndStart, M7CntLoadDirect, M7CntReadLoadValue

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Note

Return Value

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel pCntParam Logical channel number, detected by M7CntInit Pointer to the structure M7CNT_PARAM with the parameterization data

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 parameterization data in the M7CNT_PARAM structure. After this, the function is called to parameterize the counter channel specified. The new settings become effective immediately.

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 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.

12

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

12-13

M7 Reference Counter Function Library

See Also

Function: M7CntInit Structure: M7CNT_PARAM

Example
M7CNT_LOGCHANNEL M7CNT_PARAM

#include LogChannel; DS128;

<m7cnt.h>

/*******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

12-14

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Return Value

Note

See Also

Example

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel pActCntV Logical channel number, detected by M7CntInit Pointer to current counter status

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

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

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

Function: M7CntInit, M7CntStopAndRead

#include M7CNT.H M7CNT_LOGCHANNEL DWORD Ch5; ZaehlerStand;

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

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);

Description

Return Value

12
Example #include M7CNT.H M7CNT_LOGCHANNEL M7CNT_DIAGINFO

See Also

12-16


Parameter Meaning LogChannel pDiagInfo Logical channel number, detected by M7CntInit Pointer to M7CNT_DIAGINFO structure with the diagnostics information

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 receive 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 information. The structure of the diagnostics data set DS1 is explained in Chapter 13.

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

Ch5; CntDiagInfo;

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

Function: M7CntInit, M7CntReadParError Structure: M7CNT_DIAGINFO

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Return Value

See Also

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel pActLoad Logical channel number, detected by M7CntInit Pointer to the ActLoad load value

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

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

Function: M7CntInit, M7CntLoadAndStart, M7CntLoadDirect, M7CntLoadPrep

12

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);

Description

Return Value

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

Example

12-18


Parameter Meaning LogChannel pParError Logical channel number, detected by M7CntInit Pointer to pParError parameterization error

You call this function if you have received a diagnostics interrupt (diagnostics 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.

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

#include M7CNT.H M7CNT_LOGCHANNEL WORD Ch5; ParError;

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

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Return Value

Example

See Also

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel pCntStatus Logical channel number, detected by M7CntInit Pointer to the M7CNT_STATUS structure with the counter status

When this function is called, the counter status byte and the status of the inputs 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.

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

#include M7CNT.H M7CNT_LOGCHANNEL Ch5;

12

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

Function: M7CntInit, M7CntResetStatus Structure: M7CNT_STATUS

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);

Description

Return Value

12
See Also Function: M7CntInit, M7CntReadStatus Structure: M7CNT_STATUS Example #include M7CNT.H M7CNT_LOGCHANNEL Ch5;

12-20


Parameter Meaning LogChannel SelSynr Logical channel number, detected by M7CntInit The Counter synchronization reached status bit is reset (TRUE) or not reset (FALSE) The Zero pass, Overflow, Underflow status bits are reset (TRUE) or not reset (FALSE) SelCmpStatus

The Counter synchronization reached, Zero pass, Overflow, and Underflow status bits of the counter channel can be reset using this function.

0 00

The function has been executed successfully An error has occurred


Error Code Meaning The channel specified when calling (LogChannel parameter) is not valid.

M7CNTE_NO_LOGCHANNEL

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

FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Return Value

See Also

Example

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel Logical channel number, detected by M7CntInit

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 control. In the case of the operating modes with hardware gate control, an operator error is signaled.

0 00

The function has been executed successfully An error has occurred


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

M7CNTE_NO_LOGCHANNEL

M7CNTE_FS_NO_START

Function: M7CntInit, M7CntLoadAndStart

12

#include M7CNT.H M7CNT_LOGCHANNEL Ch5;

if ((Err = M7CntStart (Ch5)) != M7CNT_DONE) {...error handling...}

12-21

M7 Reference Counter Function Library

12.18 M7CntStop

Function

Stop Counter Channel

Syntax

#include <m7cnt.h> M7ERR_CODE M7CntStop(M7CNT_LOGCHANNEL LogChannel);

Description

Note

Return Value

12

See Also

Example

12-22


Parameter Meaning LogChannel Logical channel number, detected by M7CntInit

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

When the M7CntStop function is called in the operating modes with hardware gate control, the counter channel cannot be started until the parameters have been reassigned. 0 00 The function has been executed successfully An error has occurred
Error Code M7CNTE_NO_LOGCHANNEL Meaning The channel specified when calling (LogChannel parameter) is not valid. Operator error: the counter channel cannot be stopped in this operating mode

M7CNTE_FS_NO_STOP

Function: M7CntInit, M7CntLoadAndStart, M7CntStart, M7CntStopAndRead

#include M7CNT.H M7CNT_LOGCHANNEL Ch5; if ((Err = M7CntStop (Ch5)) != M7CNT_DONE) {...error handling...}
FM 350 Counter Function Module C79000-G7076-C350-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);

Description

Note

Return Value

See Also

FM 350 Counter Function Module C79000-G7076-C350-01


Parameter Meaning LogChannel pActCntV Logical channel number, detected by M7CntInit Pointer to current counter status

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 control, 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

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

0 00

The function has been executed successfully An error has occurred


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

12

M7CNTE_NO_LOGCHANNEL

M7CNTE_FS_NO_STOP

Function: M7CntInit, M7CntStop, M7CntStart, M7CntLoadAndStart

12-23

M7 Reference Counter Function Library

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

12

12-24

FM 350 Counter Function Module C79000-G7076-C350-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; /* Bit 0: IOpenGate /* Bit 1: ICloseGate /* Bit 2: Ioflw /* Bit 3: Iuflw /* Bit 4: ICmp1Up /* Bit 5: ICmp1Dn /* Bit 6: ICmp2Up /* Bit 7: ICmp2Dn /* Bit 8: Izero /* Bit 9 bis 11: /* Bit 12: Isync /* Bit 13 bis 15: UWORD EncSel; UWORD WireBrk; UWORD SigEval; UWORD FilCnt; UWORD FilDI; unsigned CntMod:1; unsigned SynMod:1; unsigned SynZero:1; unsigned SigInv:1; unsigned ModHWG:1; unsigned ConGate:1; unsigned ConHWG:1; unsigned ConSWG:1; unsigned : 8; UWORD MethDQ0; UWORD MethDQ1; UWORD PulsDur; UWORD HystVal; UWORD OpMod; UWORD Reserved12; UWORD Reserved13; UWORD Reserved14; UWORD Reserved15; } M7CNT_PARAM;

/* Interrupt mask bits */ Int. on opening the gate */ Int. on closing the gate */ Int. on overflow*/ Int. on underflow */ Int. on reaching comp. val.1 up*/ Int. on reaching comp. val.1 down*/ Int. on reaching comp. val.2 up*/ Int. on reaching comp. val.2 down*/ Int. on zero pass */ Reserve */ Int. on synchronization */ Reserve */ /* Encoder selection */ /* Activate wirebreak detector*/ /* Evaluation of the signals */ /* Input filter counter inputs*/ /* Input filter digital inputs*/ /* Count mode */ /* Synchronization type */ /* Zero mark on synchronization */ /* Inv. of cnt inp. signals */ /* Gate setting HW gate */ /* Gate contr. for cont. cnt*/ /* HW gate for cont. cnt */ /* SW gate for cont. cnt */ /* Reserve */ /* Behavior of output Q0 */ /* Bahavior of output Q1 */ /* Pulse duration */ /* Hysteresis */ /* Operating mode */ /* Reserve */ /* Reserve */ /* Reserve */ /* Reserve */

12

Note

The reserve bits and words of the structure must be initialized with 0, otherwise the counter channel could enter an undefined state. The hysteresis value cannot be set and the HystVal parameter is not evaluated.

FM 350 Counter Function Module C79000-G7076-C350-01

12-25


M7 Reference Counter Function Library
Table 12-1 SynMod CntMod FilDI FilCnt; SigEval WireBrk EncSel Isync Izero ICmp2Dn ICmp2Up ICmp1Dn ICmp1Up Iuflw Ioflw ICloseGate IOpenGate Interrupt mask bits (word 0) Parameter Synchronization type Count mode Input filter for digital inputs Input filter for counter inputs Evaluation of the signals WORD Diagnostics active for wirebreak detection on signal pair Receiver selection Interrupt on synchronization Interrupt on zero pass Interrupt on reaching compar- BOOL ison value 2 in down direction Interrupt on reaching compar- BOOL ison value 2 in up direction Interrupt on reaching compar- BOOL ison value 1 in down direction Interrupt on reaching compar- BOOL ison value 1 in up direction Interrupt on underflow Interrupt on overflow Interrupt on closing the internal gate Interrupt on opening the inter- BOOL nal gate Detailed Specifications of the Parameterization Data Meaning BOOL BOOL WORD WORD WORD WORD BOOL BOOL BOOL BOOL BOOL Data Type { 32 bit (without sign) | +/ 31 bit } { 200 kHz | 20 kHz } with FM 350, 450-1 { 200 kHz | 50 kHz } with IF 961-CT1 { 200 kHz | 20 kHz } with FM 350, 450-1 { 200 kHz | 50 kHz } with IF 961-CT1 {single | double | quadruple | clock | direction} { A, B, N | A | A,B | no diagnostics}

12

12-26

{5-V count signal

{5V-count signal | 24V-count signal} bei IF 961-CT1

{masked | free}

{masked | free}

{masked | free}

{masked | free}

{masked | free}

{masked | free}

{masked | free}

{masked | free}

{masked | free}

{masked | free}

24-V count signal source output 24-V count signal sink output} with FM 350/4

{ single | periodic }

Value Range

FM 350 Counter Function Module C79000-G7076-C350-01

{0|1|2}

{0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1} {0|1| 2 |3} {0|1| 2|3}
Coding

Default

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Bit

12

1 0 8 7 6 4 3 2 1 0

FM 350 Counter Function Module C79000-G7076-C350-01

Table 12-1 Parameter

OpMod

HystVal

PulsDur

MethDQ1

MethDQ0

ConSWG

ConHWG

ConGate

ModHWG

SigInv

SynZero

See Section 9.7 Behavior of the Digital Outputs

Operating mode

Hysteresis

Pulse duration

Behavior of output Q1

Behavior of output Q0

Software gate for continuous counting mode

Hardware gate for continuous BOOL counting mode

Gate control for continuous counting mode

Gate setting hardware gate

Change of direction with track B

Zero mark on synchronization BOOL

Detailed Specifications of the Parameterization Data Meaning Data Value Range Type

WORD

WORD

WORD

WORD

WORD

BOOL

BOOL

BOOL

BOOL

periodic counting with HW gate }

periodic counting with SW gate |

single counting with HW gate|

single counting with SW gate |

{ Continuous counting (with or without gate) |

{ 0 : 255 } D cannot be set, the parameter is not evaluated

{ 0 : 500 } D

active for Pulse duration on overrange or underrange }*

active for Pulse duration on underrange down direction |

active for Pulse duration on overrange up direction |

active from comparison value to underflow |

active from comparison value to overflow |

{ switch off |

{ disabled | free }

{ disabled | free }

{ disabled | enabled }

{level-controlled| edge-controlled}

{ not inverted | inverted }

{with zero mark | without zero mark }

M7 Reference Counter Function Library

{ 0:FF } H

{0:1F4} H

{0|1}

{0|1}

{0|1}

{0|1}

{0|1}

{0|1}

Coding

{0|

{0|

4}

5}

1|

3|

2|

4|

3|

2|

1|

Default

12-27
Bit

7 6 5 4 3 2

12

M7 Reference Counter Function Library

12.22 M7CNT_STATUS

Function

The structure is used for status scanning with the M7CntReadStatus function.

Syntax

struct { unsigned unsigned unsigned unsigned unsigned

StsSet:1; :1; StsSta:1; StsStp:1; StsCmp1:1;

/* /* /* /* /*

unsigned StsCmp2:1; unsigned :2; unsigned StsRun:1; unsigned StsDir:1; unsigned StsZero:1; unsigned StsOflw:1; unsigned StsUflw:1; unsigned StsSync:1; unsigned StsGate:1; unsigned StsSWG:1; } M7CNT_STATUS;

Status: SET input 1 = active */ Filler bit*/ Status: START input 1 = active */ Status: STOP input 1 = active */ Status:Output comparator 1 1 = on */ /* Status: Output comparator 2 1 = on */ /* Reserve */ /* Status: Counter is running */ /* Status: Direction of count, 0 = up, 1 = down*/ /* Status: Zero pass 1 = occurred*/ /* Status:Counter overflow 1 = occurred*/ /* Status: Counter underflow 1 = occurred */ /* Status: Counter synchronization 1 = carried out */ /*Status gate, 1 = open*/ /* Status SW gate, 1 = open */

12

12-28

FM 350 Counter Function Module C79000-G7076-C350-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 return value is of the M7ERR_CODE data type. The function supplies the following return values: M7CNT_DONE: !=M7CNT_DONE: Function completed successfully 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.

Table 12-2

Operator Errors Error Code No. 1 2 Meaning The counter cannot be started in this operating mode The counter cannot be stopped in this operating mode Remedy Select an operating mode with software gate control Select an operating mode with software gate control

M7CNTE_FS_NO_START M7CNTE_FS_NO_STOP

FM 350 Counter Function Module C79000-G7076-C350-01


Return Value Meaning 0 No error 1 to 99 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)

12

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 wrong Channel = {1 | 2} for FM 450-1 The I/O type (Ptype parameter) specified at the call is wrong PType={M7IO_IN | M7IO_OUT}

M7CNTE_PTYPE_WRONG M7CNTE_NO_LOGCHANNEL

1001 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 A time overflow has occurred when accessing the counter channel since the counter has not responded The submodule/module at the address specified is not a counter submodule/module Check to see if the accessed submodule is a counter module or a counter interface submodule or if the submodule is defective Check to see if the correct starting address of the counter module or the counter interface submodule has been specified in the Baddr parameter of the M7CntInit function Check to see if the correct starting address of the counter module or the counter interface submodule has been specified in the Baddr parameter of the M7CntInit function

M7CNTE_TIMEOUT

1003

M7CNTE_NO_COUNTER

1004

M7CNTE_INVALID_BADDR

1005

There is no submodule/module at the address specified

12

12-30

FM 350 Counter Function Module C79000-G7076-C350-01

M7 Reference Counter Function Library

Table 12-4

Parameterization Errors Error Code No. 201 Meaning Coding for receiver selection wrong Remedy Please change the relevant parameter of the M7CNT_PARAM* structure or in the case of the FM 350 the coding key.


M7CNTE_PAR_ENC_SEL M7CNTE_PAR_WIRE_BRK M7CNTE_PAR_SIG_EVAL M7CNTE_PAR_FIL_CNT M7CNTE_PAR_FIL_DI 202 203 204 205 206 207 208 209 210 211 Coding for diagnostics of the signal pair wrong Coding for the evaluation of the signals wrong Coding for input filter counter input 24 V wrong Coding for input filter digital inputs wrong M7CNTE_PAR_SIG_INV Change of direction not permissible M7CNTE_PAR_METH_DQ0 M7CNTE_PAR_METH_DQ1 M7CNTE_PAR_PULS_DUR M7CNTE_PAR_HYST_VAL M7CNTE_PAR_OP_MOD Coding for behavior of Q0 wrong Coding for behavior of Q1 wrong Please change the relevant parameter of the M7CNT_PARAM M7CNT PARAM Pulse duration too long st uctu e structure* Hysteresis too great Wrong operating mode M7CNTE_PAR_SW_HW_GATE 212 M7CNTE_PAR_DIR_IMP_AL M7CNTE_PAR_AL_GATE 215 216 Both gate types or no gate type specified Direction for pulse output and process interrupt must be same Interrupts from internal gate only possible in operating mode with gate M7CNTE_PAR_AL_METH_DQ 217 Output behavior and interrupt mask (first word) do not match**
*

See M7CNT_PARAM structure, Table 12-1

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 350 Counter Function Module C79000-G7076-C350-01

12-31

M7 Reference Counter Function Library

12

12-32

FM 350 Counter Function Module C79000-G7076-C350-01

Faults and Diagnostics

13

This Chapter...

Operator errors, incorrect wiring or contradictory parameterization (position of the coding connector does not match parameterization) can cause faults that the module must indicate to the user. Faults are divided into the following classes on the module:

S Faults displayed by the group error LED that indicate internal and external module faults.

S Faults that can initiate a diagnostics interrupt. S Operator errors.


These different classes of faults are indicated and displayed at different positions 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 Overview
Section 13.1 13.2 13.3 13.4 Contents Fault Indication via the Group Error LED Initiation of Diagnostics Interrupts Data Errors Operator Errors Page 13-2 13-3 13-6 13-7

FM 350 Counter Function Module C79000-G7076-C350-01

13-1

Faults and Diagnostics

13.1 Fault Indication via the Group Error LED

Where is the Fault Indicated?

If the red group error LED lights up, a fault has occurred either on the module (internal fault) or at the cable connections (external fault).

Which Faults are Indicated?


Type of Fault/LED Internal faults

The following faults are indicated by the group error LED lighting up:
Cause of Fault Fault in EPROM TEST Fault in RAM TEST Watchdog tripped Lost process interrupt Module parameterization missing Change module Change module Change module Acknowledged by process interrupt handling Assign parameters and transfer Correct the position of the coding connector Remedy

External faults

Coding connector wrongly connected

Auxiliary voltage 1L+/1M not connected Correct connection or 24 VDC encoder supply short-circuited 5.2 VDC encoder supply short-circuited or overloaded Fault in 5 V encoder signals (wirebreak, short-circuit, cable missing) Correct connection Correct connection

Module parameterization does not match Correct parameterization and transfer, or reconnect the coding connector the position of the coding connector

Initiating a Diagnostics Interrupt

All faults except the EPROM test fault, can initiate a diagnostics interrupt provided you have enabled the diagnostics interrupt in the relevant parameter 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 diagnostics data sets DS0 and DS1 are described in the next section.

13

13-2

FM 350 Counter Function Module C79000-G7076-C350-01

Faults and Diagnostics

13.2 Initiation of Diagnostics Interrupts

What is a Diagnostics Interrupt?

If a user program is to respond to an internal or external fault, you can parameterize a diagnostics interrupt that stops the cyclical program of the CPU and calls the diagnostics interrupt OB (OB82).

Which Events Can Initiate a Diagnostics Interrupt?

The list shows you which events can initiate a diagnostics interrupt:

S External auxiliary voltage 1L+/1M short-circuited or overloaded S Fault in 5.2 VDC encoder supply S Module parameterization missing 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 Diagnostics Interrupt

You disable or enable the interrupts for the module in the parameter assignment screen forms and you decide there whether the module is to initiate a diagnostics interrupt and/or a process interrupt.

Responses to a Diagnostics Interrupt

If an event occurs that can initiate a diagnostics interrupt, the following happens:

S The diagnostics information is stored in diagnostics data sets DS0 and


DS1.

S The group error 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 Set DS0 and DS1

The information as to which event has initiated a diagnostics interrupt is 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 350 Counter Function Module C79000-G7076-C350-01

13-3

Faults and Diagnostics

Reading the Data Set from the Module

The diagnostics data set DS0 is automatically transferred to the start information when the diagnostics OB is called.These four bytes are stored there in 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 the Diagnostics Data Set DS0 in the Start Information


Table 13-1 Byte 0 0 1

Table 13-1 shows the assignments of diagnostics data set DS0 in the start information. All unlisted bits are insignificant and take the value zero.

Assignments of Diagnostics Data Set DS0 Bit Meaning Module in fault Internal fault Remarks Set for every diagnostics event Set for all internal faults: Event No. 8:x:00 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+/1M not connected or 5.2 VDC encoder supply short-circuited

S 5.2 VDC encoder supply short-circuited or overloaded

S Fault in 5 V signals S Parameterization error


3 4 6 7 1 0 ... 3 4 2 3 3 3 6 Fault in one channel Fault in external auxiliary voltage Parameterization missing Error in parameterization Type class Channel information Watchdog tripped RAM defective Process interrupt lost See DS1, byte 4 for further breakdown Check voltage Execute parameterization 8:x:03 8:x.04 8:x:06

See Section 13.3 Data Errors for further 8:x:07 breakdown Always assigned 8 Always assigned 1 Module defective or strong interference 8:x:33 Module defective or strong interference 8:x:43 Check configuration. Process interrupt 8:x:46 event has been detected and cannot be signaled since the same event has not yet been acknowledged by the user program/CPU

13

13-4

FM 350 Counter Function Module C79000-G7076-C350-01

Faults and Diagnostics

Diagnostics Data Set DS1

The diagnostics data set DS1 consists of 16 bytes. The first 4 bytes are identical 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 the DB of the FC CNT_CTRL from DW54 by the FC DIAG_INF.

Table 13-2 Byte 4

Assignments of the Bits of Bytes 4 to 11 of Diagnostics Data Set Bit 0 ... 6 7 Channel type Further channel types Diagnostics information length Number of channels Channel fault vector Fault in signal A Fault in signal B Fault in signal N Fault in 5.2 V encoder supply Reserved Reserved Meaning Remarks Always assigned 76H Always assigned 0 Always assigned 2 Always assigned 1 Always assigned 1 8:x:B0 8:x:B1 8:x:B2 8:x:B4 Event No.

5 6 7 8

0 ... 7 0 ... 7 0 0 1 2 4 5 ... 7

9 ... 15

How Does the Diagnostics Text Appear in the Diagnostics Buffer?

If you want to enter the diagnostics message in the diagnostics buffer, you must call the SFC 52 Enter user-specific message in diagnostics buffer in the user program. The event number of the diagnostics message in each case 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 diagnostics 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.

13

FM 350 Counter Function Module C79000-G7076-C350-01

13-5

Faults and Diagnostics

13.3 Data Errors

When Do Data Errors Occur?

If new parameters are transferred to the module, the FM 350 checks these parameters. If errors occur during this check, the module signals these data errors. Wrong parameters are not accepted by the module.

Where are Data Errors Indicated?

The FC CNT_CTRL enters the data errors with their error numbers in the DB of the FC 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 No. 0 200 201 202 203 204 205 206 207 208 209 211 212 215 No error Coding connector wrongly connected or missing Value too great for receiver selection Value too great for diagnostics of signal pair Value too great for signal evaluation Value too great for input filter of the 24 V counter signals Value too great for the input filter of the digital inputs Change of direction not permissible Value too great for behavior of the digital output Q0 Value too great for behavior of the digital output Q1 Pulse duration wrong or too long Wrong operating mode selected No gate specified or both gates specified 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. Interrupts from the gate control only possible in the operating modes with gate control. In the case of the behavior of the digital outputs Active between the comparison value and overflow or Active between comparison value and underflow, no interrupt is permissible on reaching the comparison values. Data Error Numbers and their Meanings Meaning

13
216 217

How are Data Errors Acknowledged?

Correct the values for the parameters in accordance with the specifications. Transfer the corrected parameter set again to the FM 350. The FM 350 checks the parameters again and deletes the data error in DB.

13-6

FM 350 Counter Function Module C79000-G7076-C350-01

Faults and Diagnostics

13.4 Operator Errors

When Do Operator Errors Occur?

Operator errors occur when you operate the module wrongly by setting incorrect control signals.

Where are the Operator Errors Indicated?

The operator error numbers are entered in DB by the FC CNT_CTRL. You can access this data word in your program via the variable identifier OT_ERR_B.

What Operator Errors Exist?

Table 13-4 shows the possible numbers of the operator errors and their meaning.
Table 13-4 Numbers of the Operator Errors and their Meaning Meaning No error Operating mode cannot be started with software gate Operating mode cannot be aborted Only permissible if OD is active

Error Number 0 1 2 4

How are Operator Errors Acknowledged?

Acknowledge the error with the OT_ERR_A parameter in DB.

13

FM 350 Counter Function Module C79000-G7076-C350-01

13-7

Faults and Diagnostics

13

13-8

FM 350 Counter Function Module C79000-G7076-C350-01

Technical Specifications

A
Contents Page A-3

This Chapter... Chapter Overview

The technical specifications of the FM 350 are listed in this chapter.


Section A.1 Technical Specifications

UL/CSA Approvals

The following approvals are available for the S7-300: UL-Recognition-Mark Underwriters Laboratories (UL) to Standard UL 508 CSA-Certification-Mark Canadian Standard Association (CSA) to Standard C 22.2 No. 142, File LR 48323

FM 350 Counter Function Module C79000-G7076-C350-01

A-1

Data Sheet

FM Approval

The following FM approval has been issued for the S7-300: 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-300. The S7-300 must always be de-energized prior to separating plug-in connections in hazardous areas.

!
CE Marking

Warning WARNING - DO NOT DISCONNECT WHILE CIRCUIT IS LIVE UNLESS LOCATION IS KNOWN TO BE NONHAZARDOUS

Our products meet the requirements of EU Directive 89/336/EWG Electromagnetic 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 authorities at the address below: Siemens Aktiengesellschaft Bereich Automatisierungstechnik AUT E 148 Postfach 1963 D-92209 Amberg Federal Republic of Germany

Area of Application

SIMATIC products have been designed for use in the industrial area. They can also be used in the domestic environment (household, business and trade area, small plants) with individual approval. You must acquire the individual approval from the respective national authority or testing body. Area of Application Requirements Emitted interference Immunity EN 50082-2 : 1995 EN 50082-1 : 1992

A
Observing the Installation Guidelines

Industry Domestic

EN 50081-2 : 1993 Individual approval

SIMATIC products meet the requirements if you observe the installation guidelines described in the manual when installing and operating the equipment.

A-2

FM 350 Counter Function Module C79000-G7076-C350-01

Data Sheet

A.1

Technical Specifications
40  125  120 approx. 650 g 24 VDC 20.4 ... 28.8 V Yes 24VDC Data on the Counter Signals and the Digital Inputs and Outputs Counter inputs 5 V

Dimensions and Weight Dimensions W H D (mm) Weight Voltages, Currents, Potentials Auxiliary voltage 1L+/1M S Range S Reverse polarity protection Load voltage 2L+/2M

S Level S S S S S S S S
Terminating resistance Differential input voltage Max. counting frequency Galvanic isolation to the S7-300 bus Low level High level Input current Minimum pulse width, (max. count frequency)

In accordance with RS 422 approx. 220 ohms min. 0.5 V 500 kHz No

20.4 ... 28.8 V S Range S Reverse polarity protection Yes S Galvanic isolation Yes, to all other voltages 5 V encoder supply

Counter inputs 24 V 30 ... + 5 V + 11 ... + 30 V typ. 9 mA w 2.5 ms (200 kHz), w 25 ms (20 kHz) (parameterizable) No

S Output voltage S Output current


24 V encoder supply

5.2 V " 2% max. 300 mA, short-circuit protected 1L+ 3V max. 300 mA, short-circuit protected

S Output voltage S Output current


Current consumption

S Galvanic isolation to
S7-300 bus Digital inputs

S From S7-300 bus S From 1L+


Power losses of the module Status, Interrupts, Diagnostics Status indication

approx. 160 mA approx. 20 mA (without encoder) approx. 4.5 W

S S S S

Low level High level Input current Mimimum pulse width, (max. count frequency)

30 ... + 5 V + 11 ... + 30 V typ. 9 mA w 2.5 ms (200 kHz), w 25 ms (20 kHz) (parameterizable) 2L+ / 2M Yes, to all others except the digital inputs min. 2L+ 1.5 V max. 3 V 0.5 A 5 mA to 0.6 A max. 300 ms limited to 2L+ 39 V Yes

Digital outputs

Yes, 14 green LEDs for status of CR, DIR, I0, I1, I2, Q0, Q1 Yes, parameterizable Yes, parameterizable Yes Yes, red LED Yes

S Supply voltage S Galvanic isolation S Output voltage S S S S


High level signal 1 Low level signal 0 Switching current Nominal value Range Switching time Cutoff voltage (ind.) Shortcircuit protection

Interrupts

S Process interrupt S Diagnostics interrupt


Diagnostics functions

S Fault indication on the


read out

module for group errors

S Diagnostics information

Note Further relevant data, for example, environmental conditions, are listed in manual /1/.

FM 350 Counter Function Module C79000-G7076-C350-01

A-3

Data Sheet

A-4

FM 350 Counter Function Module C79000-G7076-C350-01

Spare Parts

B
Table B-1 lists all spare parts of the S7-300 that you can order for the FM 350 either additionally or later.
Table B-1 Accessories and Spare Parts Parts for the S7-300 Expansion bus Labeling sheet Slot number plate Screw-type front connector (20-pin) Shield attachment (with 2 screw-type bolts) Shield connection terminals for Order Number 6ES7 390-0AA00-0AA0 6ES7 392-2XX00-0AA0 6ES7 912-0AA00-0AA0 6ES7 392-1AJ00-0AA0 6ES7 390-5AA00-0AA0

Spare Parts

S 2 cables with 2 to 6 mm shield diameter each 6ES7 390-5AB00-0AA0 S 1 cable with 3 to 8 mm shield diameter 6ES7 390-5BA00-0AA0 S 1 cable with 4 to 13 mm shield diameter
6ES7 390-5CA00-0AA0 Measuring range submodule for analog modules (coding connector) 6ES7 974-0AA00-0AA0

FM 350 Counter Function Module C79000-G7076-C350-01

B-1

Spare Parts

13

B-2

FM 350 Counter Function Module C79000-G7076-C350-01

References

C
The table below lists all the manuals referred to in this manual.
No. /1/ Title SIMATIC S7; S7300 Programmable Controller; Hardware and Installation SIMATIC; System Software for S7-300 and S7-400 System and Standard Functions Order Number 6ES7 040-0AA01-8AA0

Supplementary References

/2/

Included in package: 6ES7 810-4BA01-8AR0

FM 350 Counter Function Module C79000-G7076-C350-01

C-1

References

13

C-2

FM 350 Counter Function Module C79000-G7076-C350-01

Glossary

Asymmetric Signals

Asymmetric signals are two pulse trains phase-shifted by 90 degrees and with a zero mark signal if required.

Configuration

Assignment of modules to mounting racks, slots and addresses. When configuring 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 signals, paths, positions, velocities, rotational speeds, weights, etc.

Encoders with Asymmetric Ouput Signals Encoders with Symmetric Output Signals

Encoders with asymmetric output signals generate two pulse trains phaseshifted by 90 degrees and with a zero mark signal if required.

Encoders with symmetric output signals generate two pulse trains phaseshifted by 90 degrees, with a zero mark signal if required, and the corresponding 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 (FM)

A function module (FM) is a module that offloads the CPU of the S7 and M7 programmable controllers of time-critical or memory-intensive process signal handling tasks. FMs normally use the internal communications bus for highspeed data exchange with the CPU. FM applications include: Counting, positioning, closed-loop control.

Incremental Encoders

Incremental encoders capture paths, positions, speeds, rotational speeds, weights, etc., by counting small increments.

FM 350 Counter Function Module C79000-G7076-C350-01

Glossary-1

Glossary

Increments per Encoder Revolution Initiator

Increments per encoder revolution specifies the number of increments that an encoder gives in one revolution.

An initiator is a simple BERO switch without direction information. It therefore 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 programmable 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 Evaluation

Quadruple evaluation means that all edges of the pulse trains A and B are 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 revolution.

Glossary-2

FM 350 Counter Function Module C79000-G7076-C350-01

Index
Symbols
+/31 bits count mode, 9-11 32 bits count mode, 9-11 Coding connector, 1-6 correct position, 3-3 Command: open and close gate, 9-16 Command: set counter, 9-19 Commands, 9-3 give, 9-4 Comparison value, 1-2, 2-2, 9-12 Connection incremental 24 V encoder, 4-8 incremental 5 V encoder, 4-7 Continuous counting, 2-3 Control bits, 9-4 Count limits, 2-2 Count range, 2-2 Counter signals, cables, 4-7 CSA, A-1

Numbers
24 V encoder signals, 4-4 input filter, 1-3, 4-4, 10-5 24 V signals, 10-4 24 VDC encoder supply, 4-4 5 V differential signals, 10-3 5.2 VDC encoder supply, 4-4

A
Approbation. See Approval Approval CSA, A-1 FM, A-1 UL, A-1 Auxiliary voltage 1L+, 1M, 4-4

D
Data errors, 13-6 Diagnostic data set DS0, assignments, 13-4 Diagnostics data set DS1, assignments, 13-5 Diagnostics interrupt, 13-2, 13-3 enabling, 13-3 OB 82, 13-3 Digital input I0, status, 9-17 Digital input I1, status, 9-17 Digital inputs cables, 4-7 input filter, 4-5 Digital outputs, 4-5 behavior, 9-12 enabling, 9-12 status, 9-12 switching off, 9-14

B
Basic parameter assignment, 9-3 Behavior of the digital outputs, marginal conditions, 9-14

C
Cables, 4-7 cross-section, 4-8 CE, marking, A-2 Checklist mechanical installation, 8-2 parameterization, 8-4

FM 350 Counter Function Module C79000-G7076-C350-01

Index-1

Index

E
ENSET_DN, 9-20 ENSET_UP, 9-20 External faults, 13-2

M
Main application area, 1-4 Marking, CE, A-2 Maximum number, of FM 350-1 used, 3-2 Mechanical configuration, 3-2

F
FM 350 installing on the DIN rail, 3-4 overview of commands, 9-3 overview of settings, 9-2 technical specifications, A-3 FM 450-1 overview of operating modes, 9-2 S7400 configuration, 1-7 Front connector, 1-5 terminal assignments, 4-2 wiring, 4-9 Front connector coding, 1-5 Front connector of the FM 350, 4-2

O
OB 40, 9-24 start information, 9-25 OB82, 13-3 Opening and closing the hardware gate, 9-10 Opening and closing the software gate, 9-5, 9-7, 9-9 Operating mode continuous counting, 9-5 Operating mode periodic counting, 9-9 Operating mode single counting, 9-7 Operating modes, 9-2 select, 9-4 Operator errors, 13-7 Order number, 1-6 Overflow, 9-11

G
Gate functions, 2-5 Gate stop function, 9-8, 9-10, 9-18 Group error LED, 13-2

P
Parameter assignment screen forms calling, 5-2 installing, 5-2 integral help function, 5-2 Periodic counting, 2-4 Process interrupt, 1-2, 9-24 enabling, 9-24 initiate, 9-24 OB 40, 9-24 Pulse duration default value, 9-15 value range, 9-15

H
Hardware gate, 2-5 edge-controlled opening and closing, 9-17 level-controlled opening and closing, 9-16 status, 9-17 Hysteresis, 1-3

I
Input delay, 4-5 Input filter, 4-5 Internal faults, 13-2

Q
Q0. See Digital outputs Q1. See Digital outputs Quadruple evaluation, 10-7

L
Labeling strips, 1-6 LEDs, function, 1-6 Load value, 2-2, 9-19 Load voltage, 4-6

R
READ ME file, 5-2

Index-2

FM 350 Counter Function Module C79000-G7076-C350-01

Index

RESET status, 4-10

S
Safety rules, 3-2 Selecting the gate function, 9-5, 9-7, 9-9 SET, 9-19 Setting the counter via the user program, 9-19 with an external signal, 9-19 with input I2, 9-20 with the zero mark, 9-22 Setting: behavior of the digital outputs, 9-12 Setting: counting mode, 9-11 Setting: pulse duration, 9-15 Settings, 9-2 select, 9-4 Shield attachment, 4-9 Single counting, 2-3

Slots, permitted, 3-2 Software gate, 2-5 opening and closing, 9-18 status, 9-18 Starting address, 3-2 Starting value, 1-2 Status bits, 9-4 Symmetric encoders, 10-3

T
Terminal assignment, 1-6

U
UL, A-1 Underflow, 9-11

FM 350 Counter Function Module C79000-G7076-C350-01

Index-3

Index

Index-4

FM 350 Counter Function Module C79000-G7076-C350-01

Siemens AG AUT E 146 stliche Rheinbrckenstr. 50 D76181 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 Chemical Electrical Machinery Food Instrument and Control Nonelectrical Machinery Petrochemical Pharmaceutical Plastic Pulp and Paper Textiles Transportation Other _ _ _ _ _ _ _ _ _ _ _

FM 350 Counter Function Module C79000-G7076-C350-01

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. 2. 3. 4. 5. 6. 7. 8. Do the contents meet your requirements? Is the information you need easy to find? Is the text easy to understand? Does the level of technical detail meet your requirements? Please rate the quality of the graphics/tables:

Additional comments: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _

FM 350 Counter Function Module C79000-G7076-C350-01

Anda mungkin juga menyukai