Advertisement
Advertisement
Allen-Bradley
FLEX I/O 2 Input
Incremental
Encoder Module
(Cat. No. 1794-ID2)
User
Manual
Allen-Bradley Motors
Important User Information
Because of the variety of uses for the products described in this publication, those responsible for the application and use of this control equipment must satisfy themselves that all necessary steps have been taken to assure that each application and use meets all performance and safety requirements, including any applicable laws, regulations, codes and standards.
The illustrations, charts, sample programs and layout examples shown in this guide are intended solely for example. Since there are many variables and requirements associated with any particular installation,
Allen-Bradley does not assume responsibility or liability (to include intellectual property liability) for actual use based upon the examples shown in this publication.
Allen-Bradley publication SGI–1.1, “Safety Guidelines For The
Application, Installation and Maintenance of Solid State Control”
(available from your local Allen-Bradley office) describes some important differences between solid-state equipment and electromechanical devices which should be taken into consideration when applying products such as those described in this publication.
Reproduction of the contents of this copyrighted publication, in whole or in part, without written permission of Allen–Bradley Company, Inc.
is prohibited.
Throughout this manual we make notes to alert you to possible injury to people or damage to equipment under specific circumstances.
!
ATTENTION: Identifies information about practices or circumstances that can lead to personal injury or death, property damage, or economic loss.
Attention helps you:
• identify a hazard
• avoid the hazard
• recognize the consequences
Important: Identifies information that is especially important for successful application and understanding of the product.
Important: We recommend you frequently backup your application programs on appropriate storage medium to avoid possible data loss.
DeviceNet, DeviceNetManager, and RediSTATION are trademarks of Allen-Bradley Company, Inc.
PLC, PLC–2, PLC–3, and PLC–5 are registered trademarks of Allen-Bradley Company, Inc.
Windows is a trademark of Microsoft.
Microsoft is a registered trademark of Microsoft
IBM is a registered trademark of International Business Machines, Incorporated.
All other brand and product names are trademarks or registered trademarks of their respective companies.
Purpose of this Manual
Audience
Vocabulary
This manual shows you how to use your FLEX I/O pulse counter module with Allen-Bradley programmable controllers. The manual helps you install, program and troubleshoot your module.
You must be able to program and operate an Allen-Bradley programmable controller to make efficient use of your FLEX I/O module. In particular, you must know how to program block transfers.
We assume that you know how to do this in this manual. If you do not, refer to the appropriate programming and operations manual before you attempt to program your modules.
In this manual, we refer to:
–
the pulse counter module as the “input module”
–
the Programmable Controller as the “controller”
Manual Organization
This manual is divided into eight chapters. The following chart lists each chapter with its corresponding title and a brief overview of the topics covered in that chapter.
Chapter Title Contents
3
4
5
6
Overview of FLEX I/O and the
Pulse Counter Module
Describes FLEX I/O pulse counter modules, features, and how they function
How to Install Your Pulse Counter
Module
How to install and wire the module
Module Programming Explains block transfer programming, sample programs
Writing Configuration to and
Reading Status From with a
Remote I/O Adapter
Explains how to configure your modules and read status information from your modules when using a remote I/O adapter
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
Explains how you communicate with your modules, and how the I/O image is mapped when using a DeviceNet adapter
Input, Output and Configuration files for Analog Modules using
ControlNet
Explains how you communicate with your modules, and how the I/O and configuration files are mapped when using a ControlNet adapter
How to calibrate the module.
Calibrating Your Pulse Counter
Module
Troubleshoot Your Pulse Counter How to use the indicators to troubleshoot your module.
Module
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
P–2
Conventions
Using This Manual
Appendix
A
Specifications
Title Contents
Specifications for the pulse counter module
We use these conventions in this manual:
In this manual, we show:
that there is more information about a topic in another chapter in this manual
Like this:
that there is more information about the topic in another manual
More
For Additional Information
For additional information on FLEX I/O systems and modules, refer to the following documents:
Number
1794
1794-ACN
1794-ACNR
1794-ACN15
1794-ACNR15
1794-ADN
1794-ASB/C
1794-ASB2/B
1794-APB
1794-IB8
1794-OB8
1794 FLEX I/O Product Data
24V dc ControlNet Adapter
24V dc Redundant Media ControlNet Adapter
24V dc ControlNet Adapter
24V dc Redundant Media ControlNet Adapter
24V dc DeviceNet Adapter
24V dc Remote I/O Adapter
24V dc 2-Slot Remote I/O Adapter
24V dc Profibus Adapter
24V dc 8 Sink Input Module
24V dc 8 Source Output Module
1794-IB16
1794-OB16
1794-IV16
1794-OV16
24V dc 16 Sink Input Module
24V dc 16 Source Output Module
24V dc 16 Source Input Module
24V dc 16 Sink Output Module
1794-OB8EP
1794-IB8S
24V dc 8 Electronically Fused Output Module
24V dc Sensor Input Module
1794-IB10XOB6 24V dc 10 Input/6 Output Module
1794-IE8 24V dc Selectable Analog 8 Input Module
1794-OE4 24V dc Selectable Analog 4 Output Module
Table continued on next page
Publications
Installation
Instructions
1794-2.1
User
Manual
1794-5.8
1794-5.18
1794-5.47
1794-5.48
1794-5.14
1794-5.50
1794-5.44
1794-6.5.13
1794-5.40
1794-6.5.6
1794-5.30
1794-6.5.5
1794-6.5.9
1794-5.31
1794-5.4
1794-5.3
1794-5.28
1794-5.29
1794-5.20
1794-5.7
1794-5.24
1794-5.6
1794-5.5
Publication 1794-6.5.15 – December 1998
Summary
Using This Manual
P–3
1794-IE4XOE2
1794-OF4
1794-IF4
1794-IF2XOF2
1794-IR8
1794-IT8
1794-IRT8
1794-IJ2
1794-IA8
1794-OA8
1794-TB2
1794-TB3
1794-TBN
1794-TBNF
1794-TB3T
1794-TB3S
1794-TB3TS
1794-TB3G
1794-TB3GS
1794-CE1, -CE3
1794-NM1
1794-PS1
24V dc 4 Input/2 Output Analog Module
24V dc 4 Output Isolated Analog Module
Publications
Installation
Instructions
1794-5.15
User
Manual
1794-6.5.2
1794-5.37
24V dc 4 Input Isolated Analog Module
1794-5.38
24V dc 2 Input/2 Output Isolated Analog Module 1794-5.39
1794-6.5.8
24V dc
24V dc
24V dc
8 RTD Input Analog Module
8 Thermocouple Input Module
8 Thermocouple/RTD Input Module
24V dc 2 Frequency Input Module
120V ac 8 Input Module
120V ac Output Module
2-wire Terminal Base
3-wire Terminal Base
Terminal Base Unit
Fused Terminal Base Unit
Temperature Terminal Base Unit
Spring Clamp Terminal Base Unit
Spring Clamp Temperature Base Unit
1794-5.22
1794-5.21
1794-6.5.4
1794-6.5.7
1794-5.50
1794-6.5.12
1794-5.49
1794-6.5.11
1794-5.9
1794-5.10
1794-5.2
1794-5.16
1794-5.17
1794-5.41
1794-5.42
Terminal Base Unit
Spring Clamp Terminal Base Unit
1794-5.43
1794-5.51
1794-5.59
24V dc
Extender Cables
Mounting Kit
Power Supply
1794-5.12
1794-2.13
1794-5.35
This preface gave you information on how to use this manual efficiently. The next chapter introduces you to the frequency module.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
P–4
Using This Manual
Publication 1794-6.5.15 – December 1998
Table of Contents
Overview of the Incremental
Encoder Module
Chapter 1
What This Chapter Contains . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How You Use the Incremental Encoder Module . . . . . . . . . . . . . . .
What the Incremental Encoder Module Does
Typical Applications
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How the Incremental Encoder Operates . . . . . . . . . . . . . . . . . . . . .
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Start Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting the incremental encoder and up/down counting
Up/Down Counting Controlled by B Input
. . . . . .
. . . . . . . . . . . . . . . . . .
Up/Down Counting using Pulses at Inputs A and B
Count Pulses from Incremental Encoders
. . . . . . . . . . .
. . . . . . . . . . . . . . . . .
Preset Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Gate Function
Store Function
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Limitation Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–1
1–1
How to Install Your
Incremental Encoder Module
Chapter 2
What This Chapter Contains . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Before You Install Your Input Module
European Union Directive Compliance
EMC Directive
Power Requirements
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Low Voltage Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Wiring the Terminal Base Units (1794-TB3G shown) . . . . . . . .
Installing the Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting the Terminal Base Unit on a DIN Rail . . . . . . . . . . . . .
Panel/Wall Mounting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting the Incremental Encoder Module on the Terminal
Base Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connecting Wiring for Your incremental encoder Module . . . . . . . . .
Wiring to a 1794-TBN or -TBNF Terminal Base Unit . . . . . . . . . .
Wiring connections for the 1794–ID2 incremental encoder Module
Example of Pulse Transmitter Wiring . . . . . . . . . . . . . . . . . . . . .
Example of Incremental Encoder Wiring
Module Indicators
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2–1
2–1
2–1
2–1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
ii
Table of Contents
Programming Your
Incremental Encoder Module
Chapter 3
What This Chapter Contains . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enter Block Transfer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC-2 Family Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC-5 Family Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SLC-5 Programming
Chapter Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–1
3–1
Writing Configuration to and
Reading Status from Your
Module with a Remote I/O
Adapter
Chapter 4
What This Chapter Contains . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Your Incremental Encoder Module
Reading Data From Your Module
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
4–1
4–1
Mapping Data for the Module . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Incremental Encoder Module (1794-ID2) Image Table Mapping . .
Block Transfer Read Word Assignments for the Incremental Encoder
Module (1794-ID2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bit/Word Definitions for Block Transfer Read Words for the
Incremental Encoder Module . . . . . . . . . . . . . . . . . . . . . .
Block Transfer Write Word Assignments for the Incremental Encoder
Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bit/Word Definitions for the Block Transfer Write Words for the
Incremental Encoder Module . . . . . . . . . . . . . . . . . . . . . .
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Communication Takes
Place and I/O Image Table
Mapping with the DeviceNet
Adapter
Chapter 5
What This Chapter Contains
Polled I/O Structure
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About DeviceNetManager Software . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–1
5–1
5–1
Adapter Input Status Word
System Throughput
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mapping Data into the Image Table . . . . . . . . . . . . . . . . . . . . . . . .
Incremental Encoder Module (1794-ID2) Image Table Mapping . .
Block Transfer Read Word Assignments for the Incremental Encoder
Module (1794-ID2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Block Transfer Write Word Assignments for the Incremental Encoder
Module (1794-ID2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bit/Word Definitions for the incremental encoder Module
(1794–ID2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publication 1794-6.5.15 – December 1998
Table of Contents
iii
Input, Output and
Configuration Files for
Analog Modules when used with ControlNet
Chapter 6
Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the ControlNet Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scheduled Data-Transfer
Unscheduled Data-Transfer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Module I/O Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter Input Status Word
Safe State Data
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Device Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communication Fault Behavior . . . . . . . . . . . . . . . . . . . . . . . . .
Idle State Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input Data Behavior upon Module Removal . . . . . . . . . . . . . . . .
Incremental Encoder Module (1794-ID2) Image Table Mapping . .
Bit/Word Definitions for Block Transfer Read Words for the
Pulse Counter Module . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–1
6–1
Calibrating Your Incremental
Encoder Module
Chapter 7
Chapter Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calibrating Your Module
Calibration Method 1
Calibration Method 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–1
7–1
Troubleshoot the
Incremental Encoder Module
Chapter 8
What This Chapter Contains
Status Indicators
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What’s Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifications
Appendix A
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A–1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
iv
Table of Contents
Publication 1794-6.5.15 – December 1998
What This Chapter
Contains
How You Use the
Incremental Encoder
Module
Chapter
1
Read this chapter to familiarize yourself with the 1794–ID2 module.
For information on See page
How You Use the incremental encoder Module . . . . . . . . . . . 1–1
What the incremental encoder Module Does . . . . . . . . . . . . . 1–2
Input Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–3
How the incremental encoder Operates . . . . . . . . . . . . . . . . . 1–4
The 1794–ID2 module is an intelligent I/O module designed to perform high speed pulse counting. The module provides:
•
2 pulse transmitter interfaces, each with 4 optocoupled inputs
Each input has + and – inputs for connection to transmitters with complementary and noncomplementary signals.
The pulse inputs can accept frequencies up to 100KHz. The module accepts and returns binary data.
The module’s primary use is accurate, high-speed counting of pulse from pulse transmitters or incremental encoders with 1 or 2 pulse trains. This includes quantity counting, positioning and speed calculations.
The module has 2 up/down counters, each individually programmable. The number of edges to be counted can be multiplied by 1, 2 or 4 (x1, x2, x4). Pulse transmitters can be complementary or noncomplementary.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–2
Overview of the Incremental Encoder Module
Optocouplers
Preset Register
Counter Register
Latch Register
Control Word
+
Preset Register
Counter Register
Latch Register
Control Word
+
Internal +5V dc
Gavanically Isolated dc/dc Converter
What the Incremental
Encoder Module Does
Z+
Z–
G+
G–
A+
A–
B+
B–
Z+
Z–
G+
G–
A+
A–
B+
B–
12–24V dc
0V
The incremental encoder module performs high-speed scaling calculation operations for various industrial applications. The module interfaces with a FLEX family adapter which then communicates with a programmable controller processor that has block-transfer capability and external I/O devices.
The adapter/power supply transfers data to the module (block transfer write) and from the module (block transfer read) using BTW and BTR instructions in your ladder diagram program. These instructions let the adapter read input values and status from the module, and let you write output values and configure the module’s mode of operation. The following illustration describes the communication process.
Publication 1794-6.5.15 – December 1998
Overview of the Incremental Encoder Module
1
The adapter transfers your configuration data to the module using a BTW.
2
1–3
External devices transmit frequency signals to the module.
Flexbus
Allen-Bradley
ADAPTER
ACTIVE FAULT
LOCAL
FAULT
24VDC
POWER SUPPLY
RIO ADAPTER
1794-ASB
4
Your ladder program instructs the adapter to perform a BTR of the values and stores them in a data table.
Allen-Bradley
2 CH INCREMENTAL ENCODER
1794–ID2
OK
1
5
The adapter and module determine that the transfer was made without error and input values are within specified range.
6
Your ladder program can use and/or move the data (if valid) before it is written over by the transfer of new data in a subsequent transfer.
7
Your ladder program performs BTWs to the module when you power it up, and any time you wish to reconfigure the module.
3
The module converts frequency signals into integer format and stores these values until the adapter requests their transfer.
Typical Applications
You can use the 1794–ID2 module in the power management, automotive, food and beverage, and oil and gas industries for various flow and/or turbine metering applications. Some sample applications include:
• turbine shaft speed monitoring
• automotive paint booths
• brewery flow monitoring
• petrochemical flow and custody transfer
Input Capabilities
The incremental encoder module has 2 identical input channels.
Each of the input channels may accept these input signals:
•
A+ and A–
•
B+ and B–
•
Z+ and Z–
•
G+ and G–
The pulse inputs can accept frequencies up to 100KHz. The module
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–4
Overview of the Incremental Encoder Module
How the Incremental
Encoder Operates
The counter module handles up/down counting and detection of selectable number of edges (X1, X2, X4) for incremental encoders with 2 pulse trains, nominal 90 o
out of phase. The minimum stable input condition is 2
µ s.The following paragraphs detail operation of the incremental encoder module.
Each of the 2 counters has a 16–bit counter register, a preset register and a latch register.
Variables
Communication between the counter module and the control system uses variables accessible in the control system program. These variables include:
•
a counter register (Counter)
• a preset register (PresetValue)
• a latch register (LatchValue).
Signal registers and control words are used to set parameters for the counter configuration. The control word sent to the incremental encoder module can be read back to the control system, allowing verification that one I/O scan been performed since the cycle has been initiated.
Start Counting
The control bit CounterEnable enables counting. It must be set to 1 to enable counting and all other functions.
Selecting the Incremental Encoder and up/down counting
Depending on the incremental encoder, the module can be set in different counter modes. The parameter is set using a 3 digit code in write word 1 or 2 (depending on the channel) control word.
Mode Selection
Bit 02 01 00 Mode Selection bits
0 0
0
0
0
1
1
1
1
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
Quadrature encoder X1
Quadrature encoder X2
Quadrature encoder X4
Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
No count function.
No count function.
No count function.
Publication 1794-6.5.15 – December 1998
Overview of the Incremental Encoder Module
1–5
Up/Down Counting Controlled by B Input
Pulse Counting (Mode 000)
Up/Down counting controlled by input B
The positive edge of the pulses are counted at input A. If input B = 0, the counter counts up; if B = 1, the counter counts down.
Counter Mode = 0
A
B = 0/1
Logic
Counter Register
Up/Down
Input A
Input B
Counter Value
0
1 2
Counting Up
3 2
Counting Down
1
Up/Down Counting using Pulses at Inputs A and B
Pulse Counting Mode (100)
Up/Down Counting using pulses at the inputs of A and B
The counter counts up on the positive edge of the pulses at input A, and counts down on the positive edge of input B.
Counter Mode = 4
A
B
Logic
Counter Register
Up/Down
Input A
Input B
Counter Value
0
1 0 1 2 1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–6
Overview of the Incremental Encoder Module
Count Pulses from Incremental Encoders
Pulse Counting Mode (001, 010. 011) Up/Down Counting using pulses at the inputs of A and B
If countermode = 1, 2 or 3, then 1, 2 or 4 edges of the pulse train will be counted. The count direction (up/down) is determined by the phase difference of the input signals A and B.
Counter Mode = 1, 2 or 3
Logic
A
B
Counter Register
Up/Down
Example 1 – Counter Mode = 1 (x1)
Input A
Input B
Counter Value
1
Example 2 – Counter Mode = 2 (x2)
2
Counting Up
3 2 1
Counting Down
0
Input A
Input B
Counter Value
1 2 3 4
Counting Up
5 4 3 2
Counting Down
1 0
Example 3 – Counter Mode = 3 (x4)
Input A
Input B
Counter Value
1 2 3 4 5 6 7
Counting Up
8 9 8 7 6 5 4
Counting Down
3 2 1 0
Publication 1794-6.5.15 – December 1998
Overview of the Incremental Encoder Module
1–7
Preset Function
Use the preset function to copy a value from the preset register to the counter register.
Method 1
Preset Register
Preset
PresetReached = 1
Counter Register
Method 2
PresetEnable = 1
Preset Register
Logic
PresetReached = 1
Z =
Counter Register
The flag PresetReached is set when the counter register and the preset register are equal (if the counter preset is reached, or if the counter has been loaded with the preset value). This flag is reset on a positive edge of PresetReset after the operation and can only be set after at least one additional counting pulse.
Gate Function
Use the gate function to determine when counting starts and stops.You can use this function to measure distance.
The parameter GateControl determines the gate function. The gate signal is connected to input G. It is a 2–bit binary code in write word
1 or 2, bits 09 and 10
Word
Bits
Gate Control Function
Binary 10 09 Gate Control bits
0
1
0
0
0
1
No gate function on input G (Count is independent)
Counting only if G = 1 (active)
2
3
1 0 Counting only if G = 0 (inactive)
1 1 Calibration if G = 1 and all other conditions are fulfilled (refer to Calibrating the Module, chapter ?).
Example
Gate Control = 1
G = 1
Logic
Counter Register
A
The counter is counting if G = 1.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–8
Overview of the Incremental Encoder Module
Store Function
Use the store function to copy the value in the counter register
(Counter) to the latch register (StoreValue).
The StoreControl parameter determines the store function. Execution occurs on either the positive or negative edge of input signals G and
Z respectively (see table). The parameter is a 2–bit binary code in write word 1 (bits 11 and 12)
Word Bits
1 or 2 11–12
Binary 12 11 Store Control bits
0
1
2
3
0
0
1
1
0 Save the counter value on the positive edge of Z
(if Stored X = 0)
1 Save the counter value on the positive edge of G
(if Stored X = 0)
0 Save the counter value on the negative edge of G
(if Stored X = 0)
1 Save the counter value on both the positive edge and negative edge of G (if Stored X = 0)
The parameter Stored must be reset (0). Stored is set (1) when the operation is completed. Reset after the operation with StoreReset.
Example
Store Control = 1
Stored = 0
Counter Register
Logic
Latched = 1
G
Store Register
The counter value is copied to the store register on the positive edge of input signal G.
Limitation Function
If the control bit RangeLimited = 1, the counter counts up to the preset value and restarts at 0. Counting down, the counter reaches the preset value on the next pulse if the current counter value = 0.
RangeLimited = 0 corresponds to RangeLimited = 1 if the preset value = FFFF in hex = 65535 in decimal.
The flag PresetReached is set when the counter is equal to the preset value. Use PresetReset to reset the flag.
Publication 1794-6.5.15 – December 1998
Chapter Summary
Overview of the Incremental Encoder Module
Count Up pulse (+)
RangeLimited = 1
Counter = PresetValue
Logic
Value 0
Counter Register
Count Down pulse (–)
RangeLimited = 1
Preset Register
Logic
Counter = 0
Counter Register
Note: If the preset register value = 0, the counter retains the value 0.
1–9
In this chapter, you learned about the incremental encoder module, block transfer communication, and details of how the module functions. Now you can install the module.
Install the
ID2 Module
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
1–10
Overview of the Incremental Encoder Module
Publication 1794-6.5.15 – December 1998
Chapter
2
What This Chapter
Contains
Before You Install Your
Input Module
In this chapter, we tell you about:
For information on See page
Before You Install Your Module . . . . . . . . . . . . . . . . . . . . . . . 2–1
European Union Directives . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1
Power Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2
on a wall/panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–6
on the terminal base . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–7
Connecting Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–9
Module Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–14
Before installing your incremental encoder module in the FLEX I/O system:
You need to:
Calculate the power requirements of all modules in each FLEX system.
Position the keyswitch on the terminal base
!
As described under:
Power Requirements, page 2-2
Installing the Module, page 2–4
ATTENTION: The incremental encoder module does not receive power from the backplane. +24V dc power must be applied to your module before installation. If power is not applied, the module position will appear to the adapter as an empty slot in your chassis.
European Union Directive
Compliance
If this product has the CE mark it is approved for installation within the European Union and EEA regions. It has been designed and tested to meet the following directives.
EMC Directive
This product is tested to meet Council Directive 89/336/EEC
Electromagnetic Compatibility (EMC) and the following standards, in whole or in part, documented in a technical construction file:
•
EN 50081-2EMC – Generic Emission Standard, Part 2 –
Industrial Environment
•
EN 50082-2EMC – Generic Immunity Standard, Part 2 –
Industrial Environment
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
2–2
How to Install Your Incremental Encoder Module
Low Voltage Directive
This product is tested to meet Council Directive 73/23/EEC
Low Voltage, by applying the safety requirements of EN 61131–2
Programmable Controllers, Part 2 – Equipment Requirements and
Tests.
For specific information required by EN 61131-2, see the appropriate sections in this publication, as well as the following Allen-Bradley publications:
•
Industrial Automation Wiring and Grounding Guidelines For
Noise Immunity, publication 1770-4.1
•
Guidelines for Handling Lithium Batteries, publication AG-5.4
•
Automation Systems Catalog, publication B111
This equipment is classified as open equipment and must be mounted in an enclosure during operation to provide safety protection.
Power Requirements
The wiring of the terminal base unit is determined by the current draw through the terminal base. Make certain that the current draw does not exceed 10A.
!
ATTENTION: Total current draw through the terminal base unit is limited to 10A. Separate power connections may be necessary.
Publication 1794-6.5.15 – December 1998
How to Install Your Incremental Encoder Module
Methods of wiring the terminal base units are shown in the illustration below.
Wiring the Terminal Base Units (1794-TB3G shown)
!
ATTENTION: Do not daisy chain power or ground from the terminal base unit to any ac or dc digital module terminal base unit.
2–3
Daisy-chaining
incremental encoder
Module incremental encoder
Module
TC/RTD/mV
Module incremental encoder
Module
24V dc
Individual
Note: All modules must be pulse, frequency or TC/RTD/mV modules for this configuration.
Wiring when total current draw is less than 10A
Digital Input
Module incremental encoder
Module
Digital Input
Module
Digital Output
Module
24V dc
24V dc
24V dc
Note: Use this configuration if using any
“noisy” dc digital I/O modules in your system.
incremental encoder Module wiring separate from digital wiring.
Wiring when total current draw is greater than 10A
Combination
incremental encoder
Module incremental encoder
Module
TC/RTD/mV
Module incremental encoder
Module
24V dc
24V dc
Note: All modules powered by the same power supply must be pulse, frequency or TC/RTD/mV modules for this configuration.
Total current draw through any base unit must not be greater than 10A
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
2–4
How to Install Your Incremental Encoder Module
Installing the Module
Installation of the incremental encoder module consists of:
• mounting the terminal base unit
• installing the module into the terminal base unit
• installing the connecting wiring to the terminal base unit
If you are installing your module into a terminal base unit that is already installed, proceed to “Mounting the incremental encoder
Module on the Terminal Base” on page 2–7.
Mounting the Terminal Base Unit on a DIN Rail
!
ATTENTION: Do not remove or replace a terminal base unit when power is applied. Interruption of the flexbus can result in unintended operation or machine motion.
1. Remove the cover plug (if used) in the male connector of the unit to which you are connecting this terminal base unit.
2. Check to make sure that the 16 pins in the male connector on the adjacent device are straight and in line so that the mating female connector on this terminal base unit will mate correctly.
3. Position the terminal base on the 35 x 7.5mm DIN rail A (A-B pt.
no. 199-DR1; 46277-3). Proceed as follows:
B
C
A
A
Position terminal base at a slight angle and hooked over the top of the DIN rail.
4. Make certain that the female flexbus connector C is fully
retracted into the base unit.
Publication 1794-6.5.15 – December 1998
How to Install Your Incremental Encoder Module
2–5
Slide the terminal base unit over tight against the adapter.
Make sure the hook on the terminal base slides under the edge of the adapter and the flexbus connector is fully retracted.
Press down on the terminal base unit to lock the terminal base on the
DIN rail. If the terminal base does not lock into place, use a screwdriver or similar device to open the locking tab, press down on the terminal base until flush with the DIN rail and release the locking tab to lock the base in place.
30077–M
Publication 1794-6.5.15 – December 1998
2–6
How to Install Your Incremental Encoder Module
5. Repeat the above steps to install the next terminal base.
Panel/Wall Mounting
Installation on a wall or panel consists of:
• laying out the drilling points on the wall or panel
• drilling the pilot holes for the mounting screws
• mounting the adapter mounting plate
• installing the terminal base units and securing them to the wall or panel
If you are installing your module into a terminal base unit that is already installed, proceed to “Mounting the incremental encoder
Module on the Terminal Base” on page2–7.
Use the mounting kit Cat. No. 1794-NM1 for panel/wall mounting.
1.4
(35.5)
1794-NM1 Mounting Kit
Contents:
1 – Mounting Plate for Adapter
2 – 18 #6 self-tapping screws
(2 for the adapter, and 2 each for up to 8 modules)
1
2
Adapter Module
(not included)
Terminal Base Unit
(not included)
To install the mounting plate on a wall or panel:
1. Lay out the required points on the wall/panel as shown in the drilling dimension drawing.
Publication 1794-6.5.15 – December 1998
Inches
(Millimeters)
.83 (21)
How to Install Your Incremental Encoder Module
1.4
(35.5)
Drilling Dimensions for Panel/Wall Mounting of FLEX I/O
2.3
(58.5)
1.4
(35.5)
2.3
(58.5)
1.4
(35.5)
2–7
More
2. Drill the necessary holes for the #6 self-tapping mounting screws.
3. Mount the mounting plate (1) for the adapter module using two
#6 self-tapping screws (18 included for mounting up to 8 modules and the adapter).
Important:
Make certain that the mounting plate is properly grounded to the panel. Refer to “Industrial Automation
Wiring and Grounding Guidelines,” publication
1770-4.1.
4. Hold the adapter (2) at a slight angle and engage the top of the mounting plate in the indention on the rear of the adapter module.
5. Press the adapter down flush with the panel until the locking lever locks.
6. Position the terminal base unit up against the adapter and push the female bus connector into the adapter.
7. Secure to the wall with two #6 self-tapping screws.
8. Repeat for each remaining terminal base unit.
Note: The adapter is capable of addressing eight modules. Do not exceed a maximum of eight terminal base units in your system.
Mounting the Incremental Encoder Module on the Terminal Base
Unit
The incremental encoder module mounts on a 1794-TB3, TB3S,
-TBN or -TBNF terminal base unit.
1. Rotate the keyswitch (1) on the terminal base unit (2) clockwise to position 1 as required for the incremental encoder module.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
2–8
How to Install Your Incremental Encoder Module
3
4
5
7
1
2
6
2. Make certain the flexbus connector (3) is pushed all the way to the left to connect with the neighboring terminal base/adapter.
You cannot install the module unless the connector is fully extended.
3. Make sure that the pins on the bottom of the module are straight so they will align properly with the connector in the terminal base unit.
!
ATTENTION: Remove field-side power before removing or inserting the module. This module is designed so you can remove and insert it under
backplane power. When you remove or insert a module with field-side power applied, an electrical arc may occur. An electrical arc can cause personal injury or property damage by:
• sending an erroneous signal to your system’s field devices causing unintended machine motion
• causing an explosion in a hazardous environment
Repeated electrical arcing causes excessive wear to contacts on both the module and its mating connector.
Worn contacts may create electrical resistance.
4. Position the module (4) with its alignment bar (5) aligned with the groove (6) on the terminal base.
5. Press firmly and evenly to seat the module in the terminal base unit. The module is seated when the latching mechanism (7) is locked into the module.
6. Repeat the above steps to install the next module in its terminal base unit.
Publication 1794-6.5.15 – December 1998
How to Install Your Incremental Encoder Module
Connecting Wiring for
Your Incremental Encoder
Module
1794-TB3
Wiring to the module is made through the terminal base unit on which the module mounts.
Compatible terminal base units are:
Module
1794–ID2
1794-TB3
Yes
1794-TB3S
Yes
1794-TBN
Yes
1794-TBNF
Yes
1794-TB3S
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
Label placed at top of wiring area.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A
0 –15
A
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
B
16–33
B
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
C 34–51 C
34 and 50 = 24V dc
35 and 51 = common
16 and 33 = chassis ground
40 thru 45 = chassis ground
34 and 50 = 24V dc
35 and 51 = common
16 and 33 = chassis ground
40 thru 45 = chassis ground
2–9
Connecting Wiring using a 1794-TB3 and -TB3S Terminal Base
Units
1. Connect individual input wiring (A+, A–, B+, B–, Z+, Z–, G+,
G–) to numbered terminals on the 0–15 row (A) as indicated in the table below.
!
ATTENTION: Do not connect maximum input voltage simultaneously to all inputs if the module ambient temperature is expected to exceed 40 o
C.
!
ATTENTION: If the module ambient temperature is expected to continuously exceed 40 o
C, you must limit the input voltage using an external resistor on each input. A 1K
Ω
resistor effectively limits a 24V sensor signal to about 15V at the input. Do not limit the input to less than 6V.
2. Connect the associated input common (3-wire devices only) to the corresponding terminal on the 16-33 row (B) for each input as indicated in the table below. (Commons are internally connected together.)
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
2–10
How to Install Your Incremental Encoder Module
3. Terminate shields to terminals 16 or 33 on row B, or 40 through
45 on row C.
4. Connect +24V dc to terminal 34 on the 34-51 row (C).
5. Connect dc return to terminal 16 on the 16–33 row (B).
!
ATTENTION: To reduce susceptibility to noise, power frequency modules and digital modules from separate power supplies. Do not exceed a length of 33 ft (10m) for dc power cabling.
6. If continuing power to the next terminal base unit, connect a jumper from terminal 51 (+24V dc) on this base unit to terminal
34 on the next base unit.
7. If continuing common to the next terminal base unit, connect a jumper from terminal 33 (common) on this base unit to terminal
16 on the next base unit.
!
ATTENTION: Do not daisy chain power or ground from this terminal base unit to any ac or dc digital module terminal base unit.
!
ATTENTION: This module does not receive power from the backplane. +24V dc power must be applied to your module before operation. If power is not applied, the module position will appear to the adapter as an empty slot in your chassis. If the adapter does not recognize your module after installation is completed, cycle power to the adapter.
Publication 1794-6.5.15 – December 1998
How to Install Your Incremental Encoder Module
Wiring to a 1794-TBN or -TBNF Terminal Base Unit
1. Connect individual input wiring (A+, A–, B+, B–, Z+, Z–, G+,
G–) to the even numbered terminals on row (B) as indicated in the table below.
!
ATTENTION: Do not connect maximum input voltage simultaneously to all inputs if the module ambient temperature is expected to exceed 40 o
C.
2–11
!
ATTENTION: If the module ambient temperature is expected to continuously exceed 40 o
C, you must limit the input voltage using an external resistor on each input. A 1K
Ω
resistor effectively limits a 24V sensor signal to about 15V at the input. Do not limit the input to less than 6V.
2. Connect the associated input common to the corresponding odd numbered terminal on row (C) for each input as indicated in the table below.
3. Connect 24V dc to terminal 34 on row (C).
4. Connect 24V dc common to terminal 16 on row (B).
5. If continuing power to the next terminal base unit, connect a jumper from terminal 51 (24V dc) on this base unit to terminal 34 on the next base unit.
6. If continuing common to the next terminal base unit, connect a jumper from terminal 33 (24V dc common) on this base unit to terminal 16 on the next base unit.
16
16
0
34
34
1
2
Even Numbered Terminals 0 thru 14
4 6 8 10 12 14
3 5 7 9 11 13
Odd Numbered Terminals 1 thru 15
1794-TBN, -TBNF
15
33
33
51
51
16, 0, 2, 4, 6,
8, 10, 12, 14, 33
34, 1, 3, 5, 7,
9, 11, 13, 15, 51
B
C
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
2–12
How to Install Your Incremental Encoder Module
Wiring connections for the 1794–ID2 incremental encoder Module
Z+
Z–
G+
G–
A+
A–
B+
B–
Z+
Z–
G+
G–
A+
A–
B+
B–
6
7
4
5
2
3
0
1
Terminal Base Units
1794–TB3, –TB3S
Signal 0V dc 12/24V dc
incremental encoder Channel 0
17
18
19
20
35
36
37
38
10
11
12
13
14
15
8
9
21
22
23
24
26
27
28
29
30
31
32
39
40
41
42 incremental encoder Channel 1
25 43
44
45
46
47
48
49
50
Terminal Base Units
1794–TBN, –TBNF
1
Signal Input
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0V dc Terminals 16 and 33 (1794–TB2)
Terminals 16 thru 33 (1794-TB3, -TB3S)
Terminals 16 and 33
12/24V dc Terminals 34 thru 51 (1794–TB3, –3S) Terminals 34 and 51
1 Auxiliary terminal blocks are required when using these terminal base units.
!
ATTENTION: Total current draw through the terminal base unit is limited to 10A. Separate power connections to the terminal base unit may be necessary.
Publication 1794-6.5.15 – December 1998
How to Install Your Incremental Encoder Module
Example of Pulse Transmitter Wiring
incremental encoder Channel 0
Signal for counter gate
–
G
+
Signal for counter calibration/preset
Signal for up/down counting
–
B
+
–
Z
+
–
+
A
External Power
Supply
12/24V dc
Signal Inputs
16
0
17
1 2
18 19
3
20
4
21
5 6
22 23
7
24
8
25
0V dc
12/24V dc
34 35 36 37 38 39 40 41 42
Example of pulse transmitter with 1 pulse train. For connection of channel 1, refer to wiring table.
Note: Dotted lines indicate signals not always used.
Example of Incremental Encoder Wiring
incremental encoder Channel 0
–
B
+
–
Z
+
–
+
A
–
G
+
33
15
51
Signal Inputs
External Power
Supply
12/24V dc
0V dc
12/24V dc
16
0
34
17
35
1
18
2
36
19
3
37
20
4
38
21
5
39
22
6
40
23
7
41
24
8
42
25 33
15
51
Example of incremental encoder with 2 pulse trains, with or without reference, and/or gate function. For connection of channel 1, refer to wiring table.
Note: Dotted lines indicate signals not always used.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
2–13
2–14
How to Install Your Incremental Encoder Module
Module Indicators
The incremental encoder module has one status indicator (PWR) that is on when power is applied to the module, and one input status indicator for each input (12 in all).
Allen-Bradley
2 CH INCREMENTAL ENCODER MODULE
1794–ID2
Chapter Summary
1
A B Z G + – A B Z G + –
C B A
A = Power/status indicator – indicates power applied to module and status of module.
B = Insertable label for writing individual I/O assignments.
C = Status Indicators –
A = Status of input A
B = Status of input B
Z = Status of input Z
G = Status of input G
+ = Positive count detected
– = Negative count detected
Indicator
A
B
Z
G
+
–
OK
Indication
Yellow
Off
Yellow
Off
Yellow
Off
Yellow
Off
Yellow
Yellow
Red
Green
Explanation
Input A active
Input A not active
Input B active
Input B not active
Input Z active
Input Z not active
Input G active
Input G not active
On when a positive pulse is detected; turns off on negative pulse.
On when a negative pulse is detected; turns off on positive pulse.
Red during initialization after power turned on
Green when initialization is completed
In this chapter, we told you how to install your incremental encoder module in an existing programmable controller system and how to wire to the terminal base units.
Publication 1794-6.5.15 – December 1998
What This Chapter
Contains
Enter Block Transfer
Instructions
Chapter
3
To initiate communication between the incremental encoder module and your PLC processor, you must enter block transfer instructions into your ladder logic program. Use this chapter to enter the necessary block transfer instructions into your ladder logic program.
To edit your ladder logic you See page
Enter Block Transfer Instructions . . . . . . . . . . . . . . . . . . . . . 3–1
PLC-2 Family Processors . . . . . . . . . . . . . . . . . . . . . . . . 3–2
PLC-5 Family Processors . . . . . . . . . . . . . . . . . . . . . . . . 3–2
SLC-5 Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–3
The incremental encoder module communicates with the PLC processor through bidirectional block transfers. This is the sequential operation of both read and write block transfer instructions.
Before you configure the module, you need to enter block transfer instructions into your ladder logic. The following example programs illustrate the minimum programming required for communication to take place between the module and a PLC processor. These programs can be modified to suit your application requirements.
A configuration block transfer write (BTW) is initiated when the module is first powered up, and subsequently only when the programmer wants to enable or disable features of the module. The configuration BTW sets the bits which enable the programmable features of the module, such as scalars and alarm values, etc. Block transfer reads are performed to retrieve information from the module.
Block transfer read (BTR) programming moves status and data from the module to the processor’s data table. The processor user program initiates the request to transfer data from the module to the processor.
The transferred words contain module status, channel status and input data from the module.
Your program should monitor status bits, block transfer read and block transfer write activity.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
3–2
Programming Your Incremental Encoder Module
PLC-2 Family Processor
The 1794 incremental encoder module is not recommended for use with PLC-2 family programmable controllers due to the number of digits needed for high resolution.
Important:
The incremental encoder module functions with reduced performance in PLC-2 systems. Because the module does not support BCD and the PLC-2 processor is limited to values of 4095 (12 bit binary), many values returned in the BTR file may not provide meaningful data to the PLC-2 processor.
PLC-5 Family Processor
Block transfer instructions with the PLC-5 processor use a control file and a data file. The block transfer control file contains the data table section for module location, the address of the block transfer data file and other related data. The block transfer data file stores data that you want transferred to the module (when programming a
BTW) or from the module (when programming a BTR).
The programming terminal prompts you to create a control file when a block transfer instruction is being programmed. A different block
transfer control file is used for the read and write instructions
for your module.
Publication 1794-6.5.15 – December 1998
Programming Your Incremental Encoder Module
3–3
PLC-5 Processor
Program Example
Rung 2:0
The ID2 module is located in rack 1, I/O group 0, slot 0. The integer control file starts at N17:0. The data sent by the
PLC-5 processor to the ID2 module starts at N18:0 and is 4 words long. At power up in RUN mode, or when the processor is first switched from PROG to RUN, the user program enables a block transfer write to configure the module..
First scan of ladder or SFC
S:1
15
ID2 BTW
Control File
BTW
BLOCK TRANSFER WRITE
Module Type
Rack
Group
Slot
Control
Data File
Length
Continuous
Generic BT
001
0
0
N17:0
N18:0
4
N
EN
DN
ER
Rung 2:1
The ID2 module is located in rack 1, group 2, slot 0. The integer control file starts at N17:10,. The data obtained by the
PLC-5 processor from the ID2 module is placed in memory starting at N18:10 and is 8 words long. lThe program continuously performs read block transfers to read data from the module.
ID2 BTR
Enable Bit
N17:10
15
ID2 BTR
Control File
BTR
BLOCK TRANSFER READ
Module Type
Rack
Group
Slot
Control
Data File
Length
Continuous
Generic BT
001
0
0
N17:10
N18:10
8
N
EN
DN
ER
SLC-5 Programming
More
The SLC-5 programs (using the 1747-SN scanner) follow the same logic as the PLC-5 family programs in the previous example.
Differences occur in the implementation of block transfers due to the use of “M” files in the SLC system.
Configuration data for the FLEX I/O incremental encoder module and the 1747-SN scanner must be in place before executing the following programs. Chapter 4 contains information on module configuration.
For more information on using the 1747-SN scanner module and block transfer programming, refer to publication 1747-6.6, “Remote
I/O Scanner User Manual.”
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
3–4
Programming Your Incremental Encoder Module
Program Action
This rung configures the block transfer operation type, length, and RIO address at power-up. Bit
B3:100/7 must be set to 1 to indicate a BTR and bit B3:110/7 must be 0 to indicate a BTW.
0000
Figure 3.1SLC Programming for the 1794-OF4I Isolated
Analog Output Module
PowerUp Bit
S2:1
15
BTR_CONTROL
COP
COPY FILE
SOURCE
DEST
LENGTH
BTW_CONTROL
COP
COPY FILE
SOURCE
DEST
LENGTH
#B3:100
#M0:1.100
3
#B3:110
#M0:1.200
3
0001
BTR status is copied to the B3:0 area when a BTR is in progress.
BTR PENDING
B3:5
0
CHECK BTR STATUS
B3:5
1
BTR DONE BIT
B3:0
13
0002
Unlatch the bit that continues to check the BTR status.
BTR ERROR BIT
B3:0
12
BTW PENDING
B3:15
0
0003
BTW status is copied to the B3:100 area when a
BTW is in progress.
0004
Unlatch the bit that continues to check the BTW status.
CHECK BTW STATUS
B3:15
1
BTW DONE BIT
B3:10
13
To next page.
BTW ERROR BIT
B3:10
12
COP
COPY FILE
SOURCE
DEST
LENGTH
COP
COPY FILE
SOURCE
DEST
LENGTH
#M1:1.100
#B3:0
4
CHECK BTR STATUS
B3:5
U
1
#M1:1.200
#B3:10
4
CHECK BTW STATUS
B3:15
U
1
Publication 1794-6.5.15 – December 1998
Programming Your Incremental Encoder Module
Program Action
When a BTR successfully completes and the done bit is detected, the BTR data is copied into the N7:0 to N7:7 area.
0005
BTR DONE BIT
B3:0
13
COP
COPY FILE
SOURCE
DEST
LENGTH
#M1:1.110
#N7:0
8
BTR PENDING
B3:5
U
0
BTR ENABLE BIT
B3:100
U
15
CHECK BTR STATUS
B3:5
L
1
Whe a BTR error occurs, the error code is moved to N7:9.
0006
BTR ERROR BIT
B3:0
12
MOV
MOVE
SOURCE
DEST
When a BTW successfully completes and the done bit is detected, the BTR data is copied into the N7:0 to N7:7 area.
0007
To next page.
BTW DONE BIT
B3:10
13
#M1:1.103
6
#N7:6
0<
BTR PENDING
B3:5
U
0
BTR ENABLE BIT
B3:100
U
15
CHECK BTR STATUS
B3:5
L
1
BTW PENDING
B3:15
U
0
BTW ENABLE BIT
B3:110
U
15
CHECK BTW STATUS
B3:15
L
1
3–5
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
3–6
When a BTW occurs, the error code is moved to N7:17.
Programming Your Incremental Encoder Module
Program Action
0008
BTW ERROR BIT
B3:10
12
MOV
MOVE
SOURCE
DEST
#M1:1.203
6
#N7:17
0<
BTW PENDING
B3:15
U
0
BTW ENABLE BIT
B3:110
U
15
CHECK BTW STATUS
B3:15
L
1
This rung executes BTRs continuously, as fast as possible.
0009
BTR ENABLE BIT BTR DONE BIT
B3:100 B3:0
15 13
BTR ERROR BIT
B3:0
12
BTR PENDING
B3:5
L
0
BTR ENABLE BIT
B3:100
L
15
0010
One BTW is triggered at power up. Four words of data starting at N7:10 is sent to the 1794-ID2 module.
TRIGGER
FOR
BTW
B7:20
0
BTW
ENABLE
BIT
B3:110
15
BTW
DONE
BIT
B3:10
13
BTW
ERROR
BIT
B3:10
12
COP
COPY FILE
SOURCE
DEST
LENGTH
#N7:10
#M1:1.210
7
BTW ENABLE BIT
B3:110
L
15
BTW PENDING
B3:15
L
0
To next page.
Publication 1794-6.5.15 – December 1998
Programming Your Incremental Encoder Module
Program Action
This BTR control word is moved to the M0 file for the scanner module while the BTR is in progress until the enable, done and error bits are turned off
0011
BTR ENABLE BIT
B3:100
15
BTR DONE BIT
B3:0
13
BTR ERROR BIT
B3:0
12
This BTW control word is moved to the M0 file for the scanner module while the BTW is in progress until the enable, done and error bits are turned off.
0012
BTW ENABLE BIT
B3:110
15
BTW DONE BIT
B3:10
13
BTW ERROR BIT
B3:10
12
BTR CONTROL
MOV
MOVE
SOURCE
DEST
B3:100
00000001000000<
M0:1.100
?<
BTW CONTROL
MOV
MOVE
SOURCE
DEST
B3:110
00000000000000
M0:1.200
?<
3–7
0013
END
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
3–8
Programming Your Incremental Encoder Module
Chapter Summary
In this chapter, you learned how to program your ID2 incremental encoder module using block transfer instructions and ladder logic.
Now, you can configure your module.
Configure the
ID2 Module
Publication 1794-6.5.15 – December 1998
Chapter
4
Writing Configuration to and
Reading Status from Your
Module with a Remote I/O
Adapter
What This Chapter
Contains
In this chapter, we tell you about:
For information on See page
Configuring Your Module . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1
Reading Data from Your Module . . . . . . . . . . . . . . . . . . . . . . 4–2
Mapping Data for the Module . . . . . . . . . . . . . . . . . . . . . . . . 4–2
Incremental Encoder Module (1794-ID2) Image Table Mapping
Block Transfer Read Word Assignments . . . . . . . . . . . . . . . . 4–3
Bit/Word Definitions for Block Transfer Read Words . . . . . . . . 4–3
Block Transfer Write Word Assignments . . . . . . . . . . . . . . . . 4–5
Bit/Word Definitions for the Block Transfer Write Words . . . . . 4–5
Configuring Your
Incremental Encoder
Module
The incremental encoder module is configured using a group of data table words that are transferred to the module using a block transfer write instruction.
Some of the software configurable features available are:
• number of inputs
• encoder multiplier
• gate function
• latch function
• rollover
Configure your module for its intended operation by means of your programming terminal and write block transfers.
Note: Programmable controllers that use 6200 software (release 4.2
or higher) programming tools can take advantage of the IOCONFIG
Addendum utility to configure this module. IOCONFIG Addendum uses menu–based screens for configuration without having to set individual bits in particular locations. Refer to your 6200 software literature for details.
Important:
It is strongly recommended that you use IOCONFIG
Addendum to configure this module. The IOCONFIG
Addendum utility greatly simplifies configuration. If the IOCONFIG Addendum is not available, you must enter data directly into the data table. Use this chapter as a reference when performing this task.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
4–2
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
During normal operation, the processor transfers from 1 to 4 words to the module when you program a BTW instruction to the module’s address.
Reading Data From Your
Module
Mapping Data for the
Module
I/O Image
Input Size
1 to 8 Words
Read programming moves status and data from the frequency input module to the processor’s data table in one I/O scan. The processor’s user program initiates the request to transfer data from the incremental encoder module to the processor.
The following read and write words and bit/word descriptions describe the information written to and read from the incremental encoder module. The module uses up to 8 words of input data and up to 4 words of output data. Each word is composed of 16 bits.
Incremental Encoder Module (1794-ID2) Image Table Mapping
Module Image
R PR1 PR0 S1 S0 C1 C0 G1 Z1 B1 A1 G0 Z0 B0 A0
Store 0 – Stored Counter Value on channel 0
Store 1 – Stored Counter Value on channel 1
Channel 0 – current counter value
Channel 1 – current counter value
Channel 0 – Counter word readback
Channel 1 – Counter word readback
Code for identification of software version
Output Size
0 to 4 Words
Channel 0 Control Word – Sets the function of counter 0
Channel 1 Control Word – Sets the function of counter 1
Channel 0 Preset – value to load or compare with counter 0
Preset 1 – value to load or compare with counter 1
Publication 1794-6.5.15 – December 1998
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
Block Transfer Read Word Assignments for the Incremental
Encoder Module (1794-ID2)
(Octal Bit
⇒
) 17
Dec. Bit
⇒
Word
⇓
0
1
15
16
14
Not used
15 14 13 12 11 10 07 06 05 04
13 12 11 10 09 08 07 06
Read
05 04
PR1 PR0 S1 S0 C1 C0 G1 Z1 B1
Channel 0 – Stored counter value on channel 0
A1
Channel 1 – Stored counter value on channel 1
Channel 0 – current counter value on channel 0
2
3
4
5
Channel 1 – current counter value on channel 1
Channel 0 – Counter word readback
6
7
Channel 1 – Counter word readback
Revision read – software version code
Where: A0 = Status of input A, channel 0 – bit = 1 when input is on
B0 = Status of input B, channel 0 – bit = 1 when input is on
Z0 = Status of input Z, channel 0 – bit = 1 when input is on
G0 = Status of input G, channel 0 – bit = 1 when input is on
G1 = Status of input G, channel 1 – bit = 1 when input is on
A1 = Status of input A, channel 1 – bit = 1 when input is on
B1 = Status of input B, channel 1 – bit = 1 when input is on
Z1 = Status of input Z, channel 1 – bit = 1 when input is on
C0 = Cal 0 – when bit is set, counter 0 has been calibrated (reset by CalReset)
C1 = Cal 1 – when bit is set, counter 1 has been calibrated (reset by CalReset)
S0 = Stored 0 – when bit is set, counter 0 value has been saved in Store 0 (reset by StoreReset)
S1 = Stored 1 – when bit is set, counter 1 value has been saved in Store 1 (reset by StoreReset)
Once a Store occurs, L0 and L1 are on until cleared by StoreReset (counter word bit 14)
PR0 = Preset 0 reached – when bit is set, counter 0 has reached value of preset
(reset by PresetReset)
PR1 = Preset 1 reached – when bit is set, counter 1 has reached value of preset
(reset by PresetReset)
03
03
G0
02
02
Z0
01
01
B0
00
00
A0
Bit/Word Definitions for Block Transfer Read Words
for the
Incremental Encoder Module
Read
Word
Bit
Bit 00
Bit 01
Bit 02
Bit 03
Bit 04
Bit 05
Definition
Status for input A (pulse transmitter 0) – This bit, when set, indicates a signal at A.
Status for input B (pulse transmitter 0) – This bit, when set, indicates a signal at B.
Status for input Z (pulse transmitter 0) – This bit, when set, indicates a signal at Z.
Status for input G (pulse transmitter 0) –This bit, when set, indicates a signal at G.
Status for input A (pulse transmitter 1) – This bit, when set, indicates a signal at A.
Status for input B (pulse transmitter 1) – This bit, when set, indicates a signal at B.
4–3
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
4–4
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
Read
Word
Word 0
Word 1
Word 2
Word 3
Word 4
Word 5
Word 6
Word 7
Bit Definition
Bit 06
Bit 07
Status for input Z (pulse transmitter 1) – This bit, when set, indicates a signal at Z.
Status for input G (pulse transmitter 1) – This bit, when set, indicates a signal at G.
Bit 08 (10) Cal 0 – This bit, when set (1), indicates that counter 0 has been calibrated. This bit is reset by CalReset.
Bit 09 (11) Cal 1 – This bit, when set (1), indicates that counter 1 has been calibrated. This bit is reset by CalReset.
Bit 10 (12) Store 0 – This bit, when set (1), indicates a counter value is saved in store 0. This bit is reset by StoreReset.
Bit 11 (13) Store 1 – This bit, when set (1), indicates a counter value is saved in store 1. This bit is reset by StoreReset.
Bit 12 (14)
Bit 13 (15)
Preset Reached 0 (PR0) – When this bit is set (1), in all configuration modes, the counter 0 value equals the preset 0 value, either in a positive or negative direction. This bit is reset by PresetReset0 and can only be set again after at least 1 more pulse.
Preset Reached 1 (PR1) – When this bit is set (1), in all configuration modes, the counter 1 value equals the preset 1 value, either in a positive or negative direction. This bit is reset by PresetReset1 and can only be set again after at least 1 more pulse.
Bit 14–15
(16–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Not used – set to 0
Store 0 – Saved counter value on channel 0
Store 1 – Saved counter value on channel 1
Channel 0 Current Counter Value– Current value in counter 0
Channel 1 Current Counter Value– Current value in counter 1
Channel 0 Readback– Counter word readback – last value written to write word 0
Channel 0 Readback– Counter word readback – last value written to write word 1
Revision Read – identification of latest software version code
Publication 1794-6.5.15 – December 1998
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
4–5
(Octal Bit)
⇒
17
Dec. Bit
⇒
Word
⇓
0
15
1
2
3
16
14
15
13
14
12
Block Transfer Write Word Assignments for the Incremental
Encoder Module
13 12 11 10 07 06 05 04
11 10 09 08
Write
07 06 05 04
Channel 0 Control Word – Sets the function of counter 0
Channel 1 Control Word – Sets the function of counter 1
Channel 0 Preset – value to load or compare with counter 0
Channel 1 Preset – value to load or compare with counter 1
03
03
02
02
01
01
00
00
Bit/Word Definitions for the Block Transfer Write Words for the
Incremental Encoder Module
Write
Word
Write
Bit
Definition
0–15 (0–17) Channel 0 Control Word – Control word for setting the function of counter 0.
Bits 00–02 02 01 00 Mode Selection bits
Bit 03
Bit 04
Bit 05
Bits 06–08
Bits 09–10
0
0
0
0
1
0 0
0 1
1 0
1 1
0 0
Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
Quadrature encoder X1
Quadrature encoder X2
Quadrature encoder X4
Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
1
1
0 1
1 0
No count function.
No count function.
1 1 1 No count function.
Preset (Reset) bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset
Enable. NOTE: To use Preset as Reset, use a count value of 0000 in the Preset value word.
Enable Z Preset bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of
Cal Enable. NOTE: If Z is configured to do Store and Preset (Reset), the Store will occur first.
Count Enable bit – When this is set (1), the incremental encoder is enabled.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
0
1
10 09
Gate Control bits
0 0 No gate function on input G
1
1
0
1
Counting only if G is high (active)
Counting only if G is low (inactive)
The counter can be calibrated when G is high (active).
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
4–6
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
Write
Word
Write
Write
Bit
Definition
Bits 11–12 12 11 Store Control bits – These bits will trigger a Store only if the channel Store status bit (L0 or L1) is cleared (0).
0
0
0
1
Save the counter value on the positive edge of Z (if Stored X = 0)
Save the counter value on the positive edge of G (if Stored X = 0)
1
1
0
1
Save the counter value on the negative edge of G (if Stored X = 0)
Save the counter value on the positive edge and negative edge of G (if Stored X = 0)
Bit 13 (15) Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0) (not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Bit 14 (16) Store Reset bit – A positive edge on this bit resets Store X in Signals.
Bit 15 (17) Preset Reset bit – A positive edge on this bit resets Preset Reached in Signals.
Channel 1 Control Word – Control word for setting the function of counter 1.
Bits 00–02 02 01 00
Mode Selection bits
Bit 03
Bit 04
Bit 05
1
1
1
0
0
0
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
Quadrature encoder X1
Quadrature encoder X2
Quadrature encoder X4
Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
No count function.
No count function.
1 1 1 No count function.
Preset bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset Enable.
Preset Enable bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of
Cal Enable.
Count Enable bit – When this is set (1), the incremental encoder is counting.
Publication 1794-6.5.15 – December 1998
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
4–7
Write
Word
Word 1
Word 2
Word 3
Bit
Definition
Bits 06–08 Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
Bits 09–10 10 09
Gate Control bits
0
0
0
1
No gate function on input G
Counting only if G is high (active)
Bits 11–12
1
1
0
1
Counting only if G is low (inactive)
Calibration if G is high (active) and ???
12 11 Store Control bits – These bits will trigger a Store only if the channel Store status bit (L0 or L1) is cleared (0).
0 0 Save the counter value on the positive edge of Z (if Store X = 0)
0
1
1
1 Save the counter value on the positive edge of G (if Store X = 0)
0 Save the counter value on the negative edge of G (if Store X = 0)
1 Save the counter value on the positive edge and negative edge of G (if Store X = 0)
Bit 13 Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0) (not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Store Reset bit – A positive edge on this bit resets Store X in Signals.
Bit 14
Bit 15 Store Reset bit – A positive edge on this bit resets Preset Reached in Signals.
Bits 00–15 Preset 0 – Value to load or compare with counter 0
Bits 00–15 Preset 1 – Value to load or compare with counter 1
Chapter Summary
In this chapter, you learned how to configure your module’s features and enter your data.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
4–8
Writing Configuration to and Reading Status from Your Module with a Remote I/O Adapter
Publication 1794-6.5.15 – December 1998
Chapter
5
How Communication Takes
Place and I/O Image Table
Mapping with the DeviceNet
Adapter
What This Chapter
Contains
About DeviceNetManager
Software
More
In this chapter, we tell you about:
For information on See page
About DeviceNetManager Software . . . . . . . . . . . . . . . . . . . . . . 5–1
Polled I/O Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1
Adapter Input Status Word . . . . . . . . . . . . . . . . . . . . . . . . . . 5–2
System Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–3
Mapping Data into the Image Table . . . . . . . . . . . . . . . . . . . . . . . 5–3
Incremental Encoder Module (1794-ID2) Image Table Mapping . . .
Block Transfer Read Word Assignments . . . . . . . . . . . . . . . . 5–4
Block Transfer Write Word Assignments . . . . . . . . . . . . . . . . . 5–4
Word/Bit Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–5
Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–8
DeviceNetManager software is a tool used to configure your FLEX
I/O DeviceNet adapter and its related modules. This software tool can be connected to the adapter via the DeviceNet network.
You must understand how DeviceNetManager software works in order to add a device to the network. Refer to the DeviceNetManager
Software User Manual, publication 1787-6.5.3.
Polled I/O Structure
Network READ
Output data is received by the adapter in the order of the installed
I/O modules. The Output data for Slot 0 is received first, followed by the Output data for Slot 1, and so on up to slot 7.
The first word of input data sent by the adapter is the Adapter Status
Word. This is followed by the input data from each slot, in the order of the installed I/O modules. The Input data from Slot 0 is first after the status word, followed by Input data from Slot 2, and so on up to slot 7.
DeviceNet Adapter
Read Data
Adapter Status
Slot 0 Input Data
Slot 1 Input Data
Slot 7 Input Data
Read
Write
I/O Module
Slot 0
I/O Module
...
I/O Module
Slot 1 Slot 7
Write Data
Slot 0 Output Data
Slot 1 Output Data
Network WRITE
Slot 7 Output Data
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
5–2
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
Adapter Input Status Word
Bit:
The input status word consists of:
•
I/O module fault bits – 1 status bit for each slot
• node address changed – 1 bit
•
I/O status – 1 bit
15 10 through 15 9 8 7 6
I/O Module Fault Bits
5 4 3 2 1 0
Not Used
I/O State Bit
Node Address Changed Bit
The adapter input status word bit descriptions are shown in the following table.
Bit Description
Node Address Changed
I/O State
Bit Explanation
6
7
4
5
2
3
0
1
This bit is set (1) when an error is detected in slot position 0.
This bit is set (1) when an error is detected in slot position 1.
This bit is set (1) when an error is detected in slot position 2.
This bit is set (1) when an error is detected in slot position 3.
This bit is set (1) when an error is detected in slot position 4.
This bit is set (1) when an error is detected in slot position 5.
This bit is set (1) when an error is detected in slot position 6.
This bit is set (1) when an error is detected in slot position 7.
8
This bit is set (1) when the node address switch setting has been changed since power up.
9
Bit = 0 – idle
Bit = 1 – run
10 thru 15 Not used – sent as zeroes.
Possible causes for an I/O Module Fault are:
• transmission errors on the Flex I/O backplane
• a failed module
• a module removed from its terminal base
• incorrect module inserted in a slot position
• the slot is empty
The node address changed bit is set when the node address switch setting has been changed since power up. The new node address does not take affect until the adapter has been powered down and then powered back up.
Publication 1794-6.5.15 – December 1998
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
System Throughput
System throughput, from incremental encoder to backplane, is a function of:
• the configured minimum frequency sample time
• the number of channels actually configured for connection to a specific sensor (0 or 1)
You can set the minimum frequency time during module configuration. The selection influences the sample data rate, thus affecting system throughput.
The number of channels included in each input scan also affects system throughput.
5–3
Mapping Data into the
Image Table
I/O Image
Input Size
1 to 8 Words
FLEX I/O incremental encoder module data table mapping is shown below.
Incremental Encoder Module (1794-ID2) Image Table Mapping
Module Image
R PD1 PD0 S1 S0 C1 C0 G1 Z1 B1 A1 G0
Store 0 – Saved Counter Value on channel 0
Z0 B0 A0
Store 1 – Saved Counter Value on channel 1
Channel 0 – current counter value on channel 0
Channel 1 – current counter value on channel 1
Channel 0 – Counter word readback
Channel 1 – Counter word readback
Code for identification of software version
Output Size
0 to 7 Words
Channel 0 Control Word– sets the function of counter 0
Channel 1 Control Word – sets the function of counter 1
Channel 0 Preset – value to load or compare with counter 0
Channel 1 Preset – value to load or compare with counter 1
Not used
Not used
Not used
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
5–4
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
Block Transfer Read Word Assignments for the Incremental
Encoder Module (1794-ID2)
(Octal Bit
⇒
) 17
Dec. Bit
⇒
Word
⇓
1
2
15
16
14
Not used
15 14 13 12 11 10 07 06 05 04
13 12 11 10 09 08 07 06
Read
05 04
PR1 PR0 S1 S0 C1 C0 G1 Z1 B1
Channel 0 – Stored counter value on channel 0
A1
Channel 1 – Stored counter value on channel 1
Channel 0 – current counter value on channel 0
3
4
5
6
Channel 1 – current counter value on channel 1
Channel 0 – Counter word 0 readback
7
8
Channel 1 – Counter word 1 readback
Revision read – software version code
Where: A0 = Status of input A, channel 0 – bit = 1 when input is on
B0 = Status of input B, channel 0 – bit = 1 when input is on
Z0 = Status of input Z, channel 0 – bit = 1 when input is on
G0 = Status of input G, channel 0 – bit = 1 when input is on
G1 = Status of input G, channel 1 – bit = 1 when input is on
A1 = Status of input A, channel 1 – bit = 1 when input is on
B1 = Status of input B, channel 1 – bit = 1 when input is on
Z1 = Status of input Z, channel 1 – bit = 1 when input is on
C0 = Cal 0 – when bit is set, counter 0 has been calibrated (reset by CalReset)
C1 = Cal 1 – when bit is set, counter 1 has been calibrated (reset by CalReset)
S0 = Stored 0 – when bit is set, counter 0 value has been saved in Store 0 (reset by StoreReset)
S1 = Stored 1 – when bit is set, counter 1 value has been saved in Store 1 (reset by StoreReset)
Once a Store occurs, L0 and L1 are on until cleared by StoreReset (counter word bit 14)
PR0 = Preset 0 reached – when bit is set, counter 0 has reached value of preset
(reset by PresetReset)
PR1 = Preset 1 reached – when bit is set, counter 1 has reached value of preset
(reset by PresetReset)
03
03
G0
02
02
Z0
01
01
B0
00
00
A0
(Octal Bit)
⇒
17
Dec. Bit
⇒
Word
⇓
15
1
2
3
4
5–7
16
14
15
13
Block Transfer Write Word Assignments for the Incremental
Encoder Module (1794-ID2)
14 13 12 11 10 07 06 05 04 03
12 11 10 09 08
Write
07 06 05 04 03
Channel 0 Control Word – control word for setting the function of counter 0
Channel 1 Control Word – control word for setting the function of counter 1
Channel 0 Preset – value to load or compare with counter 0
Channel 1 Preset – value to load or compare with counter 1
Not used
02
02
01
01
00
00
Publication 1794-6.5.15 – December 1998
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
Word
Read
Read
Word 2
Read
Word 3
Read
Word 4
Read
Word 5
Read
Word 6
Read
Word 7
Read
Word 8
Bit/Word Definitions
for the incremental encoder Module (1794–ID2)
Bit 14–15
(16–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bit
Bit 00
Bit 01
Bit 02
Bit 03
Bit 04
Bit 05
Definition
Status for input A (pulse transmitter 0) – This bit, when set, indicates a signal at A.
Status for input B (pulse transmitter 0) – This bit, when set, indicates a signal at B.
Status for input Z (pulse transmitter 0) – This bit, when set, indicates a signal at Z.
Status for input G (pulse transmitter 0) –This bit, when set, indicates a signal at G.
Status for input A (pulse transmitter 1) – This bit, when set, indicates a signal at A.
Status for input B (pulse transmitter 1) – This bit, when set, indicates a signal at B.
Bit 06
Bit 07
Status for input Z (pulse transmitter 1) – This bit, when set, indicates a signal at Z.
Status for input G (pulse transmitter 1) – This bit, when set, indicates a signal at G.
Bit 08 (10) Cal 0 – This bit, when set (1), indicates that counter 0 has been calibrated. This bit is reset by CalReset.
Bit 09 (11) Cal 1 – This bit, when set (1), indicates that counter 1 has been calibrated. This bit is reset by CalReset.
Bit 10 (12) Store 0 – This bit, when set (1), indicates a counter value is saved in store 0. This bit is reset by StoreReset.
Bit 11 (13) Store 1 – This bit, when set (1), indicates a counter value is saved in store 1. This bit is reset by StoreReset.
Bit 12 (14)
Bit 13 (15)
Preset Reached 0 (PR0) – When this bit is set (1), in all configuration modes, the counter 0 value equals the preset 0 value, either in a positive or negative direction. This bit is reset by PresetReset0 and can only be set again after at least 1 more pulse.
Preset Reached 1 (PR1) – When this bit is set (1), in all configuration modes, the counter 1 value equals the preset 1 value, either in a positive or negative direction. This bit is reset by PresetReset1 and can only be set again after at least 1 more pulse.
Not used – set to 0
Store 0 – Saved counter value on channel 0
Store 1 – Saved counter value on channel 1
Channel 0 Current Counter Value– Current value in counter 0
Channel 1 Current Counter Value– Current value in counter 1
Counter 0 Readback – Counter word readback – last value written to write word 1
Counter 1 Readback – Counter word readback – last value written to write word 2
Revision Read – identification of latest software version code
5–5
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
5–6
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
Word
Write
Bit Definition
0–15 (0–17) Control 0 – Control word for setting the function of counter 0.
Bits 00–02 02 01 00 Mode Selection bits
Bit 03
Bit 04
Bit 05
Bits 06–08
Bits 09–10
Bits 11–12
0 0 0 Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
0 0 1 Quadrature encoder X1
0 1 0 Quadrature encoder X2
0 1 1 Quadrature encoder X4
1 0 0 Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
1 0 1 No count function.
1 1 0 No count function.
1 1 1 No count function.
Preset (Reset) bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset
Enable. NOTE: To use Preset as Reset, use a count value of 0000 in the Preset value word.
Enable Z Preset bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of
Cal Enable. NOTE: If Z is configured to do Store and Preset (Reset), the Store will occur first.
Count Enable bit – When this is set (1), the incremental encoder is enabled.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
10 09
Gate Control bits
0 0 No gate function on input G
0 1 Counting only if G is high (active)
1 0 Counting only if G is low (inactive)
1 1 The counter can be calibrated when G is high (active).
12 11
Store Control bits
0 0 Save the counter value on the positive edge of Z (if Stored X = 0)
0 1 Save the counter value on the positive edge of G (if Stored X = 0)
1 0 Save the counter value on the negative edge of G (if Stored X = 0)
1 1 Save the counter value on the positive edge and negative edge of G (if Stored X = 0)
Bit 13 (15) Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0) (not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Bit 14 (16) Store Reset bit – A positive edge on this bit resets Stored X in Signals.
Bit 15 (17) Preset Reset bit – A positive edge on this bit resets Preset Detected in Signals.
Publication 1794-6.5.15 – December 1998
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
Word
Write
Write
Word 3
Write
Word 4
Write
Words
5–7
Bit Definition
Channel 1 Control Word – Control word for setting the function of counter 1.
Bits 00–02 Bit 02 01 00
Mode Selection bits
Bit 03
Bit 04
Bit 05
Bits 06–08
Bits 09–10
Bits 11–12
0 0 0 Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
0 0 1 Quadrature encoder X1
0 1 0 Quadrature encoder X2
0 1 1 Quadrature encoder X4
1 0 0 Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
1 0 1 No count function.
1 1 0 No count function.
1 1 1 No count function.
Preset bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset Enable.
Preset Enable bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of
Cal Enable.
Count Enable bit – When this is set (1), the incremental encoder is counting.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
10 09
Gate Control bits
0 0 No gate function on input G
0 1 Counting only if G is high (active)
1 0 Counting only if G is low (inactive)
1 1 Calibration if G is high (active) and ???
12 11
Latch Control bits
0 0 Save the counter value on the positive edge of Z (if Stored X = 0)
0 1 Save the counter value on the positive edge of G (if Stored X = 0)
1 0 Save the counter value on the negative edge of G (if Stored X = 0)
1 1 Save the counter value on the positive edge and negative edge of G (if Stored X = 0)
Bit 13 (15) Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0) (not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Bit 14 (16) Store Reset bit – A positive edge on this bit resets Stored X in Signals.
Bit 15 (17) Store Reset bit – A positive edge on this bit resets Preset Reached in Signals.
Bits 00–15
(00–17)
Preset 0 – Value to load or compare with counter 0
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Preset 1 – Value to load or compare with counter 1
Not used – set to 0.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
5–7
5–8
Defaults
How Communication Takes Place and I/O Image Table Mapping with the DeviceNet Adapter
More
Each I/O module has default values associated with it. At default, each module will generate inputs/status and expect outputs/configuration.
Catalog
Number
1794-ID2
Module Defaults for:
Description
incremental encoder Module
Factory Defaults Real Time Size
Input
Default
9
Output
Default
7
Input
Default
4
Output
Default
0
Factory defaults are the values assigned by the adapter when you:
• first power up the system, and
• no previous stored settings have been applied.
For incremental encoder modules, the defaults reflect the actual number of input words/output words. For example, for the incremental encoder module, you have 9 input words, and 7 output words.
You can change the I/O data size for a module by reducing the number of words mapped into the adapter module, as shown in “real time sizes.”
Real time sizes are the settings that provide optimal real time data to the adapter module.
The incremental encoder modules have 15 words assigned to them.
This is divided into input words/output words. You can reduce the
I/O data size to fewer words to increase data transfer over the backplane.
For information on using DeviceNetManager software to configure your adapter, refer to the DeviceNetManager Software User Manual, publication 1787-6.5.3.
Publication 1794-6.5.15 – December 1998
Chapter
6
Input, Output and
Configuration Files for Analog
Modules when used with
ControlNet
Chapter Objectives
In this chapter you will learn about:
•
ControlNet Adapter
•
I/O structure
• safe state data
• communication fault data
• idle state behavior
• input data behavior upon module removal
About the ControlNet
Adapter
The FLEX I/O ControlNet adapters (cat. no. 1794–ACN15 and
–ACNR15) interfaces up to 8 FLEX I/O modules and a ControlNet processor or scanner. The adapter can support ControlNet real–time data connections to individual modules or module groups. Each connection is independent of the others and can be from different processors or scanners.
Communication Over the
FLEX I/O Backplane
One 1794-ACN15 and -ACNR15 ControlNet adapter can interface up to eight terminal base units with installed FLEX I/O modules, forming a FLEX I/O system of up to eight slots. The adapter communicates to other network system components (typically one or more controllers or scanners, and/or programming terminals) over the ControlNet network. The adapter communicates with its I/O modules over the backplane.
I/O Module
0
Inputs
I/O Module
Inputs
I/O Module
Inputs
Read
Status
Read
Words
Status Status
ControlNet
Adapter
Network
Write
Outputs
Configuration
15
Slot 0
Write
Words
Outputs
Configuration
Slot 1
Outputs
Configuration
Slot 7
Data is exchanged scheduled (when mapped) or unscheduled (using
CIO instructions).
Allen-Bradley Motors
6–2
Input, Output and Configuration Files for Analog Modules when used with ControlNet
Scheduled Data-Transfer
Scheduled data transfer:
• is continuous
• is asynchronous to the ladder-logic program scan
• occurs at the actual rate displayed in the Actual Packet Interval field on the programming software ControlNet I/O mapping
(monitor) screen
Unscheduled Data-Transfer
Unscheduled operations include:
• unscheduled non-discrete I/O data transfers—through ControlNet
I/O Transfer (CIO) instructions
• peer-to-peer messaging—through Message (MSG) instructions
• messaging from programming devices
Unscheduled messaging on a ControlNet network is non-deterministic. Your application and your configuration—number of nodes, application program, NUT, amount of scheduled bandwidth used, etc.—determine how much time there is for unscheduled messaging.
Module I/O Mapping
The I/O map for a module is divided into read words and write words. Read words consist of input and status words, and write words consist of output and configuration words. The number of read words or write words can be 0 or more. The length of each I/O module’s read words and write words vary in size depending on module complexity. Each I/O module will support at least 1 input word or 1 output word. Status and configuration are optional, depending on the module.
For example, a 16 point discrete input module will have up to 2 read words and 1 write word.
16-point Discrete Input Module
ControlNet Image
Input Size
1 or 2 Words
Configuration Size
0 or 1 Word
Module Image
Inputs
Not used
Not used
Delay
Time
Delay
Time
Check the I/O map for each module for the exact mapping.
Publication 1794-6.5.15 – December 1998
I/O Structure
Input, Output and Configuration Files for Analog Modules when used with ControlNet
6–3
Network READ
Output data is received by the adapter in the order of the installed
I/O modules. The Output data for Slot 0 is received first, followed by the Output data for Slot 1, and so on up to slot 7.
The first word of input data sent by the adapter is the Adapter Status
Word. This is followed by the input data from each slot, in the order of the installed I/O modules. The Input data from Slot 0 is first after the status word, followed by Input data from Slot 2, and so on up to slot 7.
ControlNet Adapter
Read Data
Adapter Status
Slot 0 Input Data
Slot 1 Input Data
Slot 7 Input Data
Output Data
Slot 0 Output Data
Slot 1 Output Data
Read
Write
I/O Module
Slot 0
I/O Module
...
Slot 1
I/O Module
Slot 7
Network WRITE
Slot 7 Output Data
Adapter Input Status Word
Bit:
The input status word consists of:
•
I/O module fault bits – 1 status bit for each slot
• node address changed – 1 bit (created by PLC–5 controller)
•
I/O status – 1 bit (created by PLC–5 controller)
15 10 through 15 9 8 7 6
I/O Module Fault Bits
5 4 3 2 1 0
Not Used
Created by PLC–5 controller
I/O State Bit
Node Address Changed Bit
The adapter input status word bit descriptions are shown in the following table.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
6–4
Input, Output and Configuration Files for Analog Modules when used with ControlNet
Bit Description
Node Address Changed
(Created by PLC–5 controller.)
I/O State (Created by
PLC–5 controller.)
Bit
5
6
7
2
3
0
1
4
Explanation
This bit is set (1) when an error is detected in slot position 0.
This bit is set (1) when an error is detected in slot position 1.
This bit is set (1) when an error is detected in slot position 2.
This bit is set (1) when an error is detected in slot position 3.
This bit is set (1) when an error is detected in slot position 4.
This bit is set (1) when an error is detected in slot position 5.
This bit is set (1) when an error is detected in slot position 6.
This bit is set (1) when an error is detected in slot position 7.
8
This bit is set (1) when the node address switch setting has been changed since power up.
9
Bit = 0 – idle
Bit = 1 – run
10 thru 15 Not used – set to 0.
Safe State Data
Device Actions
Possible causes for an I/O Module Fault are:
• transmission errors on the FLEX I/O backplane
• a failed module
• a module removed from its terminal base
• incorrect module inserted in a slot position
• the slot is empty
• the slot contains a non–discrete module
The ControlNet adapter provides storage for alternate module output data during communication faults or processor idle state. This “safe state data” assures that a known output will be applied to the output devices to maintain a previously designated safe operating condition during the previously mentioned failure modes. The processor or scanner software must include the means to specify this safe state data for each module. If applicable, this data is sent in the configuration block (see Image Table Mapping later in this chapter).
Device actions include:
• communication fault behavior
• idle state behavior
• input data behavior upon module removal
Publication 1794-6.5.15 – December 1998
Input, Output and Configuration Files for Analog Modules when used with ControlNet
6–5
Communication Fault Behavior
You can configure the adapter response to a communication fault for each I/O module in its system. Upon detection of a communication fault, the adapter can:
• leave the module output data in its last state (hold last state)
• reset the module output data to zero (reset)
• apply safe state data to the module output
Idle State Behavior
The ControlNet adapter can detect the state of the controlling processor or scanner. Only 2 states can be detected: run mode, or program mode (idle).
When run mode is detected, the adapter copies the output data received from the processor to the corresponding module output.
When program mode is detected, the adapter can be configured to:
• leave the module output data in its last state (hold last state)
• reset the module output data to zero (reset)
• apply safe state data to the module output
Input Data Behavior upon Module Removal
I/O module input data sent by the adapter upon module removal is configurable. The adapter can:
• reset the module output data to zero (reset)
• leave the module output data in the last state before module removal (hold last state)
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
6–6
Input, Output and Configuration Files for Analog Modules when used with ControlNet
ControlNet Files
Input File Size
1 to 8 Words
Incremental Encoder Module (1794-ID2) Image Table Mapping
Module Image
R PD1 PD0 S1 S0 C1 C0 G1 Z1 B1 A1 G0 Z0 B0 A0
Store 0 – Stored Counter Value on channel 0
Store 1 – Stored Counter Value on channel 1
Channel 0 – current counter value
Channel 1 – current counter value
Channel 0 – Counter word readback
Channel 1 – Counter word readback
Code for identification of software version
Output File Size
0 to 4 Words
Channel 0 Control Word – Sets the function of counter 0
Channel 1 Control Word – Sets the function of counter 1
Channel 0 Preset – value to load or compare with counter 0
Channel 1 Preset – value to load or compare with counter 1
Configuration File Size
0 to 4 Words
Channel 0 Control Word – Sets the function of counter 0
Channel 1 Control Word – Sets the function of counter 1
Channel 0 Preset – value to load or compare with counter 0
Channel 1 Preset – value to load or compare with counter 1
Input Word Bit
Bit 00
Bit 01
Bit 02
Bit 03
Bit 04
Bit 05
Bit/Word Definitions for Block Transfer Read Words
for the
Incremental Encoder Module
Definition
Status for input A (pulse transmitter 0) – This bit, when set, indicates a signal at A.
Status for input B (pulse transmitter 0) – This bit, when set, indicates a signal at B.
Status for input Z (pulse transmitter 0) – This bit, when set, indicates a signal at Z.
Status for input G (pulse transmitter 0) –This bit, when set, indicates a signal at G.
Status for input A (pulse transmitter 1) – This bit, when set, indicates a signal at A.
Status for input B (pulse transmitter 1) – This bit, when set, indicates a signal at B.
Publication 1794-6.5.15 – December 1998
Input, Output and Configuration Files for Analog Modules when used with ControlNet
Input Word
Word 0
Word 1
Word 2
Word 3
Word 4
Word 5
Word 6
Word 7
Bit Definition
Bit 06
Bit 07
Status for input Z (pulse transmitter 1) – This bit, when set, indicates a signal at Z.
Status for input G (pulse transmitter 1) – This bit, when set, indicates a signal at G.
Bit 08 (10) Cal 0 – This bit, when set (1), indicates that counter 0 has been calibrated. This bit is reset by CalReset.
Bit 09 (11) Cal 1 – This bit, when set (1), indicates that counter 1 has been calibrated. This bit is reset by CalReset.
Bit 10 (12) Store 0 – This bit, when set (1), indicates a counter value is saved in store 0. This bit is reset by StoreReset.
Bit 11 (13) Store 1 – This bit, when set (1), indicates a counter value is saved in store 1. This bit is reset by StoreReset.
Bit 12 (14)
Bit 13 (15)
Preset Reached 0 (PR0) – When this bit is set (1), in all configuration modes, the counter 0 value equals the preset 0 value, either in a positive or negative direction. This bit is reset by PresetReset0 and can only be set again after at least 1 more pulse.
Preset Reached 1 (PR0) – When this bit is set (1), in all configuration modes, the counter 1 value equals the preset 1 value, either in a positive or negative direction. This bit is reset by PresetReset1 and can only be set again after at least 1 more pulse.
Bit 14–15
(16–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Bits 00–15
(00–17)
Not used – set to 0
Store 0 – Saved counter value on channel 0
Store 1 – Saved counter value on channel 1
Channel 0 Current Counter Value– Current value in counter 0
Channel 1 Current Counter Value– Current value in counter 1
Channel 0 Readback– Counter word readback)
Channel 0 Readback– Counter word readback)
Software identification
6–7
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
6–8
Input, Output and Configuration Files for Analog Modules when used with ControlNet
Output
Word
Word 0
Bit
Definition
Channel 0 Control Word – Control word for setting the function of counter 0.
Bits 00–02
02 01 00
Mode Selection bits
Bit 03
Bit 04
Bit 05
Bits 06–08
0
0
0
0
0 0
0 1
1 0
1 1
Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
Quadrature encoder X1
Quadrature encoder X2
Quadrature encoder X4
1
1
1
1
0
0
1
1
0
1
0
1
Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
No count function.
No count function.
No count function.
Preset (Reset) bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset
Enable. NOTE: To use Preset as Reset, use a count value of 0000 in the Preset value word.
Enable Z Preset bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of
Cal Enable. NOTE: If Z is configured to do Store and Preset (Reset), the Store will occur first.
Count Enable bit – When this is set (1), the pulse counter is enabled.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
10 09
Gate Control bits
Bits 09–10
Bits 11–12
1
1
0
0
0
1
0
1
No gate function on input G
Counting only if G is high (active)
Counting only if G is low (inactive)
The counter can be calibrated when G is high (active).
12 11 Store Control bits – These bits will trigger a Store only if the channel Store status bit (L0 or L1) is cleared (0).
0 0 Save the counter value on the positive edge of Z (if Stored X = 0)
0
1
1 Save the counter value on the positive edge of G (if Stored X = 0)
0 Save the counter value on the negative edge of G (if Stored X = 0)
1 1 Save the counter value on the positive edge and negative edge of G (if Stored X = 0)
Bit 13 (15) Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0) (not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Bit 14 (16) Store Reset bit – A positive edge on this bit resets Store X in Signals.
Bit 15 (17) Preset Reset bit – A positive edge on this bit resets Preset Reached in Signals.
Publication 1794-6.5.15 – December 1998
Input, Output and Configuration Files for Analog Modules when used with ControlNet
6–9
Output
Word
Word 1
Word 2
Word 3
Bit
Definition
Channel 1 Control Word – Control word for setting the function of counter 1.
Bits 00–02 02 01 00
Mode Selection bits
Bit 03
Bit 04
Bit 05
Bits 06–08
1
1
1
1
0
0
0
0
0 0
0 1
1 0
1 1
0 0
0 1
1 0
1 1
Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
Quadrature encoder X1
Quadrature encoder X2
Quadrature encoder X4
Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
No count function.
No count function.
No count function.
Preset bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset Enable.
Preset Enable bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of
Cal Enable.
Count Enable bit – When this is set (1), the pulse counter is counting.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
Bits 09–10 10 09
Gate Control bits
0 0 No gate function on input G
0
1
1
0
Counting only if G is high (active)
Counting only if G is low (inactive)
Bits 11–12
1 1 Calibration if G is high (active) and ???
12 11 Store Control bits – These bits will trigger a Store only if the channel Store status bit (L0 or L1) is cleared (0).
0 0 Save the counter value on the positive edge of Z (if Store X = 0)
0
1
1
1 Save the counter value on the positive edge of G (if Store X = 0)
0 Save the counter value on the negative edge of G (if Store X = 0)
1 Save the counter value on the positive edge and negative edge of G (if Store X = 0)
Bit 13 Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0) (not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Store Reset bit – A positive edge on this bit resets Store X in Signals.
Bit 14
Bit 15 Store Reset bit – A positive edge on this bit resets Preset Detected in Signals.
Bits 00–15 Preset 0 – Value to load or compare with counter 0
Bits 00–15 Preset 1 – Value to load or compare with counter 1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
6–10
Input, Output and Configuration Files for Analog Modules when used with ControlNet
Configuration
Word
Word 0
Bit
Definition
Channel 0 Control Word – Control word for setting the function of counter 0.
Bits 00–02
02 01 00
Mode Selection bits
Bit 03
Bit 04
Bit 05
Bits 06–08
0 0 0 Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
0 0 1 Quadrature encoder X1
0 1 0 Quadrature encoder X2
0 1 1 Quadrature encoder X4
1 0 0 Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
1 0 1 No count function.
1 1 0 No count function.
1 1 1 No count function.
Preset (Reset) bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of
Preset Enable. NOTE: To use Preset as Reset, use a count value of 0000 in the Preset value word.
Enable Z Preset bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of Cal Enable. NOTE: If Z is configured to do Store and Preset (Reset), the Store will occur first.
Count Enable bit – When this is set (1), the pulse counter is enabled.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
Bits 09–10
Bits 11–12
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
10 09
Gate Control bits
0 0 No gate function on input G
0 1 Counting only if G is high (active)
1 0 Counting only if G is low (inactive)
1 1 The counter can be calibrated when G is high (active).
12 11 Store Control bits – These bits will trigger a Store only if the channel Store status bit (L0 or L1) is cleared (0).
0 0 Save the counter value on the positive edge of Z (if Latched X = 0)
0 1 Save the counter value on the positive edge of G (if Latched X = 0)
1 0 Save the counter value on the negative edge of G (if Latched X = 0)
1 1 Save the counter value on the positive edge and negative edge of G (if Latched X = 0)
Bit 13 (15) Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0)
(not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Bit 14 (16) Store Reset bit – A positive edge on this bit resets Store X in Signals.
Bit 15 (17) Preset Reset bit – A positive edge on this bit resets Preset Detected in Signals.
Publication 1794-6.5.15 – December 1998
Input, Output and Configuration Files for Analog Modules when used with ControlNet
6–11
Configuration
Word
Word 1
Word 2
Word 3
Bit
Definition
Channel 1 Control Word – Control word for setting the function of counter 1.
Bits 00–02 Bit 02 01 00
Mode Selection bits
0 0 0 Counting on positive (rising) edge of input signal A. (Up/dwn counting determined by B.)
0 0 1 Quadrature encoder X1
0 1 0 Quadrature encoder X2
0 1 1 Quadrature encoder X4
Bit 03
Bit 04
Bit 05
Bits 06–08
1 0 0 Counting up on the positive edge of input signal A, and down on positive edge of input signal B.
1 0 1 No count function.
1 1 0 No count function.
1 1 1 No count function.
Preset bit – A positive edge on this bit moves the value in Preset X to Counter X, independent of Preset
Enable.
Preset Enable bit – When this bit is set (1), a positive edge on Z preloads Counter X = Preset X, independent of Cal Enable.
Count Enable bit – When this is set (1), the pulse counter is counting.
Calibration Control bits – bits 06, 07 and 08
06 Enable bit – When this bit is set (1), the counter can be calibrated.
07 Direction bit – When this bit set (1), calibration is performed in a negative direction; when reset (0), calibration is performed in a positive direction.
08 Reset bit – Calibration is acknowledged and a new calibration is enabled on a positive edge on this bit.
Bits 09–10 10 09
Gate Control bits
Bits 11–12
0 0 No gate function on input G
0 1 Counting only if G is high (active)
1 0 Counting only if G is low (inactive)
1 1 Calibration if G is high (active) and ???
12 11 Store Control bits – These bits will trigger a Store only if the channel Store status bit (L0 or L1) is cleared (0).
0 0 Save the counter value on the positive edge of Z (if Store X = 0)
Bit 13
0 1 Save the counter value on the positive edge of G (if Store X = 0)
1 0 Save the counter value on the negative edge of G (if Store X = 0)
1 1 Save the counter value on the positive edge and negative edge of G (if Store X = 0)
Rollover bit – When set (1), the counter counts up to the preset and then restarts at 0. If this bit is reset (0)
(not rollover), the rollover preset value = FFFF (hex = 65535 (decimal).
Bit 14
Bit 15
Store Reset bit – A positive edge on this bit resets Store X in Signals.
Store Reset bit – A positive edge on this bit resets Preset Detected in Signals.
Bits 00–15 Preset 0 – Value to load or compare with counter 0
Bits 00–15 Preset 1 – Value to load or compare with counter 1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
6–12
Input, Output and Configuration Files for Analog Modules when used with ControlNet
Publication 1794-6.5.15 – December 1998
Chapter Objective
Calibrating Your Module
Chapter
7
Calibrating Your Incremental
Encoder Module
In this chapter, we tell you how to set up your system to calibrate the incremental encoder.
The incremental encoder module does not require calibration.
However, you must synchronize the module with the process you are monitoring.
You must have your incremental encoder module installed in an operating FLEX I/O system in order to complete synchronization.
Process calibration of the counter synchronizes the control system with the machinery where the incremental encoder is mounted. The counter is set to a preset value when a reference pulse is received.
Use input Z to activate calibration. The input to Z can be a zero pulse integrated with an incremental encoder. Or input Z can come from another transmitter independent of the pulse transmitter. Calibration is performed at the first positive edge of input signal Z and is independent of the signal duration.
Calibration is enabled if CalEnable = 1 or if GateControl = 3 and G input = 1. The counter direction must coincide with CalDirection and
Calibrated must be = 0 (acknowledged by a positive edge on
CalReset). When calibration is activated, the counter is given the value in PresetValue and Calibrated will be set. The counter value can be saved in StoreValue if StoreControl = 0 and Stored = 0. Note that the condition for the latch function is not dependent on the direction and therefore does not automatically occur on that edge of
Z which activates calibration.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
7–2
Calibrating Your Incremental Encoder Module
Calibration Method 1
Calibration is enabled by the flag CalEnable, which is enabled by the control system. The preset value is copied to the counter register at a positive edge on input Z. The old counter register value is saved in the store register for evalution.
Calibration direction is determined by CalDirection (0 = positive direction, 1 = negative direction).
Reset Calibrated, Stored and PresetReached after calibration with
CalReset, StoreReset and PresetReset.
CalEnable = 1
CalDirection = Direction of the latest count pulse
Calibrated = 0
Preset Register
Logic
Calibrated = 1
PresetReached = 1
Z =
Counter Register
StoreControl = 0
Stored = 0
Z =
Logic
Counter Register
Latched Register
Stored = 1
Publication 1794-6.5.15 – December 1998
Calibrating Your Incremental Encoder Module
7–3
Calibration Method 2
Calibration is enabled by input G if GateControl = 3 and Calibrated
= 0. The preset value is copied to the counter register at a positive edge on input signal Z. The old counter register value is saved in the store register for evalution.
Calibration direction is determined by CalDirection (0 = positive direction, 1 = negative direction).
Reset Calibrated, Stored and PresetReached after calibration with
CalReset, StoreReset and PresetReset.
GateControl = 3
CalDirection = Direction of the latest count pulse
Calibrated = 0
G = 1
Z
StoreControl = 0
Stored = 0
Z
Logic
Preset Register
Calibrated = 1
PresetReached = 1
Counter Register
Logic
Counter Register
Stored Register
Stored = 1
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
7–4
Calibrating Your Incremental Encoder Module
Publication 1794-6.5.15 – December 1998
What This Chapter
Contains
Status Indicators
Chapter
8
Use this chapter to troubleshoot the incremental encoder module by interpreting the indicators.
The module contains indicators for each of the following:
Allen-Bradley
2 CH INCREMENTAL ENCODER MODULE
1794–ID2
A B Z G
+ –
1
A B Z G
+ –
C B A
A = Power/status indicator – indicates power applied to module and status of module.
B = Insertable label for writing individual I/O assignments.
C = Status Indicators –
A = Status of input A
B = Status of input B
Z = Status of input Z
G = Status of input G
+ = Positive count detected
– = Negative count detected
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
8–2
What’s Next
Troubleshoot the Incremental Encoder Module
Indicator
A
B
Z
G
+
–
OK
Indication
Yellow
Off
Yellow
Off
Yellow
Off
Yellow
Off
Yellow
Yellow
Red
Green
Explanation
Input A active
Input A not active
Input B active
Input B not active
Input Z active
Input Z not active
Input G active
Input G not active
On when a positive pulse is detected; turns off on negative pulse.
On when a negative pulse is detected; turns off on positive pulse.
Red during initialization after power turned on
Green when initialization is completed
When an input indicator (yellow) is lighted, it indicates that a valid signal (active high or active low) is present at one of the Input terminals.
To find out more about the ID2 module:
See appendix A
Specifications
For
specifications on the ID2 module
Publication 1794-6.5.15 – December 1998
Specifications – 1794-ID2 2 Input Incremental Encoder Module
Input Specifications
Number of Counters 2
Number of Inputs per Counter 4 inputs (A, B, Z, G)
Input Pulse Width (minimum) Each signal condition must be stable for at least
2
µ s to be recognized.
Counting Frequency 100KHz maximum.
Input Range Input ON
Input OFF
Input Current (typical)
Maximum 26.4V dc (24V dc +10%)
Minimum 6V dc
Maximum 3V dc
Minimum –26.4V dc
3mA @ 6V dc
9mA @ 12V dc
15mA @ 24V dc
General Specifications
Module Location
Isolation Voltage
Cat. No. 1794-TB3, -TB3S, -TBN, -TBNF
Terminal Base
500V dc
Flexbus Current
Power Supply
Current consumption from external power supply
Power Dissipation
0mA @ 5V dc
12–24V dc (+10%)
150mA @ 12V dc
75mA @ 24V dc
5W maximum @ 26.4V dc
Thermal Dissipation
Indicators (field side driven, logic side indication)
Keyswitch Position
Maximum 17.1 BTU/hr @ 26.4V dc
1 green/red power/status indicator
12 yellow status indicators – logic side
1
Dimensions Inches
(Millimeters)
1.8H x 3.7W x 2.1D
(45.7 x 94.0 x 53.3)
Specifications continued on next page.
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
A–2
Specifications
Specifications – 1794-ID2 2 Input Incremental Encoder Module
Environmental Conditions
Operational Temperature
Storage Temperature
Relative Humidity
Shock Operating
Vibration
0 to 55 o
C (32 to 131 o
F) Note: Do not connect maximum input voltage simultaneously to all inputs if the module ambient temperature is expected to exceed 40 o
C.
–25 to 70 o
C (–13 to 158 o
F)
5 to 90% noncondensing (operating)
5 to 80% noncondensing (nonoperating)
15 g peak acceleration, 11(+1)ms pulse width
Tested 2 g @ 10–500Hz per IEC 68-2-6
Input Conductors
Wire
Category
Length (max)
Agency Certification
(when product is marked)
Belden 8761
2
1
1000ft (304.8m)
•
CUL certified
•
CUL listed – Class I, Division 2
Groups A, B, C, D
•
UL listed
•
CE marked for all applicable directives
Publication 1794-5.63
Installation Instruction
1 Use this conductor category information for planning conductor routing . Refer to publication
1770-4.1, “Industrial Automation Wiring and Grounding Guidelines for Noise Immunity.”
Publication 1794-6.5.15 – December 1998
Index
curent draw, through base units, 2–2
Numbers
1794-ID2, troubleshoot, 8–1
A
adapter input status word, 5–1, 6–3 applications, typical, 1–3
D
daisy–chaining wiring, 2–3 default values, 5–8
DeviceNetManager, software, 5–1
DIN rail mounting, 2–4
B
bit/word definitions, block transfer write, 4–5 bit/Word descriptions, 4–5 bit/word descriptions, block transfer read,
4–3, 5–5, 6–6 block transfer read, 1–2 write, 1–2 block transfer programming
PLC-2 family processor, 3–2
PLC-5 family processor, 3–2 block transfer read, 3–1, 4–2 word assignments, 4–3, 5–4 block transfer write, 3–1 bit/word assignments, 4–5 word assignments, 4–5, 5–4 frequency input module how it works, 1–2 input capabilities, 1–3 typical applications, 1–3 using, 1–1
I
E
European Union Directive compliance, 2–1
F
C
CIOs. See ControlNet I/O Transfer instructions communication, block transfers, 3–1 compatible terminal bases, 2–9 configurable features, 4–1 connecting wiring, 2–9 considerations, pre–installation, 2–1
ControlNet I/O unscheduled non-discrete I/O data transfer, 6–2 unscheduled operations ladder-rung messages, 6–2 messaging from programming devices,
6–2 peer-to-peer messaging, 6–2
I/O, ControlNet unscheduled non-discrete I/O data transfer, 6–2 unscheduled operations messaging from programming devices,
6–2 non-discrete I/O data transfer, 6–2 peer-to-peer messaging, 6–2
I/O module fault, 5–2 indicators states, 2–14 status, 2–14 troubleshooting, 8–1 input mapping, 4–2, 5–3, 6–6 input status word, 5–2, 6–3 installation, module, 2–7
K
keyswitch positions, 2–7
ControlNet I/O Transfer (CIO) instructions,
6–2
Allen-Bradley Motors
Publication 1794-6.5.15 – December 1998
I–2
Index
Publication 1794-6.5.15 – December 1998
L
ladder-rung messaging, 6–2
M
mapping
1794-ID2, 4–2, 5–3, 6–6 example, 6–2 explanation, 6–2
Message instructions, 6–2 module fault, 5–2 module installation, 2–7 mounting, on terminal base, 2–7 mounting kit, cat. no. 1794-NM1, 2–6
MSGs. See Message instructions
O
optimal defaults, 5–8
P
panel/wall mounting, 2–6
PLC-2 family processor, block transfer programming, 3–2
PLC-5 family processor, block transfer programming, 3–2 polled I/O, structure, 5–1, 6–3 power defaults, 5–8
R
removing and replacing, under power
(RIUP), 2–8
S
sample program, PLC-5, 3–2 software, DeviceNetManager, 5–1 status indicators, 2–14 system throughput, 5–3
T
terminal bases, compatible, 2–9 troubleshooting, 8–1
U
unscheduled non-discrete I/O data transfer,
6–2
W
wall/panel mounting, 2–6 wiring, methods of, 2–3 wiring connections, 2–9
1794-ID2, 2–12 word assignments block transfer read, 4–3, 5–4 block transfer write, 4–5, 5–4
Allen-Bradley
Publication Problem Report
If you find a problem with our documentation, please complete and return this form.
Pub. Name
Cat. No.
2 Channel Incremental Encoder Module User Manual
1794-ID2
Pub. No.
1794-6.5.15
Pub. Date
December 1998
Check Problem(s) Type:
Technical Accuracy
Describe Problem(s):
text illustration
Part No.
955131–51A
Internal Use Only
Completeness
What information is missing?
procedure/step example explanation illustration guideline other definition feature info in manual
(accessibility) info not in manual
Clarity
What is unclear?
Sequence
What is not in the right order?
Other Comments
Use back for more comments.
Your Name Location/Phone
Return to: Marketing Communications, Allen-Bradley Co., 1 Allen-Bradley Drive, Mayfield Hts., OH 44124-6118 Phone: (216)646-3176
FAX: (216)646-4320
Allen-Bradley Motors
Publication ICCG-5.21-August 1995 PN 955107-82
Other Comments
PLEASE FASTEN HERE (DO NOT STAPLE)
PLEASE FOLD HERE
BUSINESS REPLY MAIL
FIRST-CLASS MAIL PERMIT NO. 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
1 ALLEN BRADLEY DR
MAYFIELD HEIGHTS OH 44124-9705
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES
Support Services
At Allen-Bradley, customer service means experienced representatives at Customer Support Centers in key cities throughout the world for sales service and support. Our value-added services include:
Technical Support
•
SupportPlus programs
• telephone support and 24-hour emergency hotline
• software and documentation updates
• technical subscription services
Engineering and Field Services
• application engineering assistance
• integration and start-up assistance
• field service
• maintenance support
Technical Training
• lecture and lab courses
• self-paced computer and video-based training
• job aids and workstations
• training needs analysis
Repair and Exchange Services
• your only “authorized” source
• current revisions and enhancements
• worldwide exchange inventory
• local support
Allen-Bradley Motors
Allen-Bradley, a Rockwell Automation Business, has been helping its customers improve productivity and quality for more than 90 years. We design, manufacture and support a broad range of automation products worldwide. They include logic processors, power and motion control devices, operator interfaces, sensors and a variety of software. Rockwell is one of the world’s leading technology companies.
Worldwide representation.
Argentina
•
Australia
•
Austria
•
Bahrain
•
Belgium
•
Brazil
•
Bulgaria
•
Canada
•
Chile
•
China, PRC
•
Colombia
•
Costa Rica
•
Croatia
•
Cyprus
•
Czech Republic
•
Denmark
•
Ecuador
•
Egypt
•
El Salvador
•
Finland
•
France
•
Germany
•
Greece
•
Guatemala
•
Honduras
•
Hong Kong
•
Hungary
•
Iceland
•
India
•
Indonesia
•
Ireland
•
Israel
•
Italy
•
Jamaica
•
Japan
•
Jordan
•
Korea
•
Kuwait
•
Lebanon
•
Malaysia
•
Mexico
•
Netherlands
•
New Zealand
•
Norway
•
Pakistan
•
Peru
•
Philippines
•
Poland
•
Portugal
•
Puerto Rico
•
Qatar
•
Romania
•
Russia–CIS
•
Saudi Arabia
•
Singapore
•
Slovakia
•
Slovenia
•
South Africa, Republic
•
Spain
•
Sweden
•
Switzerland
•
Taiwan
•
Thailand
•
Turkey
•
United Arab Emirates
•
United Kingdom
•
United States
•
Uruguay
•
Venezuela
•
Yugoslavia
Allen-Bradley Headquarters, 1201 South Second Street, Milwaukee, WI 53204 USA, Tel: (1) 414 382-2000 Fax: (1) 414 382-4444
Publication 1794-6.5.15 – December 1998
Supersedes publication 1794-6.5.15 – June 1998
PN 955131–51A
Advertisement