Ed-2002-022 (4634)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Messung Systems NEXGEN PLC I/O Modules

NEXGEN Series of PLCs


4-Channel Counter Input Module

(Ordering Code – 4634)

Document No.:ED-2002-022

Version: 1.0

Published Sept 2002

MESSUNG SYSTEMS
EL-2, J- Block MIDC Bhosari,
Pune – 411026.(INDIA)

Tel: (+91)-020-712 0807, 712 2807.


Email : marketing@ms.messung.com
WEB: www.messung.com

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 1 of 32
NEXGEN PLC I/O Modules Messung Systems

Revision

Version Date Description

4 Channel Counter Input Module


1.0 Sept 2002
(Ordering Code – 4634)

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 2 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

INDEX

1 MODULE OVERVIEW .......................................................................................................5


1.1 MODULE OVERVIEW .......................................................................................................5
1.2 LED INDICATIONS .........................................................................................................8
1.3 GENERAL SPECIFICATIONS ............................................................................................8
2 MODULE OPERATION .....................................................................................................9
2.1 BLOCK DIAGRAM ...........................................................................................................9
2.2 NORMAL INPUT............................................................................................................11
2.3 PULSE CATCH INPUT ...................................................................................................11
2.4 COUNTER INPUT ..........................................................................................................12
2.1.1 Counter Mode ....................................................................................................12
2.1.2 Encoder Mode ...................................................................................................13
2.1.3 Counter Operation .............................................................................................14
3 INSTALLATION AND WIRING........................................................................................16
3.1 MODULE INSTALLATION ................................................................................................16
3.2 CONNECTION DETAILS .................................................................................................16
3.2.1 Precautions to be taken .....................................................................................18
3.2.2 Differential Input Connections............................................................................19
3.2.3 Open Collector (NPN) Input Connections..........................................................20
3.2.4 Open Collector (PNP) Input Connections ..........................................................21
4 CONFIGURATION AND PROGRAMMING.....................................................................22
4.1 CONFIGURATION .........................................................................................................22
4.2 STATUS ......................................................................................................................23
4.3 INPUT AND OUTPUT MEMORY DATA MAPPING ...............................................................24
4.4 PROGRAMMING ...........................................................................................................25

INDEX OF FIGURES
FIGURE 1 :FRONT VIEW OF 4-CHANNEL COUNTER INPUT MODULE ..................................................6
FIGURE 2 : BLOCK DIAGRAM ......................................................................................................10
FIGURE 3 :PULSE CATCH INPUT..................................................................................................11
FIGURE 4 :COUNTER MODE........................................................................................................12
FIGURE 5 :ENCODER MODE .......................................................................................................13
FIGURE 6 : COUNTER.................................................................................................................14
FIGURE 7 :COUNTING RANGE .....................................................................................................14
FIGURE 8 : CONNECTION DIAGRAM OF 4 CHANNEL COUNTER INPUT MODULE ..............................17
FIGURE 9 : DIFFERENTIAL INPUT CONNECTIONS ..........................................................................19
FIGURE 10 : OPEN COLLECTOR (NPN) INPUT CONNECTIONS ......................................................20
FIGURE 11 : OPEN COLLECTOR (PNP) INPUT CONNECTIONS.......................................................21

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 3 of 32
NEXGEN PLC I/O Modules Messung Systems

Guidelines for the Safety of the user and protection


of I/O Modules.
This manual provides information for the use of the I/O Modules . The manual has been
written to be used by trained and competent personnel. The definition of such a
person or persons is as follows:
a) Any engineer who is responsible for the planning, design and construction of
automatic equipment using the product associated with this manual should be of a
competent nature, trained and qualified to the local and national standards required
to fulfill that role. These engineers should be fully aware of all aspects of safety with
regards to automated equipment.
b) Any commissioning or service engineer must be of a competent nature, trained
and qualified to the local and national standards required to fulfill that job. These
engineers should also be trained In the use and maintenance of the completed
product. This Includes being completely familiar with all associated documentation
for the said product. All maintenance should be carried out in accordance with
established safety practices.
c) All operators of the completed equipment should be trained to use that product in a
safe and coordinated manner in compliance to established safety practices. The
operators should also be familiar with documentation, which is connected with the
actual operation of the completed equipment.
Note: The term-completed equipment refers to a third party constructed device, which
contains or uses the product associated with this manual.
Note on the Symbol used in this Manual
At various times through out this manual certain symbols will be used to highlight points of
Information, which are Intended to ensure the users personal safety and protect the integrity
of equipment. Whenever any of the following symbols are encountered it’s associated.

Note must be read and understood. Each of the symbols used is listed below; with a brief
description of its meaning.

Warning !

This product can only function correctly and safely if it is installed


correctly, and maintained as recommended.

Warning !

The specifications of product and contents of manual are subject to


change without notice.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 4 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

1 Module Overview

This chapter describes the following

• Module overview
• LED Indications
• General specifications

1.1 Module overview

4 channel counter input module provides -

• 4 channels for counter inputs as A, B and Z. Four Z inputs can be


configured individually either as normal inputs (with 10 µs filter) or reset
to counter (with 10 µs pulse width minimum) or as pulse catch input (with
10 µs pulse width minimum).

• Software selectable counter operation modes as


o Counter Mode (x 1 count ) or
o Encoder Mode (x 2 count)

Input frequency up to 50 KHz for counter mode operation and 25 KHz for
encoder mode operation.

Hardware interface for differential (RS-422) inputs as well as open


collector ( PNP or NPN, 24 VDC ) inputs depending on type of
connections to the module.

The figure 1 shows front view of 4-Channel Counter Input module.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 5 of 32
NEXGEN PLC I/O Modules Messung Systems

Terminal
4634
COUNTER INPUT
Block Fixing
4CH
Screw

Module
Status
LED

Front
Shield
Plate
Input
Status
38 Pin
Removable LEDs
Terminal
Block

IO
Label

Terminal
Block Fixing
Screw

Figure 1 :Front view of 4-Channel Counter Input Module

The module provides LED indications on the front. Brief information about
inputs can be written on the front door. Behind front door, 38-pin removable
terminal block is provided for interfacing. The wiring details are shown on
backside of door.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 6 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

The 4 channel counter input module can be configured in any slot of the
PLC. The number of such modules is limited by back panel current capacity.
The input signals are optically isolated and filtered. 4 channel counter input
module provides various configuration options. These options along-with
corresponding inputs are given in a tabular form below.

Input Primary function Special function


Pulse Catch Input or
0 Normal Input
Reset to Counter0
Pulse Catch Input or
1 Normal Input
Reset to Counter1
Pulse Catch Input or
2 Normal Input
Reset to Counter2
Pulse Catch Input or
3 Normal Input
Reset to Counter3
Counter0 Pulse Input /
4 Not Applicable
Encoder0 A Phase Input
Counter0 Direction Input /
5 Not Applicable
Encoder0 B Phase Input
Counter1 Pulse Input /
6 Not Applicable
Encoder1 A Phase Input
Counter1 Direction Input /
7 Not Applicable
Encoder1 B Phase Input
Counter2 Pulse Input /
8 Not Applicable
Encoder2 A Phase Input
Counter2 Direction Input /
9 Not Applicable
Encoder2 B Phase Input
Counter3 Pulse Input /
10 Not Applicable
Encoder3 A Phase Input
Counter3 Direction Input /
11 Not Applicable
Encoder3 B Phase Input

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 7 of 32
NEXGEN PLC I/O Modules Messung Systems

1.2 LED Indications

The following table explains significance of LEDs provided on the module.

LED Color Status Description


OFF Module Healthy and configured.
Error (1) Yellow Module Hardware Fault
ON
Module not configured
Inputs (12) OFF Input OFF
One for Green
each input ON Input ON

1.3 General Specifications

General specifications of 4 channel counter input module are as below

Inputs 12
Type of inputs Sink / source / differential selectable by type of connections to module
Counter Input Channels 4 maximum ( A, B, Z inputs for each channel)
Filter 10 µs
Minimum pulse width 10 µs for pulse catch type of input and reset type of input
50 KHz in Counter Mode of Operation
Maximum frequency
25 KHz in Encoder Mode of Operation
ON time minimum 10 µs for counter inputs
OFF time minimum 10 µs for counter inputs
3 mm Green LED for each input provided on digital side
Indications
3 mm Yellow LED for Error
7 mA for Sink / source input
Current
17 mA for differential input
Isolation Optical (1.5KV from internal bus)
Back plane current 210 mA
IO points consumed 12 Input bits and 8 output bits
Terminal connection Removable 38 pin Terminal block
Ordering code 4634

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 8 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

2 Module Operation

This chapter describes the basic operation of the module. This chapter
explains operational details of

Normal Input
Pulse Catch Input
Counter Mode
Encoder Mode

2.1 Block Diagram

The module operation is controlled by configuration written by application


program. All the input signals are optically isolated. Depending upon
configuration in application program, mode of operation is selected for the
inputs and counters are configured. The figure on next page shows block
diagram of Module. The details of operation are discussed in subsequent
sections.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 9 of 32
NEXGEN PLC I/O Modules Messung Systems

CPU Normal Input 0

Pulse Catch Input 0 Input 0


Mode Optical
Counter 0 Z Selection Isolation
Circuit
A Input 4

B Input 5

Normal Input 1

Pulse Catch Input 1 Input 1


Mode Optical
Counter 1 Z Selection Isolation
Circuit
A Input 6

B Input 7
Interface
Circuit
Normal Input 2

Pulse Catch Input 2 Input 2


Mode Optical
Counter 2 Z Selection Isolation
Circuit
A Input 8

B Input 9

Normal Input 3

Pulse Catch Input 3 Input 3


Mode Optical
Counter 3 Z Selection Isolation
Circuit
A Input 10

B Input 11

Figure 2 : Block Diagram

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 10 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

2.2 Normal Input


First four inputs 0, 1, 2 and 3 can be configured as fast inputs individually
with filter time 10 µs. The filter time adds delay in taking relevant control
action after sensing the input. The status of these inputs is available in input
image. Normally, status of these inputs is updated in input scan.

2.3 Pulse Catch Input

The module provides first four inputs four inputs 0, 1, 2 and 3 as configurable
pulse catch inputs individually. These inputs can detect pulses having
minimum ON time 10 µs. The status of these inputs is available in input
image. The following figure describes operational details of Pulse Catch
input.

PLC Scan PLC Scan PLC Scan PLC Scan PLC Scan PLC Scan

Input Image
Status

Field This pulse is


Input ignored

10 µs

Figure 3 :Pulse Catch Input

The pulse catch input latches the pulse till it is read in subsequent input scan.
After reading, the pulse catch control logic is again set to catch next pulse.
As can be seen, if additional pulses occur after latching of the first pulse and
reading of the same, then these pulses are not recognized. Thus the time
between two consecutive pulses should be more than the PLC scan time.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 11 of 32
NEXGEN PLC I/O Modules Messung Systems

2.4 Counter Input

The module provides two modes of counting operation


• Counter Mode
• Encoder Mode

2.1.1 Counter Mode

In this mode, pulse input is interfaced to A input. direction input is interfaced


to B Input. Counter increments its count by 1 at rising edge of pulse input if
direction input is FALSE. Counter decrements its count by 1 at rising edge of
pulse input if direction input is TRUE. The following figures show the
behavior of counter mode.

Count

Figure 4 :Counter Mode

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 12 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

2.1.2 Encoder Mode

In this mode, encoder phase A input is interfaced to A input, phase B is


interfaced to B input and zero marker input is interfaced to Z input. If A phase
is leading to B phase, counter increments. Counter increments its count by 1
at rising and falling edge of pulse input if A phase is leading to B phase.
Counter decrements its count by 1 at rising edge and falling edge of pulse
input if A phase is lagging to B phase. The following figures show the
behavior of encoder mode.

Count

Figure 5 :Encoder Mode

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 13 of 32
NEXGEN PLC I/O Modules Messung Systems

2.1.3 Counter Operation

The module provides four hardware counters with configurable reset input.
The range of counter is -2048 to 2047. Counters can be configured for
required mode of operation.The configuration is written to module by
executing WRITE_W instruction. The hardware counter value and reset input
status can be read by executing READ_W instruction. The reset input clears
hardware counter. The Z input, if not configured as reset input, can be used
as normal input or pulse catch input. The figures below show the block
diagram and counting range.

A
WRITE Mode
Configuration Instruction Selection B
Circuit Z

READ
Instruction Hardware
Counter

Status of Z Input Difference Count

Figure 6 : Counter

Up Direction

Down Direction
-2148 0 2047

Figure 7 :Counting Range

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 14 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

Hardware counter counts up to 2047 when B input is FALSE. Counter counts


up to -2048 when B input is TRUE. When counter reaches the maximum
value i.e. 2047 or -2048, it rolls over to 0. Care should be taken to use
counter in operational range to avoid unpredictable results.

READ_W reads hardware counter value which is available in 16 bit integer


format and reset input status. When ever counter value is read, it is stored in
user defined register and after that hardware counter is cleared. In this way
every time when ever hardware counter is read using READ_W instruction,
difference count ( i.e. count from last instruction call to current call) is
available. So this count has to be accumulated in user defined register by
adding current count to previous count.

When reset input is TRUE, hardware counter is cleared and reset status is
latched. When ever reset status is read, it is stored in user defined register
and after that latch is cleared. This provision is useful as external reset input
when TRUE, clears the counter asynchronous to PLC scan and counter can
count further pulses if reset input is FALSE again. In such a case, the status
of external reset input is available till subsequent READ_W execution. If
reset input status is detected as TRUE, user should transfer hardware
counter value to user defined register instead of adding to previous count.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 15 of 32
NEXGEN PLC I/O Modules Messung Systems

3 Installation and Wiring

This chapter provides the following information –


• Module Installation
• Connection Details

3.1 Module Installation

The installation procedure for 4 channel Counter Input module is same as


any other discrete I/O module.

• Put the module in to the desired slot of the PLC.


• Tighten the screw provided at the top of the module.
• Connect the terminal block at the front of the module and tighten it.

3.2 Connection Details

The figure shows the connection diagram of 4 Channel Counter Input


Module.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 16 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

Figure 8 : Connection Diagram of 4 Channel Counter Input Module

To 4 Channel Counter Input Module, differential as well as NPN and PNP


type of input interface is provided. The subsequent sections explain how to
connect such devices.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 17 of 32
NEXGEN PLC I/O Modules Messung Systems

3.2.1 Precautions to be taken

All the normal precautions concerning the wiring and protection of an


electronic equipment in an industrial environment should be observed. To
guard against coupling noise from one conductor to another, follow the
guidelines given below.

Inside control panel

Following guidelines to be observed inside control panel.

• All power circuit wiring e.g. connected to Power Supply Module, power
contactors, etc i.e. high voltage wiring should be kept separate and apart
from high frequency counter input signals.

• Digital Input wiring and Digital Output wiring (especially, relay output and
AC output) should be separately bundled and kept as apart as possible
from high frequency counter input signals.

• High frequency counter input signals.should be carried through shielded


cables.

Outside control panel

Following guidelines to be observed outside control panel.

Depending upon the type of modules used in PLC, separate ducts should be
provided for

• Power circuit wiring and power cables.


• Input cables
• Output cables
• All cables carrying high frequency signals.

Wherever possible, it is recommended to

• Avoid parallel routing of cables carrying analog signals and power


cables, etc over long distances.
• Ensure that cables carrying analog signals cross at right angles to
power cables so that minimum length of cable will be in close vicinity
of power cables.
• Run cables on metallic surfaces.
• Avoid number of joints.
• Keep cable lengths as short as possible.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 18 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

3.2.2 Differential Input Connections

The figure below shows the input stage along with connection of differential
input.

Differential ( RS-422) input is connected between terminals CHn A+ and CHn


A-, CHn B+ and CHn B-, CHn Z+ and CHn Z-.

CHn AV
3.9KΩ Opto
100Ω Isolation
CHn

1.5KΩ
100Ω

CHn A-

Figure 9 : Differential Input Connections

Similar connections should be carried out for B and Z inputs.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 19 of 32
NEXGEN PLC I/O Modules Messung Systems

3.2.3 Open Collector (NPN) Input Connections

The figure below shows the input stage of hardware along with connection of
open collector (NPN) type of input.

NPN type of input is connected to terminal CHn A- , to terminal CHn B- and


to terminal CHn Z-. 24 VDC is connected to terminal CHn AV, to terminal
CHn BV and to terminal CHn ZV, respectively.

CHn AV
+24 V 3.9KΩ Opto
Isolatio
CHn A+ 100Ω
No
Connection
1.5KΩ
100Ω

CHn A-

Figure 10 : Open Collector (NPN) Input Connections

Similar connections should be carried out for B and Z inputs.

Any wrong connection may damage input section.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 20 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

3.2.4 Open Collector (PNP) Input Connections

The figure below shows the input stage along with connection of open
collector (PNP) type of input.

PNP type of input is connected to terminal CHn AV, to terminal CHn BV and
to terminal CHn ZV. Supply ground is connected to terminal CHn A- , to
terminal CHn B- and to terminal CHn Z-, respectively.

+24 V

CHn AV
3.9KΩ Opto
Isolation
CHn A+ 100Ω
No
Connection
1.5KΩ
100Ω

CHn A-

Figure 11 : Open Collector (PNP) Input Connections

Similar connections should be carried out for B and Z inputs.

Any wrong connection may damage input section.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 21 of 32
NEXGEN PLC I/O Modules Messung Systems

4 Configuration and Programming


This chapter describes the configuration settings as required from
programming point of view. The topics covered are
• Configuration of module
• Status of Module
• Input and Output Memory data mapping

4.1 Configuration

First four inputs i.e. input 0, 1, 2 and 3 can be configured as normal or


special input individually. Further, special input can be configured as pulse
catch input or reset to respective counter input. For the same, module
register BYTE #0 should be configured.

Module register BYTE #0

7 6 5 4 3 2 1 0
Input 3 Input 2 Input 1 Input 0 Input 3 Input 2 Input 1 Input 0
Individual bit decides operation of input 0 to 3 as Individual bit decides operation of input 0 to 3 as
normal input or as special input. pulse catch input or as reset to respective
FALSE – Normal Input counter input if special input configuration is
TRUE- Special Input selected.
Here, bit 4 decides operation of input 0, FALSE – Pulse Catch Input
bit 5 decides operation of input 1, TRUE- Reset to Counter Input
bit 6 decides operation of input 2, Here, bit 0 decides operation of input 0,
bit 7 decides operation of input 3, bit 1 decides operation of input 1,
bit 2 decides operation of input 2,
bit 3 decides operation of input 3,
Input 0 can be configured as reset to counter 0.
Input 1 can be configured as reset to counter 1.
Input 2 can be configured as reset to counter 2.
Input 3 can be configured as reset to counter 3.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 22 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

Four counters can be configured for counter operation or encoder operation


individually. For the same, module register BYTE #1 should be configured.

Module register BYTE #1

7 6 5 4 3 2 1 0
Counter 3 Counter 2 Counter 1 Counter 0
Two bits decide operation of counter 0 to 3 as counter or encoder.
Counter
0 0
Mode
Don’t Encoder
1
Care Mode

Here, bit 0,1 decide operation of Counter 0,


bit 2,3 decide operation of Counter 1,
bit 4,5 decide operation of Counter 2,
bit 6,7 decide operation of Counter 3,

4.2 Status

Hardware counter value and reset input status is stored in module registers
from 4 sequentially for counter 0 to 3.

BYTE #4 Counter 0 value. The value can be from -2048 to 2047


BYTE #5
BYTE #6 Reset to Counter 0 Input Status The value can be 0 or 1.
BYTE #7
BYTE #8 Counter 1 value. The value can be from -2048 to 2047
BYTE #9
BYTE #10 Reset to Counter 1 Input Status The value can be 0 or 1.
BYTE #11
BYTE #12 Counter 2 value. The value can be from -2048 to 2047
BYTE #13
BYTE #14 Reset to Counter 2 Input Status The value can be 0 or 1.
BYTE #15
BYTE #16 Counter 3 value. The value can be from -2048 to 2047
BYTE #17
BYTE #18 Reset to Counter 3 Input Status The value can be 0 or 1.
BYTE #19

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 23 of 32
NEXGEN PLC I/O Modules Messung Systems

4.3 Input and Output Memory Data Mapping

4 channel counter input module consumes 12 bits in input image and 8 bits in
output image.

The status of all the 12 inputs is stored in input image. So this consumes
input image bits as Ixx.0 to Ixx.7 and I(xx+1).0 to I(xx+1).3. The status of
counter inputs in input image is not useful in application program. Normally
Processor updates input status in each input scan. If required, it can be
updated in logic scan using IMM_IN instruction. If 'IMM_IN' instrcution is
executed in logic scan for a particular slot, it stops current logic scan,
executes input scan for defined slot and resumes logic scan again. This is
useful when ever immediate updation as per input image is needed.

Input image bit I(xx+1).4 becomes ON if valid configuration is written to the


modulw succefully. It remains OFF if valid configuration is not wriiten or
configuration is not successful.

No. Bit Address Status Description


Ixx.0 to Ixx.7 and Field input ON Field input status is TRUE.
1
I(xx+1).0 to I(xx+1).3 status OFF Field input status is FALSE.
Configuration ON Module Configuration Write over.
2 I(xx+1).4 Write Module configuration not written or
Successful OFF
configuration write not successful.

Output image bits are used as user commands to module. User can issue
command to module through application program. Processor writes
commands in output image area of module in output scan. If 'IMM_OUT'
instruction is executed in logic scan for a particular slot, it stops current logic
scan, executes output scan for defined slot and resumes logic scan again.
This is useful when ever immediate updation of output image is needed. For
4 channel counter input module, it is necessary to set Qxx.0 bit ON when
configuration is wriiten to the module. Module configures the mode sof
operation when it detects bit Qxx.o as ON. The functions of output image bits
are given below

Bit
No. Command Status Description
Address
ON Module Configuration Write over.
Configuration
1 Qxx.0
Write OFF Module configuration is not written.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 24 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

4.4 Programming
The data in PLC variables is transferred to 4 channel counter input module
when 'WRITE_W' instruction is executed. The data in the PLC variables can
be updated using instructions like 'MOV_W', arithmetic or any other
instructions. The data from 4 channel counter input module memory can be
transferred to PLC variables when 'READ_W' instruction is executed.

The WRITE_W instruction below shows data transfer from the CPU module's
memory to 4 channel counter module memory. The details of transfer are -

• 4 channel counter input module is configured in slot 2 of PLC.


• Start address of PLC variables is MW50.
• Length of data area to be transferred is 2 words.
• Address on 4 channel counter input module in slot 2 is #0

'WRITE_W' instruction gets executed when condition for enable 'EN' is ON.
'ENO' output becomes ON, when EN is ON and instruction is executed
successfully. ENO is OFF if

• Parameters of instruction are invalid or not within specified range.


• 4 channel counter input module is not accessible to CPU module

M0.0 ------ WRITE_W ---- M1.1


+---| |---+--------- |EN ENO|-+---------+---( )---
| |
#2 -|SLOT |
| |
MW50 -|DATA |
| |
#1 -|LEN |
| |
#0 -|ADDR |
| |
-------------------

So one word,MW50 information from PLC variables is transferred to the


memory at address #0 onwards of 4 channel counter input module fitted in
slot 2.

The 'READ_W' instruction below shows data transfer from 4 channel counter
input module memory to PLC variables. The details of transfer are -

• 4 channel counter input module is configured in slot 2 of PLC.


• Address on 4 channel counter input module in slot 2 is #4.
• Start address of PLC variables is MW100.
• Length of data area to be transferred is 8 words.

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 25 of 32
NEXGEN PLC I/O Modules Messung Systems

'READ_W' instruction gets executed when condition for enable 'EN' is ON.
'ENO' output becomes ON, when EN is ON and instruction is executed
successfully. ENO is OFF if
• Parameters of instruction are invalid or not within specified range.
• 4 channel counter input module is not accessible to CPU module

M1.1 ------ READ_W ----- M0.3


+---| |---+--------- |EN ENO|-+---------+---( )---
| |
#2 -|SLOT |
| |
#4 -|ADDR |
| |
#8 -|LEN |
| |
MW100-|DATA |
| |
-------------------

The following example shows how to program counters and use count value
is application program. In this example, first two counters are configured in
counter mode and remaining two are configured in encoder mode. First two
inputs are used as noraml inputs and next two inputs are used as reset to
counter inputs. Here, 4 channel counter input module is fixed in slot 2 and 32
point 24VDC input modules are fixed in slot 0 and 1.

So configuration word is MW50. The following table shows the configuration


byte MB50 value should be 16#CC.

MB50 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0


Input 3 Input 2 Input 1 Input 0 Input 3 Input 2 Input 1 Input 0
$CC 1 1 0 0 1 1 0 0
Next two inputs are First two inputs are Next two inputs are First two inputs are
used as special used as normal used as reset to used as normal
inputs inputs counter inputs inputs

The following table shows the configuration byte MB51 value should be
16#A0.

MB51 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0


Counter 3 Counter 2 Counter 1 Counter 0
$A0 1 0 1 0 0 0 0 0
Encoder mode is Encoder mode is Counter mode is Counter mode is
selected selected selected selected

So configuration word MW50 should have value of $A0CC for this example
requirement.

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 26 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

Configuration is written if configuration write succefull bit I9.4 is OFF.


For 4 channel counter input module, it is necessary to put first bit in output
image i.e. Q8.0 ON indicating that valid configuration is written to module.
The value of memory word MW50 is $A0CC for this example. The following
rungs take care of writing configuration to the module.

S4.2 Q8.0
+---| |---+---------------------------------------+---(R)---

I9.4 ------ WRITE_W ---- Q8.0


+---|/|---+---------+---------|EN ENO|-+---(S)---
| |
| |
#2 -|SLOT |
| |
| |
MW50 -|DATA |
| |
| |
#1 -|LEN |
| |
| |
#0 -|ADDR |
| |
-------------------

To read counter values, READ_W instruction need to be executed. READ_W


instruction reads the difference count and reset input status if respective
input is configured as reset ti counter input. For four counters eight word
information is available on module.

For right operation, it is necessary to read two word information of a counter at a


time.

I9.4 S4.2 ------ READ_W ----- M1.1


+---| |---+---|/|---+---------|EN ENO|-+---( )---
| |
| |
#2 -|SLOT |
| |
| |
#4 -|ADDR |
| |
| |
#8 -|LEN |
| |
| |
MW100 -|DATA |
| |
-------------------

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 27 of 32
NEXGEN PLC I/O Modules Messung Systems

When READ_W instruction is executed successfully output bit ENO becomes


TRUE. Following information is stored in PLC varaibles

MW100 – Difference count of counter 0 (counter mode of operation)


MW102 – Not applicable
MW104 – Difference count of counter 1 (counter mode of operation)
MW106 – Not applicable
MW108 – Difference count of counter 2 (encoder mode of operation)
MW110 – Reset to counter 2 input status.
Here, bit M110.0 holds the status of Reset to counter 2 input.
MW112 – Difference count of counter 3 (encoder mode of operation)
MW114 – Reset to counter 3 input status.
Here, bit M114.0 holds the status of Reset to counter 3 input.

As difference integer count ( pulses counted from last instruction call to


current instruction call ) is available, it is to be accumulated in a register. If
reset input is used and status is TRUE, then the count read has to be
transferred to register as it is. The rungs below show accumulation of count
in double integer format.

M1.1 ------I_TO_DI------
+---| |---+---------|EN ENO|
| |
| |
MW100-|DATA DOUT|-MD150
----------------------------------

M1.1 ------ ADD_D -----


+---| |---+---------|EN ENO|-
| |
| |
MD150 |DAT1 DOUT|- MD170
| |
| |
MD170 |DAT2 |
| |
-------------------

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 28 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

M1.1 ------I_TO_DI------
+---| |---+---------|EN ENO|
| |
| |
MW104-|DATA DOUT|-MD154
----------------------------------

M1.1 ------ ADD_D -----


+---| |---+---------|EN ENO|-
| |
| |
MD154 |DAT1 DOUT|- MD174
| |
| |
MD174 |DAT2 |
| |
-------------------

M1.1 ------I_TO_DI------
+---| |---+---------|EN ENO|
| |
| |
MW108-|DATA DOUT|-MD158
----------------------------------

M1.1 M110.0 ------ ADD_D -----


+---| |---+---|/|---|EN ENO|-
| |
| |
MD158 |DAT1 DOUT|- MD178
| |
| |
MD178 |DAT2 |
| |
-------------------

M1.1 M110.0 ------ MOVE_D -----


+---| |---+---| |---|EN ENO|-
| |
| |
MD158 |DAT1 OUT|- MD178
-------------------

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 29 of 32
NEXGEN PLC I/O Modules Messung Systems

M1.1 ------I_TO_DI------
+---| |---+---------|EN ENO|
| |
| |
MW112-|DATA DOUT|-MD162
----------------------------------

M1.1 M114.0 ------ ADD_D -----


+---| |---+---|/|---|EN ENO|-
| |
| |
MD162 |DAT1 DOUT|- MD182
| |
| |
MD182 |DAT2 |
| |
-------------------

M1.1 M114.0 ------ MOVE_D -----


+---| |---+---| |---|EN ENO|-
| |
| |
MD162 |DAT1 OUT|- MD182
-------------------

So final count in double integer format is available in MD170, MD174,


MD178, MD182. Reset to counter 2 and 3 status is available in M110.0 and
M114.0. The status of normal inputs 1 and 1 is available in input image in
I8.0 and I8.1

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 30 of 32 Document No.: ED-2002-022/V1.0
Messung Systems NEXGEN PLC I/O Modules

4-Ch Counter Input Module (4634) Published Sept 2002


Document No.: ED-2002-022 /V1.0 Page 31 of 32
NEXGEN PLC I/O Modules Messung Systems

MESSUNG SYSTEMS
EL – 2, J - Block, MIDC, Bhosari,
PUNE – 411 026. INDIA
Tel. – (+91) –020 – 712 0807, 712 2807
Fax. – (+91) –020 –712 0391

NEXGEN PLC I/O Modules

4 –Channel Counter Input Module

Document No.:ED-2002-022

Published Sept 2002 4-Ch Counter Input Module (4634)


Page 32 of 32 Document No.: ED-2002-022/V1.0

You might also like