Encoder/Counter Modules - Rockwell...
Transcript of Encoder/Counter Modules - Rockwell...
13
DeviceNet DeviceNetManager and RediSTATION are trademarks of Allen-Bradley Company IncPLC PLCndash2 PLCndash3 and PLCndash5 are registered trademarks of Allen-Bradley Company IncWindows is a trademark of MicrosoftMicrosoft is a registered trademark of MicrosoftIBM is a registered trademark of International Business Machines Incorporated
All other brand and product names are trademarks or registered trademarks of their respective companies
1313
13
Read this preface to familiarize yourself with this manual and tolearn how to use it properly and efficiently
We assume that you have previously used an Allen-Bradleyprogrammable controller that you are familiar with its features andthat you are familiar with the terminology we use If not read theuser manual for your processor before reading this manual
In this manual we refer to
bull the individual encoder counter module as the ldquomodulerdquobull the programmable controller as the ldquocontrollerrdquo or the
ldquoprocessorrdquo
The contents of this manual are as follows
13
$ amp ( ( )
+
- + )
( 0 ((+ ( )((
1 0 ((+ 1 )((
13 ) (( ) )( 2 $ 333
1313
) )
We use these conventions in this manual
) )
)
$
amp
Using This ManualPndash2
1313
Because of the variety of uses for the products described in thispublication those responsible for the application and use of theseproducts must satisfy themselves that all necessary steps have beentaken to assure that each application and use meets all performanceand safety requirements including any applicable laws regulationscodes and standards In no event will Rockwell Automation beresponsible or liable for indirect or consequential damage resultingfrom the use or application of these products
Any illustrations charts sample programs and layout examplesshown in this publication are intended solely for purposes ofexample Since there are many variables and requirements associatedwith any particular installation Rockwell Automation does notassume responsibility or liability (to include intellectual propertyliability) for actual use based upon the examples shown in thispublication
AllenndashBradley publication SGIndash11 Safety Guidelines forApplication Installation and Maintenance of SolidndashState Control(available from your local Rockwell Automation office) describessome important differences between solidndashstate equipment andelectromechanical devices that should be taken into considerationwhen applying products such as those described in this publicationReproduction of the contents of this copyrighted publication inwhole or part without written permission of Rockwell Automationis prohibited
Throughout this publication notes may be used to make you awareof safety considerations The following annotations and theiraccompanying statements help you to identify a potential hazardavoid a potential hazard and recognize the consequences of apotential hazard
WARNING
Identifies information about practices orcircumstances that can cause an explosion in ahazardous environment which may lead topersonal injury or death property damage oreconomic loss
ATTENTION
Identifies information about practices orcircumstances that may lead to personal injury ordeath property damage or economic loss
IMPORTANTIdentifies information that is critical forsuccessful application and understanding of theproduct
13
Using This Manual Pndash3
1313
This preface gave you information on how to use this manualefficiently
amp
Using This ManualPndash4
1313
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
DeviceNet DeviceNetManager and RediSTATION are trademarks of Allen-Bradley Company IncPLC PLCndash2 PLCndash3 and PLCndash5 are registered trademarks of Allen-Bradley Company IncWindows is a trademark of MicrosoftMicrosoft is a registered trademark of MicrosoftIBM is a registered trademark of International Business Machines Incorporated
All other brand and product names are trademarks or registered trademarks of their respective companies
1313
13
Read this preface to familiarize yourself with this manual and tolearn how to use it properly and efficiently
We assume that you have previously used an Allen-Bradleyprogrammable controller that you are familiar with its features andthat you are familiar with the terminology we use If not read theuser manual for your processor before reading this manual
In this manual we refer to
bull the individual encoder counter module as the ldquomodulerdquobull the programmable controller as the ldquocontrollerrdquo or the
ldquoprocessorrdquo
The contents of this manual are as follows
13
$ amp ( ( )
+
- + )
( 0 ((+ ( )((
1 0 ((+ 1 )((
13 ) (( ) )( 2 $ 333
1313
) )
We use these conventions in this manual
) )
)
$
amp
Using This ManualPndash2
1313
Because of the variety of uses for the products described in thispublication those responsible for the application and use of theseproducts must satisfy themselves that all necessary steps have beentaken to assure that each application and use meets all performanceand safety requirements including any applicable laws regulationscodes and standards In no event will Rockwell Automation beresponsible or liable for indirect or consequential damage resultingfrom the use or application of these products
Any illustrations charts sample programs and layout examplesshown in this publication are intended solely for purposes ofexample Since there are many variables and requirements associatedwith any particular installation Rockwell Automation does notassume responsibility or liability (to include intellectual propertyliability) for actual use based upon the examples shown in thispublication
AllenndashBradley publication SGIndash11 Safety Guidelines forApplication Installation and Maintenance of SolidndashState Control(available from your local Rockwell Automation office) describessome important differences between solidndashstate equipment andelectromechanical devices that should be taken into considerationwhen applying products such as those described in this publicationReproduction of the contents of this copyrighted publication inwhole or part without written permission of Rockwell Automationis prohibited
Throughout this publication notes may be used to make you awareof safety considerations The following annotations and theiraccompanying statements help you to identify a potential hazardavoid a potential hazard and recognize the consequences of apotential hazard
WARNING
Identifies information about practices orcircumstances that can cause an explosion in ahazardous environment which may lead topersonal injury or death property damage oreconomic loss
ATTENTION
Identifies information about practices orcircumstances that may lead to personal injury ordeath property damage or economic loss
IMPORTANTIdentifies information that is critical forsuccessful application and understanding of theproduct
13
Using This Manual Pndash3
1313
This preface gave you information on how to use this manualefficiently
amp
Using This ManualPndash4
1313
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
13
Read this preface to familiarize yourself with this manual and tolearn how to use it properly and efficiently
We assume that you have previously used an Allen-Bradleyprogrammable controller that you are familiar with its features andthat you are familiar with the terminology we use If not read theuser manual for your processor before reading this manual
In this manual we refer to
bull the individual encoder counter module as the ldquomodulerdquobull the programmable controller as the ldquocontrollerrdquo or the
ldquoprocessorrdquo
The contents of this manual are as follows
13
$ amp ( ( )
+
- + )
( 0 ((+ ( )((
1 0 ((+ 1 )((
13 ) (( ) )( 2 $ 333
1313
) )
We use these conventions in this manual
) )
)
$
amp
Using This ManualPndash2
1313
Because of the variety of uses for the products described in thispublication those responsible for the application and use of theseproducts must satisfy themselves that all necessary steps have beentaken to assure that each application and use meets all performanceand safety requirements including any applicable laws regulationscodes and standards In no event will Rockwell Automation beresponsible or liable for indirect or consequential damage resultingfrom the use or application of these products
Any illustrations charts sample programs and layout examplesshown in this publication are intended solely for purposes ofexample Since there are many variables and requirements associatedwith any particular installation Rockwell Automation does notassume responsibility or liability (to include intellectual propertyliability) for actual use based upon the examples shown in thispublication
AllenndashBradley publication SGIndash11 Safety Guidelines forApplication Installation and Maintenance of SolidndashState Control(available from your local Rockwell Automation office) describessome important differences between solidndashstate equipment andelectromechanical devices that should be taken into considerationwhen applying products such as those described in this publicationReproduction of the contents of this copyrighted publication inwhole or part without written permission of Rockwell Automationis prohibited
Throughout this publication notes may be used to make you awareof safety considerations The following annotations and theiraccompanying statements help you to identify a potential hazardavoid a potential hazard and recognize the consequences of apotential hazard
WARNING
Identifies information about practices orcircumstances that can cause an explosion in ahazardous environment which may lead topersonal injury or death property damage oreconomic loss
ATTENTION
Identifies information about practices orcircumstances that may lead to personal injury ordeath property damage or economic loss
IMPORTANTIdentifies information that is critical forsuccessful application and understanding of theproduct
13
Using This Manual Pndash3
1313
This preface gave you information on how to use this manualefficiently
amp
Using This ManualPndash4
1313
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
Using This ManualPndash2
1313
Because of the variety of uses for the products described in thispublication those responsible for the application and use of theseproducts must satisfy themselves that all necessary steps have beentaken to assure that each application and use meets all performanceand safety requirements including any applicable laws regulationscodes and standards In no event will Rockwell Automation beresponsible or liable for indirect or consequential damage resultingfrom the use or application of these products
Any illustrations charts sample programs and layout examplesshown in this publication are intended solely for purposes ofexample Since there are many variables and requirements associatedwith any particular installation Rockwell Automation does notassume responsibility or liability (to include intellectual propertyliability) for actual use based upon the examples shown in thispublication
AllenndashBradley publication SGIndash11 Safety Guidelines forApplication Installation and Maintenance of SolidndashState Control(available from your local Rockwell Automation office) describessome important differences between solidndashstate equipment andelectromechanical devices that should be taken into considerationwhen applying products such as those described in this publicationReproduction of the contents of this copyrighted publication inwhole or part without written permission of Rockwell Automationis prohibited
Throughout this publication notes may be used to make you awareof safety considerations The following annotations and theiraccompanying statements help you to identify a potential hazardavoid a potential hazard and recognize the consequences of apotential hazard
WARNING
Identifies information about practices orcircumstances that can cause an explosion in ahazardous environment which may lead topersonal injury or death property damage oreconomic loss
ATTENTION
Identifies information about practices orcircumstances that may lead to personal injury ordeath property damage or economic loss
IMPORTANTIdentifies information that is critical forsuccessful application and understanding of theproduct
13
Using This Manual Pndash3
1313
This preface gave you information on how to use this manualefficiently
amp
Using This ManualPndash4
1313
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
Using This Manual Pndash3
1313
This preface gave you information on how to use this manualefficiently
amp
Using This ManualPndash4
1313
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
Using This ManualPndash4
1313
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
13 (
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 )
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 0 -( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
$-5 5 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13138 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8$( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 +
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
( 0 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 6( 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
)2( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) ( ( 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Table of Contents
amp $
-
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
Table of Contents
1313
13 0
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 1 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2) 1 0 ( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
lt 7$ 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
13 1
2( $ 333 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
6( 5) =7(gt134 134 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1313
) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
2
13
13
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
This publication describes installation adjustments and theprogramming necessary for communication between theEncoderCounter Module (cat no 1771-IJ-IK) and a programmablecontroller processor The programming techniques given here enablethe processor to direct the operation of the encodercounter moduleand to monitor its status
The encodercounter module can be used with any Allen-Bradleyprocessor that uses the 1771 IO structure
Depending on the intended use of the encodercounter module twodifferent programming methods can be used These methods are
bull Single transfer programmingUse single transfer only if the module is in a local IO chassis andgenerally when not using preset words (If using preset wordswith single transfer you must use multiplexing as described insection titled Multiplexing in Chapter 5) If using single transferdisregard chapter 6 on block transfer
bull Block transfer programmingUse block transfer any time If using block transfer disregardchapter 5 on single transfer
The encodercounter module maintains a count independent of theprocessor of input pulses that typically originate from such devicesas quadrature type encoders high speed optical beam counters andcertain types of switches The module (Figure 11) is capable ofmaking decisions based on the count total by comparing it topreviously programmed values and activating either one or both ofits outputs based on the results of the comparison The module canalso return the accumulated count to the processor for arithmeticcomputations or display
The module also provides inputs for a marker signal from an encoderand a voltage level signal from a limit switch to allow for homepositioning In the count mode the direction of the count can bechanged either from the processor or for speed critical application atthe module itself through an external switch The maximumdetectable input pulse frequency of the module is 50kHz
3
3 413
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1ndash2 Introduction
1313
56(7(
8 97 7 (11(-lt=
-9 9$
lt 9)
lt
7 ( +
3
The module will count in either BCD or binary numbers In theBCD mode the range is 000 to 999 with carry and borrow bitsprovided to cascade counters in the program The binary modeallows a higher count total with a range of 0000 to 409510 but thenumber appears at the processor in binary Additionally the modulecan improve the accuracy of certain quadrature type of encoders byadding the count at both channel A and channel B (times 2 mode) orby counting the rising and falling of both channel inputs to give afourfold increase in the count (times 4 mode)
The encodercounter module is available in two versions
bull cat no 1771-IJ - uses a 5V dc external power supply that allowsinputs to be TTL compatible Outputs can either be driven fromthe 5V dc supply through the module or from a separate loadsupply of a different voltage
bull cat no 1771-IK - uses a 12-24V dc external power supply Inputdevices should be compatible with the voltage of the externalpower supply Outputs can be driven either from the externalsupply through the module or from a separate load supply
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1ndash3Introduction
1313
The encodercounter module is shipped with two 12 terminalgold-plated Field Wiring Arms (cat no 1771-WB)
Unless otherwise noted this manual refers to both versions of themodule
There are seven status indicators (Figure 12) on the front of the lefthalf of the module The four indicators corresponding to channel Achannel B marker and switch inputs illuminate when theirrespective input signals are high The next two indicators show thestate of the outputs An output indicator is on when the outputcircuit is activated The bottom indicator illuminates when themodule detects a fault
56(7)
gt 84
1
lt
9)
9)
7
3
When system power is turned on the module runs a self-test Duringpower-up it is normal for the fault indicator to flash on momentarilyIf the FAULT LED does not turn off the module has detected a faultThe self-test includes checks to make sure that all counters andregisters have been reset to zero and memory is cleared If abreakdown of communication occurs during block transfer theFAULT LED will also light Bit 14 the diagnostic bit in the inputstatus word is also set anytime the FAULT LED is on
After power-up the module will stay in its reset state (outputsdisabled and counter held reset) until the necessary control bits areset in the program
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1ndash4 Introduction
1313
System power is supplied through the IO chassis backplane from the5V dc chassis power supply The module requires a current of 14AThe sum of the current requirements of all modules in the chassismust not exceed the power supply or backplane rating
The module requires an external power supply connected to the fieldwiring arm For the 1771-IJ the supply must be able to deliver140mA at 5V dc +025V with less than 50mV ripple peak-to-peakThe 1771-IK requires 110mA at 12V dc or 200mA at 24V dc withless than 50mV ripple peak-to-peak These requirements are for themodule only The current requirements of all output devices if theyare to be driven directly from the module must be added to therequirements of the module
It is also possible to drive output devices from a separate load supplyusing the output on the module only as a switch When the output ison and conducting a maximum of 05V dc is dropped across it Theload supply voltage should not exceed 30V dc Refer to Figure 13for the necessary modifications to the wiring diagram
56(7
13 1313 13 1313amp
lt
lt
9)gt6
6(
2
9)
15944
gtgt
2))$
))$
0
(gt
) A ))4
The power for the input device can be provided by the modulersquosexternal power supply but unlike the power for the output devicethis is not available through the module If a high degree of isolationis needed use a separate input power supply If a limit switch isused the limit switch input is configured to accept an ldquoonrdquo voltageof 12 to 48V dc requiring a maximum of 10mA at 48V dc
amp
8
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
The module has programming options (Table 2A) that are selectedby setting the five switches on the programming option switchassembly (SW-1) These options include the choices betweenencoder and counter operation block transfer or single transfer BCDor binary data formats and count resolution in the encoder mode
6)7
13 amp (
( ) +
(0
0 4)
6
$
10
5
Block transfersingle transfer (switch 1) - Use single transferprogramming only when the module is in a local IO chassis Thistype of programming shifts a single word of data each program scanfrom the processorrsquos data table to the module It therefore takesthree program scans to send a new control word and the two presetvalues to the module However once new data has been sent to themodule it will remain active until another transfer updates it
The input status word will always appear at the proper addresslocation in the input image table To use single transferprogramming switch 1 must be set to single transfer (on)
Block transfer moves all three data words from the processor to themodule in a single scan Since the module has bidirectional blocktransfer the processor must also be programmed to read for blocktransfer or the data table will not display the status word To useblock transfer switch 1 must be set for block transfer (off)
3
2 -
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash2 Preliminary Adjustments
1313
Count resolution (switches 2 and 3) - In the encoder mode theaccuracy of a quadrature type encoder can be improved by allowingthe module to count the pulse trains at both channel inputs Thisdoubles the number of pulses counted for the same degree of rotationat the encoder A further improvement can be made by letting themodule count the leading and trailing edges of both pulse trainsthereby counting four times (times 4) for the same degree of rotationCertain applications may need the actual count and module should beset for times 1 (the pulse is counted on its rising edge as high true)The count resolution setting affects the total count kept at the moduleand as it is sent back in the status word Programming manipulationsof the status word and the preset values must account for themultipliers The count resolution setting may also be limited by theprogram scan time if the carry or borrow bits are used to cascadecounters
Note In the counter mode the count resolution setting (Table 2B)has no effect on the count
6)72
gt
13 )
0 9 9
0 9 9
0 9 9
Encodercounter selection (switch 4) - In the encoder mode themodule counts the number of input pulses entering on channel Afrom a quadrature type encoder By comparing the phaserelationship between input pulses on channel A and pulses appearingat channel B it knows whether to add or subtract the incoming countfrom the total (that is whether to count up or down) The phasing(Figure 21) between the channels is determined by the direction inwhich the encoder is turned To use the module in the encoder modeswitch 4 must be set to encoder (on)
gt
8
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash3Preliminary Adjustments
1313
56)7(
13
0
2
2
2
)
2
2
2
5
15945
In the counter mode the module adds the incoming pulses onchannel A The count is incremented on the rising edge of the pulse(high true) The direction of the count can be controlled with eitherthe control word or an external switch wired to channel B ChannelB must be left unconnected if the count direction is to be softwarecontrolled Typical input device counting might be high speed staticswitches and incremental encoders Mechanical switches are notrecommended as input counting devices used with the 1771-IJbecause the contact bounces might be counted as pulses Howeverthe 1771-IK can be used with a mechanical switch provided themodule is configured for mechanical counting (filter has been put in)and the counting frequency does not exceed 50Hz To use themodule in the counter mode switch 4 must be set to counter (off)
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash4 Preliminary Adjustments
1313
BinaryBCD data format (switch 5) - The preset values and theaccumulated total in the status word have the option of appearing ineither BCD or binary formats If the BCD format is selected theprocessor can directly manipulate these values in comparisons orarithmetic functions but the accumulated value is limited to a countbetween 000 and 999 The binary option allows an increased rangeof 0000 to 409510 With some processors the programming mustreconstruct a BCD number from the binary value To select binarymode set switch 5 on To select BCD mode set switch 5 off
Because different types of input devices are compatible withdifferent voltage ranges the 1771-IJ (5V dc) and 1771-IK (12-24Vdc) input channels are configured differently
Because the 1771-IJ module is designed to work with 5V TTL typedevices each input channel and the marker input can be set forsingle ended or differential line inputs (Table 2C) The input deviceshould be capable of providing 16mA of sink current The moduledetects a voltage of 24V dc or above at either channel as logic ldquo1rdquoor true A voltage below 06V dc is considered as logic ldquo0rdquo or false
6)7
13 amp (11( )
( )
7 2 7
( ( (
5 5 5
The marker input registers as true when the input pulse from theencoder is high
The limit switch input senses a voltage of greater than 10 volts dc aslogic ldquo1rdquo (on) and less than 5 volts dc as logic ldquo0rdquo (off) The inputvoltage that appears through the switch should be from a 12 to 48Vdc external supply capable of supplying 10mA of source current at48V dc The limit switch input has a signal delay of 16ms (+7ms)because of the filtering needed to protect against contact bounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down
2amp-24 4 5
(11(
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash5Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low The gate or switch must sink 14ma ofcurrent to pull the channel B input low The count changes directionin less than 001ms from the time channel B input changes state
The 1771-IK module is designed to accept several types of devicesthat will operate in the 12 to 24V dc range (Figure 22) Since mosthigh voltage quadrature encoder outputs produce signals through anopen collector output the module is configured for a pull-up onchannel B Channel A must be set for a pull-up by setting switch 1on and switch 2 off Some counting devices may also use a pull-uparrangement
56)7)
13 (11(lt 5
amp )
gt
gt
gt
gtgtgtgt)
gt
gt
(
15946
2gtB(
gtgtgtgtgtgtgt7
gt$gt
The settings on the input configuration switch assembly SW-2 arenot the same on the 1771-IJ as they are for 1771-IK Refer toTable 2D for switch settings
(11(lt
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash6 Preliminary Adjustments
1313
6)74
13 amp 9(11(lt= )
( )
) 7 = +C
7 7 7 =8 +C
Certain counting devices may need an input designed to pull currentdown through the device Switch 2 should be set on for pull-downand switch 1 left off The module detects a minimum of 72V dc atits input channels as true for a 12V dc external supply and 144V dcat 24V dc external supply A signal with a maximum voltage of48V dc is considered false for a 12V dc supply and 96V dc is falsefor a 24V dc supply Each input channel sinks 10mA at 12V dc and20mA at 24V dc
If it is necessary to debounce a contact type of device such as aswitch the filter can be added across the inputs by setting switch 3on By adding the filter to the circuit the maximum countingfrequency the module will detect is 50Hz
Channel B input and the marker input are for open collector encoderdrivers (the channel B input has an internal pull-up) and are notswitch selectable The marker input reads a signal as high true
The limit switch input senses a voltage of greater than 10 volts dc asa logic ldquo1rdquo (on) and less than 5 volts dc as a logic ldquo0rdquo (off) Theinput voltage that appears through the switch should be from a 12 to48V dc external supply that is capable of supplying 10mA of sourcecurrent at 48V dc The limit switch input has a signal delay of 16 ms(+7ms) because of the filtering needed to protect against contactbounce
The channel B input can be used in the counter mode to select countdirection If the channel B input terminal is not connected thecontrol word in the output program selects the direction of the countFor external hardware control the count direction bit in the controlword must be set to count up
Then if channel B is allowed to float high or is driven high themodule counts up if it is pulled low either through a gate or atransistor switch it will count down Any gate or switch should becompatible with the external voltage supply (12 to 24V dc)
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash7Preliminary Adjustments
1313
No special filtering is provided on channel B since the filteringnecessary for a mechanical switch would defeat the purpose of a veryfast count direction change that is not dependent on the processorscan time Therefore a transistor switch or gate should be used topull the channel B input low sinking 10mA at 12V dc or 20mA at24V dc The count changes direction in less than 10 microsecondsfrom the time channel B input changes state
Refer to the connection diagrams (Figures 31 and 32) forinterfacing different devices
Switch assembly settings-these features are selected on two switchassemblies that are located on the circuit board underneath thecomponent cover
To select these options proceed as follows
1 Take off the left-side cover by removing the four slotted screws2 Refer to Figure 23 Identify the programming option switch
assembly (SW-1) and the input configuration switch assembly(SW-2)
56)7+
gt
3 13
9977
9 9 7 7
) ($gt
((9)$gt
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
2ndash8 Preliminary Adjustments
1313
3 Set the switches of SW-1 (Table 2E) according to the desiredprogramming options The settings for the count resolutionswitches (times 1 2 or 4) do not matter if the counter mode hasbeen selected The tip of a ball point pen can be used to set therocker arm of a switch Do not use a pencil because the point canbreak off and jam the switch
4 Set the three switches of SW-2 (Table 2E) according to the input configurations that have been chosen
5 Replace the component cover and tighten the screws
6)78
13 amp (
( ) +
(0
0 4)
6
$
10
5
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
ATTENTION
Environment and EnclosureThis equipment is intended for use in a PollutionDegree 2 industrial environment in overvoltageCategory II applications (as defined in IECpublication 60664ndash1) at altitudes up to 2000meters without derating
This equipment is considered Group 1 Class Aindustrial equipment according to IECCISPRPublication 11 Without appropriate precautionsthere may be potential difficulties ensuringelectromagnetic compatibility in otherenvironments due to conducted as well as radiateddisturbance
This equipment is supplied as ldquoopen typerdquoequipment It must be mounted within anenclosure that is suitably designed for thosespecific environmental conditions that will bepresent and appropriately designed to preventpersonal injury resulting from accessibility to liveparts The interior of the enclosure must beaccessible only by the use of a tool Subsequentsections of this publication may contain additionalinformation regarding specific enclosure typeratings that are required to comply with certainproduct safety certifications
See NEMA Standards publication 250 and IECpublication 60529 as applicable for explanationsof the degrees of protection provided by differenttypes of enclosures Also see the appropriatesections in this publication as well as theAllenndashBradley publication 1770ndash41 (ldquoIndustrialAutomation Wiring and Grounding Guidelinesrdquo)for additional installation requirements pertainingto this equipment
The 1771-IJ and 1771-IK are modular components of the 1771 IOsystem and require a properly installed system chassis Refer topublication 1771ndashIN075 for detailed information on acceptablechassis and proper installation and grounding requirements
8
8
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
3ndash2 Installation
1313
ATTENTION Preventing Electrostatic Discharge
This equipment is sensitive to electrostaticdischarge which can cause internal damage andaffect normal operation Follow these guidelineswhen you handle this equipmentbull Touch a grounded object to discharge
potential staticbull Wear an approved grounding wriststrapbull Do not touch connectors or pins on
component boardsbull Do not touch circuit components inside the
equipmentbull If available use a staticndashsafe workstationbull When not in use keep modules in appropriate
staticndashsafe packaging
The module may be placed in any 1771 IO chassis However themodule must only be inserted in a single module group it cannotstraddle two groups To minimize noise group low voltage inputmodules together within a single IO chassis whenever possible
WARNING Remove power from the IO chassis backplane and
wiring arm before removing or installing a modulebull Failure to remove power from the backplane
could cause unexpected machine operation withpossible damage to equipment or injury topersonnel It could also damage the module ordegrade performance
bull Failure to remove power from the wiring armcould damage the module or degradeperformance
Use the proper cable to connect the input devices to the module fieldwiring arm Follow the appropriate connection diagram (Figure 31and Figure 32) Input devices cannot be more than 40 cable feetfrom the module
Use Belden 8761 cable for pulse counter applications with a signalbelow 20K Hz use Belden 9182 cable for frequencies up to 50k HzUse Belden 8725 cabe (4-twisted pair cable) for encoder applicationsbelow 20k Hz
gt
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
3ndash3Installation
1313
567(
4 amp13 (11( 8 1313
1
00lt9)
(
00lt lt9)
00lt lt9 ) 5
= -9 61
B 2
))$
(
) 5
lt
9) D
9)6
3
13
3
13
3
) ) A ))4
B ))$
9) D
E ( 2 ))$ A ))$ ( 44
E 0 ) ( () =4
If you use the limit switch you must use shielded cable such asBelden 8761 or 9182 for cabling
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
3ndash4 Installation
1313
567)
4 amp13 (11(lt 1313
8 4
1
(
B
B
B 2 ))$
(
5
-9 9$
0
lt
33
gt
13
3
13
3
9) D
B
))$ $
) ) A ))4
9) D
E 2 )) A ( ))$ ( 44
E 0 ) ( () =4
lt
lt
The cable has a foil shield with a bare drain wire The drain wireshould be connected to the enclosure ground at an IO chassismounting bolt or stud Connect the drain wire at only one end Thefoil and drain at the other end of the cable which connects to thedevice should be cut short and taped back to insulate it from anyelectrical contact
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
3ndash5Installation
1313
Plastic keying bands provide an easy method for keying an IO slotto accept only one type of module Use of keying bands is stronglyrecommended to prevent accidental insertion of the wrong type ofmodule
The module is slotted in two places on its rear edge The position ofthe keying bands on the backplane connector must correspond tothese slots to allow insertion of the module Because the moduleuses two slots both slots have to be keyed Snap the keying bandson the upper backplane connectors between these numbers printed onthe backplane (Table 3A) Keying is different for the 1771-IJ andthe 1771-IK
67
ltamp
gt
1313
13138
IMPORTANTInsert the module in a single module group (slots0 and 1) It must not straddle two modulegroups
The position of the these keying bands may be changed if subsequentsystem design and rewiring makes insertion of a different type ofmodule necessary
Complete specifications for the 1771-IJ and -IK modules arecontained in Appendix A
ltamp
13
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
3ndash6 Installation
1313
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
Communication between the processor and the encodercountermodule is bidirectional This means that information is transferredto and from the module the processor instructs the module toperform specific functions and may provide values to be comparedon the module and used for output control the module transmits itsaccumulated count and other status information to the processorBecause both input and output data are transmitted between thismodule and the processor special programming techniques are usedto coordinate and control this bidirectional data transfer
Complete 16ndashbit words are transferred between the module and theprocessor The processor sends up to 3 words of data to theencodercounter module
Control wordPreset word 1Preset word 2
These are termed the output words since they are output with respectto the programThe encodercounter module sends a status word to the processor
Figure 41 shows the transfer of output and input words inbidirectional moduleprocessor communication described in thefollowing paragraphs
56+7(
2 -
3-gtAgt4gt4gt1313-8
9)gt
)gt
9)
gt
gtgtgtD
gtgtD
3
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
4ndash2 ModuleProcessor Communication
1313
The program controls encodercounter module operation through theoutput words These words function as follows
bull Control word ndash the control word as its name implies instructs themodule on its operation and on control of its own outputs Bysetting specific control word bits you set up the modulersquos initialmode of operation and can subsequently alter module operationas the application requires
bull Preset words 1 and 2 ndash the optional preset words are values thatcan be used for comparison by the module When these wordsare used the module controls its own output based on comparisonbetween its accumulated count preset values You can use thesewords to direct module control of its own output terminalsindependent of the timing of the processor IO and programscans
Stored in the data table these output words are sent to the module ascontrolled by the program The storage and transmission of thesewords to the module differ depending on whether single transfer orblock transfer programming is used In addition the bitndashbyndashbitsignificance of these words is dependent on the data transfer methodused For this reason specific information on the storage andcomposition of these words is given separately in the followingchapters which describe each programming method
The input status word is the single input word received from theencodercounter module This word has the same format for bothblock and single transfer programming The input status word hasthe format of Figure 42
56+7)
13 2
13 13
gtAgt$gt
gtAgtgt
gtAgt(gtgtFgtgt gtgtFgtgt)
( 5gt5(
=3
5gt5(
=3
lt( 5gt5(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
15951
13A E
1 ) (
) 06
+ 9
13
13
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
4ndash3ModuleProcessor Communication
1313
Bits 00ndash13 of this word show the accumulated count kept by themodule This count may be stored either in BCD form as 000ndash999(decimal) or in 12ndashbit binary form as a binary value from 0000 00000000 to 1111 1111 1111 A switch selection set during moduleinstallation determines the numerical form in which the accumulatedcount is stored
Bits 14ndash17 of this input word serve as status bits Bit 14 thediagnostic bit is set to 1 if the module has detected a fault in its ownoperation normally this bit is 0 Bits 15 and 16 are the carry andborrow bits respectively These bits indicate whether the count hasoverflowed or underflowed
Bit 17 of the input status word is the home bit Three conditions arerequired to set this bit to 1
bull Marker input is highbull Limit switch input is true (high)bull Home latch enable bit is on (1)The marker and limit switch input devices connect to module inputterminals The home latch enable bit is in the control word one ofthe three output words Note that the home bit once set to 1remains 1 until the home latch enable bit is reset to 0
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
4ndash4 ModuleProcessor Communication
1313
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
13
1313
13
Single transfer programming is one method for coordinating andcontrolling bidirectional moduleprocessor communication Thismethod can only be used when the module is in a local IO chassis
Single transfer may be the recommended method even where blocktransfer capability is available Specifically single transferprogramming is suggested whenever preset 1 words and 2 are notused When one or both preset words are used block transfermethods may be more efficient depending on the application
The material for single transfer programming is organized asfollows
bull Section titled Output Words - Single Transfer describes theconfiguration of output words when using single transfermethods
bull Section titled Single Transfer Description gives a generaldescription of how single transfer programming works and anexample for applications where no preset words are required
bull Section titled Multiplexing shows how multiple words of outputdata are multiplexed in single transfer
bull Section titled Example Program - Single Transfer gives asample program for single transfer programming
The output control and preset words have a unique configurationwhen single transfer programming has been selected Initially theprogram must set the bits in these words to the desired combinationfor the application Then using single transfer techniques theprogram sends these output words to the module
13
Figure 51 shows the configuration of the output control word forsingle transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash2 Single Transfer Programming
1313
567(
13 13
gtAgt
gtGgt6gtD
gtFgt6gtD
gtHgt6gtD
gtHgt6gtD
gtFgt6gtD
gtGgt6gtDgt13Agt+ltgtgtFgtgtFgt5
2
((
2
(
5
6Agtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$gt)(gt 4
13A 4 ) 4
A 7 =
A) D F 0 F 7
A) D F 0 F 7
= 9$ A )-5 F ) F 5
A 9) F F 5
3
5662
Bits 14-17 of this word are word select bits These bits must havethe setting shown in Figure 51 to identify the word as the outputcontrol word
Bit 13 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrols module function as follows
1 -The module increments its accumulated count with each countreceived on channel A
0 -The module decrements its accumulated count with each receivedon channel A
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash3Single Transfer Programming
1313
Note that if a device is wired to channel B for external control ofcount direction the updown bit must be set to 1 Count directioncan be externally controlled by using a transistor switch as describedin chapters 2 and 3
Bit 12 is the enable outputs bit The state of this bit controls moduleoutputs as follows
1 -Outputs enabled This means that the output module can beenergized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 12 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset values setby the program
Bits 10 and 11 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting operation of the module to be enabled or reset by theprogram The table in Figure 51 shows the bit settings for eachfunction
Bit 07 is the home latch enable bit
The module resets the count to zero only when all three of theseconditions are true
bull Home latch enable bit (bit 07) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 51
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 07) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe marker input or home limit switch rather than changing bits 11and 10 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash4 Single Transfer Programming
1313
Bits 00-05 are significant only when one or both preset words areused These bits establish the comparison conditions for modulecontrol of its outputs As Figure 51 shows bits 00-02 set upparameters for comparison with preset word 1 bits 03-05 set upparameters for comparison with preset word 2 The module thencontrols its output 1 or 2 based on the true or false comparison ofits accumulated count with these presets
When any of these bits is set to 1 the indicated condition isconsidered by the module as true (that is as a true condition enablingthe module to turn on its output) As Figure 51 shows one bit isused for each comparison parameter less than equal to or greaterthan Note that more than one of these bits can be set to 1 for eachpreset allowing such combinations as less than or equal to greaterthan or equal to or not equal to
In single transfer communication the preset words have the formatof Figure 52 and Figure 53 In this format bits 00-13 store thepreset value When BCD operation has been selected these bits mayrepresent a 3-digit value from 000-999 When 12-bit binaryoperation has been selected the value may range from 0 to 11111111 1111 binary (4095 decimal) A module switch selection madeduring installation selects either BCD or binary mode
567)
A(
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtgtgtgtgtgtgtgt gt$gtgt5gt
gtB
3
13 F A ) D44
5gt5(5gt5(
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash5Single Transfer Programming
1313
567
A)
13 13
( 5gt5(
=3
=3
lt(
=3
Agtgt$gtgt
gtB
3
13 F A ) D44
gtgtgtgtgtgtgtgt gt$gtgt5gt
5gt5(5gt5(
Note that bits 14-17 have a unique coding to identify each presetword
Note If BCD operation has been switch selected only BCD digitsshould be entered in the data table word output to the module Ifnon-BCD digits are entered in a preset value the module sets itsdefault preset value to 000 for the word
Single transfer programming uses the IO scan for bidirectionalmoduleprocessor communication The IO scan is an automaticfunction of the processor during which it performs two operations itwrites output image table data to IO modules and reads IO moduledata into the input image table The write cycle of the IO scan mustbe manipulated by the program for communication with theencodercounter module By this manipulation up to three 16-bitwords are sent to the module by using one output image table wordThe read cycle of the IO scan is also used but is not manipulated bythe program since only a single input status word is read from themodule
413
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash6 Single Transfer Programming
1313
Bidirectional single transfer programming then requires both aninput image table and an output image table word The addresses ofthese image table words depend on the location of the IO module inthe chassis For example for modules in IO rack 1 module group6 the corresponding output image table word is 016 the input imagetable word is 116 Because the encodercounter module occupiesone module group in the IO chassis the processor writes onecomplete 16-bit output image table word to the module and readsone complete 16-bit input image table word from the module duringeach IO scan Figure 54 shows the relationship of module slotplacement to image table location in memory
567+
813 - gt13
13
9)
)
9) =
) 6 gt gtgt=gtgt gt gt gt gt gtgt gtgt gt gt gtgtgt gt
- -9 61 4 ) 4
15955
The input image table word the means for reading data from themodule is updated automatically by the processor each IO scan Toexamine the input status word from the module the program onlyneeds to examine the word stored at the input image table locationcorresponding to the placement of the encodercounter module
The output image table word the means for writing data to themodule is sent by the processor automatically each IO scan Inapplications where only the output control word is used this wordcan be stored directly in the output image table locationcorresponding to the placement of the encodercount moduleSection titled Example Rungs-No Preset Words Used shows thetype of program needed for this type of communication
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash7Single Transfer Programming
1313
However in some applications one or both preset words must beused Here the complication involving the output image table wordis readily apparent it must be used to serve multiple purposes notonly will this word send the output control word it is also needed tosend one or both preset words to the module The use of this wordfor more than one purpose is termed multiplexing For multiplexingprogram manipulation and coordination of the control of the outputimage table word are necessary Sections titled Multiplexing andExample Program - Single Transfer describe multiplexing forsingle transfer communication
813 gt
Figure 55 illustrates a typical example in which bidirectional singletransfer occurs assuming that no preset words are used Thisexample assumes the module placement shown in Figure 54
There is no manipulation of intermediate storage words when onlythe output control word is needed Thus in this instance the bits inthe output image table word corresponding to the module are setdirectly to determine the modulersquos control function In the exampleof Figure 55 rungs 1-3 turn on various bits in the output word Bitsare 0 unless set to 1 by a program instruction Here it is assumedthat no other use is made of word 016
567
813 gt 9 =
13
6(gt
4
13
gtgtgt5Agtgtgtgt5$gt7gt
7
2gt)gtgtB
3
H
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash8 Single Transfer Programming
1313
Rung 4 shows the input status word examined in the user programNote that this word is automatically in the input image table whensingle transfer is selected The processor automatically updates thisword each IO scan
In summary when you are not using preset words you need only setbits of the output image table word which corresponds to the moduleThis word then serves as the output control word However whenusing one or both preset words the output image table word is usedfor multiple purposes and intermediate storage word addresses mustbe used for output control and preset word storage The followingsections outline methods for multiplexing the output words in suchapplications
The processor writes a single word - the output image table word - tothe encodercounter module each IO scan Multiplexing is aprogramming technique by which the processor can share this singleoutput image table word and use it to send multiple words to themodule one word at a time Multiplexing therefore is useful whenone or more preset words are needed
Multiplexing requires an orderly sequencing of events in theprogram The program must coordinate control of the output imagetable word such Multiplexing requires an orderly sequencing ofevents in the program The program must coordinate control of theoutput image table work such that it sends the intended output wordwhether control or preset to the module In this publication a scancounter is used for this coordination While it is not the only methodof control for multiplexing the scan counter is a direct and easilyunderstood method and can be used with any PLC or PLC-2 familyprocessor
To understand the scan counterrsquos function consider how informationmust be transferred to the module In one program scan theprocessor stores the word that is to be sent to the module in theoutput image table word for the module During the very next IOscan the processor automatically outputs the image table word to themodule
Table 5A lists a sequence of operation for single transfer in a typicalapplication showing what must happen at each value of the scancounter This example assumes that both preset words are used Ifonly one of the preset words is needed only counts 1 and 2 of thescan counter are necessary
13
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash9Single Transfer Programming
1313
67
B
C(D 8 -
0 ) )
0 D ) )
0 D ) )
C(D0 ltA lt-A lt-A
lt 4 7 lt A E A A
)$4
The scan counter must indicate that both an IO scan and a programscan have occurred For PLC-2 PLC-215 PLC-220 and PLC-230Processors and the Mini-Processor Module the IO scan andprogram scan because they are sequential are synchronous oneprogram scan occurs for each IO scan This means the scan countercan simply be incremented each program scan Section titled ScanCounter - PLC-2 Family Processors describes a suitable scancounter for these processors
With the PLC processor however the IO scan and program scan areasynchronous this means that the scan counter must be programmedto increment based on the longer of the two scans Section titledScan Counter - PLC Processor describes a suitable scan counterfor these processors
With the sample program following note that the scan counter isprogrammed to run continuously it resets itself when theaccumulated value equals the preset value and begins to count againThis arrangement is normally preferred because it allows subsequentprogrammed changes in bits of the output control word to be sent tothe module as soon as possible after the change is made
) 5amp
Figure 56 shows an example scan counter that can be used for anyPLC-2 family processor This type of scan counter increments witheach program scan Because the IO and program scans of theseprocessors are synchronous each increment of this scan counterindicates that both an IO scan and a program scan have occurred
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash10 Single Transfer Programming
1313
5670
)
0
6
0
6
gt 313
The output instruction of both rungs in Figure 56 is an up-counter(CTU) instruction The first rung since it is unconditional is alwaystrue The second rung since a branch end instruction by itself isalways false sets the conditions for the counter as false Because anup-counter (CTU) increments for each false to true transition CTU030 registers one count each time the program scan occurs
Figure 57 shows an example scan counter that can be used for aPLC processor Because the IO and program scans of this processorare asynchronous this scan counter differs in form and operationfrom the scan counter for PLC-2 processors
5671
0
6
6(
lt
13
13
-
4
3
-
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash11Single Transfer Programming
1313
In order to keep track of both IO and program scans the PLC scancounter rungs manipulate a particular type of memory bit This mustbe a bit in the input image table which is not wired to acorresponding input device so that the bit is turned off each IOscan Choose a bit which satisfies all of the following conditions
bull is in a module group that is scanned immediately after theencodercounter module is scanned
bull is an actual terminal address on an installed input modulebull is off at all timesThe first condition requires a brief knowledge of IO scansequencing The remote IO PLC processor scans IO modules inorder of module group no It first scans module group 0 in all IOracks then module group 1 then 2 and so on Therefore whenselecting an input image table bit for scan counter control choose abit with a greater module group no than the module group no of theencodercounter module If the encodercounter module is placed inmodule group 7 and unused input in module group 0 would beappropriate for this purpose Note that the IO rack number is of noconsequence in selecting this bit
The second condition requires that this input address correspond toan actual input module terminal of the controller
For the third condition it is suggested that the input terminal at theaddress be connected to the L2 (AC low) or DC COMMON terminalon the input module wiring arm This helps prevent the terminalfrom being connected to an input device at some later time
In Figure 57 it is assumed that bit 11111 satisfies all three of theseconditions
The IO scan and program scan both manipulate bit 11111 In rung1 this bit is examined as an input condition for the scan counterWhen this bit is OFF CTU 200 increments When CTU 200increments bit 20017 is set on In rung 2 bit 20017 latches bit11111 on Then in rung 3 bit 20017 is turned off Bit 11111 remainson until the next IO scan With this arrangement CTU 0 cannotincrement until both an IO scan and program scan occur
Note that for the PLC processor two scan counts are used betweeneach step in single transfer as indicated in NO TAG
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash12 Single Transfer Programming
1313
Note In some applications it may be feasible to designate an inputlocation for the purpose of scan counter control In this instance anon-delay timer (TON) instruction can be used to multiplex outputdata to the encodercounter module A timer with 01-secondresolution is acceptable for this purpose Each step of Table 5A canbe programmed to be executed at a 01-second interval from theprevious step
Figure 58 is an example program for single-transfer multiplexing ofoutput words to the encodercounter module This example uses thetype of scan counter recommended for PLC-2 processors Howeverthe general format of these rungs would be the same for a PLCprocessor with addressing differences substitution of the type ofscan counter shown in Figure 57 and other minor changes
567E
813
0
6
0
6
gt
0
0
0
9)
9)gtD
9)
6
gtD
7gtgtltgt)Agtgt gtgtgtgtgtgt(gtAgtgtgt(gt4
6(4
33
F
F
F
06
813
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash13Single Transfer Programming
1313
The following assumptions are made for this sample program
bull Encodercounter module is in IO rack 1 module group 2bull Output control word is stored in word 051bull Preset words 1 and 2 are stored in words 052 and 053
respectivelybull The scan counter is recycled as shown in rung 6 This allows
continuous update of the module should output values be changedby the program
For this example it is assumed that the bit patterns of the outputwords are set up elsewhere in the program
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
5ndash14 Single Transfer Programming
1313
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
13
Block transfer programming is available with all Allen-Bradleyprocessors that use the 1771 IO structure
Block transfer is specifically intended for use with IO modules suchas the encodercounter module that perform more complexoperations than simple onoff input sensing or output switching Forthe operation of such modules multiple words of data must betransferred to or from the processor
Block transfer can be particularly useful with the encodercountermodule when more than one word must be output to the module thatis when one or both preset words are used By using block transferin these applications you can avoid any involvement withmultiplexing techniques for moduleprocessor communicationMultiplexing techniques are used in single transfer programming asdescribed in chapter 5 Note however that single transfertechniques can be the easiest to use in any application where only asingle output control word must be sent to the module For thisreason when not using any of the preset words use single transferprogramming for moduleprocessor communication
The material for block transfer is organized as follows
bull Section titled Output Words - Block Transfer describes theconfiguration of output words when using block transfer
bull Section titled Example Block Transfer Programs describesblock transfer ladder logic for PLC -2 PLC-3 and PLC-5 familyprocessors
The output control and preset words have a unique configurationwhen block transfer programming has been selected Initially theprogram must set the bit combinations of these words to the properarrangement for the application Then through block transfer thesewords are transmitted to the encodercounter module
13
Figure 61 shows the configuration of the output control word forblock transfer By setting bits in this word you set up the initialmode of module operation and change it as required duringoperation
3
13 2
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash2 Block Transfer Programming
1313
5607(
2
EacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacuteEacute
13 13
2
(
2
5
4
6gtgtgtgtgtgt4
6gtgtgtgtgtgt(gt($4
Agtgt2gt)$)(gt 4
65662
7 = 0
A )- F ) F
=( $
A ) 5
A + lt 5
13A 4$ $ (
15960
Bit 04 is the home latch enable bit
The module resets the count to zero when all three of the followingconditions are true
bull Home latch enable bit (bit 04) is set to 1bull Marker input is highbull Home limit switch is closed (limit switch LED is on)The count remains at zero until one or more of these conditions gofalse Then module operation follows the function control bitsdescribed in Figure 61
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash3Block Transfer Programming
1313
The module indicates it has reset its count to zero by setting thehome bit (bit 17 in the input status word) It resets this bit when thehome latch enable bit (bit 04) is reset (Refer to Figure 42 InputStatus Word)
The system can bring the machine back to a repeatable startingposition and the module count can be reset to zero by toggling eitherthe market input or home limit switch rather than changing bits 01and 00 in the control word as long as the three conditions are met
Carry and borrow bits are not affected by resetting the module countThe home limit switch LED turns on whenever the home limitswitch is closed
Bit 03 of this word is the updown bit This bit is significant onlywhen the module is used in the counter mode The state of this bitcontrol module function as follows
1 -The module increments its accumulated count with each pulsereceived on Channel A
0 -The module decrements its accumulated count with each pulsereceived on channel A
Note that if a device is wired to the Channel B input of the modulefor external count direction the updown bit must be set to 1
Bit 02 is the enable outputs bit The status of this bit controlsmodule outputs as follows
1 -Outputs enabled This means that the outputs of the module canbe energized based on logical operations performed by the module
0 -Outputs disabled This means that the outputs of the modulecannot be energized
With bit 02 set to 1 the module can energize its output terminalsbased on a comparison of its accumulated count and preset valuesentered by the program
Bits 00 and 01 are termed function control bits These bits controlmodule function in both encoder and counter modes They permitthe counting function of the module to be enabled or reset by theprogram The table in Figure 61 shows the bit settings for eachfunction
Bits 05-17 of this word are not used by the module and may haveany setting
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash4 Block Transfer Programming
1313
In block transfer communication preset words 1 and 2 have theformat of Figure 62 Here bits 00-13 store the preset value WhenBCD operation has been selected these bits may represent a valuefrom 000-999 When 12-bit binary operation has been selected thevalue may range from 0 to 1111 1111 1111 binary (4095 decimal) Amodule switch selection is made during installation to select eitherBCD or binary mode
5607)
2
13 13
( 5gt5(
=3
=3
lt(
=3
gtB
Agtgt$gtgt
gtGgt6
gtFgt6gtHgt6
gtAgt
15961
13A) B
5gt5(5gt5(
gtgtgtgtgtgtgtgt gt$gtgt5gt
Note If BCD operation has been selected only BCD digits shouldbe entered in the data table word output to the module If non-BCDdigits are entered in a preset value the module sets its default presetvalue to 000 for that word
Bits 15-17 establish the comparison to be made by the modulebetween its accumulated count and each preset value When any ofthese bits are set to 1 the module makes the indicated comparisonbetween its accumulated count and the appropriate preset wordvalue When the comparison is true the corresponding output of themodule may be energized Of course the enable outputs bit in thecontrol word must also be set to 1 for outputs to be energized
As Figure 62 shows one bit is used for each comparison parameterless than equal to or greater than Note that more than one of thesebits can be set to 1 for each preset allowing such combinations asless than or equal to greater than or equal to or not equal to
Bit 14 of each preset word is not used It may be 1 or 0
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash5Block Transfer Programming
1313
Note that there is no identifying bit pattern to distinguish presetwords 1 and 2 from each other The encodercounter moduleidentifies these words by their order of transmission in blocktransfer As these words are stored in memory preset word 1 isstored in the word immediately following the output control wordPreset word 2 is then stored in the word immediately followingpreset word 1
The module communicates with any Allen-Bradley processor thathas block transfer capability The module is a bidirectional blocktransfer module Bidirectional means that the module performs bothread and write block transfer operations You transfer data fromyour module to the processorrsquos data table with a block transfer read(BTR) instruction You transfer data to your module from theprocessorrsquos data table with a block transfer write (BTW) instruction
) 5amp
The following examples use block transfer instructions to performblock transfers However the Mini-PLC-2 (cat no 1772-LN3) andPLC-220 (cat no 1772-LP1-LP2) processors use multiple GETinstructions to perform block transfers Refer to the processor userrsquosmanual for an explanation of multiple GET block transferThe generalized and example programs (Figure 63 and Figure 64)demonstrate the use of a single block transfer read (BTR) and asingle block transfer write (BTW) to pass data between the processorand the module
5607
3F ) 2
0
7gt 5
06
7gt555 5
77
7gt555
57gt777
06
5
gtgtFgtgtgtgtFgtgt 15962
813 2
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash6 Block Transfer Programming
1313
gt 413
Rungs 1 and 2 - These rungs request the block transfer write (BTW)and block transfer read (BTR) operations
Rung 3 - When the processor successfully completes a BTRoperation it sets the done (DN) bit and enables the file-to-file move(FFM) instruction The FFM instruction moves the BTR data file(CCC-DDD) into a storage data file (EEE-FFF) This prevents theprocessor from using invalid data if a block transfer communicationsfault should occur
5607+
813 ) 2
5
13
513
13
5
gt
gt
13
3
lt98gtI76gt60
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt1313
7ltgt09gt7ltgt9B
906gt556E
909E
7ltgtlt0+E
7ltgtE
gtgt
7ltgt6E
60gt6gt
gtgt
lt98gtI76gt65
50gt556E
95ltgt556E
lt98gtlt0+E
7ltE
gtgt
For PLC-2 family processors we recommend that you set the blocklength to zero Then the module determines the number of transferwords The 1771-IJIK defaults to 3 words in a BTW and 1 word ina BTR if you program a block length of zero
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash7Block Transfer Programming
1313
5amp
Use the following ladder logic with PLC-3 or PLC-310 processorsThis program assumes that your application requires a single BTRand BTW instruction to pass data between the processor and themodule
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 65 for generalized ladder logic and to Figure 66 forexample ladder logic with entered values
5607
3F 2
0
6
5
lt(
I96
gtFgt06gt
gtFgt06gt
6gtFgt06gt
I96
gtFgt0gt
gtFgt0gt
6gtFgt0gt
lt
lt
lt
J
gtFgt0gt
gtFgt06gt
06
5
5
6
06
6
5
lt(
lt
5
6
0
5
15045
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash8 Block Transfer Programming
1313
56070
13 2
lt
0
5
6
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
I96
gtgtI96gtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
J
gtEgtgtE
gtEgtgtE
E
gtgtFgtgt
0lt
0lt
0lt
lt
5
6
0lt
0lt
0lt
E
6gt6gt6
6gt6gt6
6gt6gt6
15064
lt98gtI76gt60
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
06
lt98gtI76gt65
68gtgtgtgtgtgtgtgtgtEgtgtgt
69gtgtgtgtgtEgtgtgtgtgtgtgt
95ltgtgtgtEgtgtgt
50Egtgt
lt0+gtgtFgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgtgt
0ltE
gtFgt++
7E
7E
Rung DescriptionsRung 1 - Rung one is true only at power up It uses status word 3bit 03 (the PLC-3rsquos AC power loss bit) to zero the control file of boththe BTR and BTW instructions
Rung 2 - The equal instruction is used at power up At power up theBTR and BTW control files both equal zero so the BTW instructionis enabled
Rung 2 and 3 - During normal program execution the BTW andBTR instructions are alternately executed The done bit of eitherinstruction enables the next block transfer instruction After powerup the BTR and BTW done bits are used to alternate reads andwrites
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash9Block Transfer Programming
1313
5amp
You can use the following ladder logic with PLC-5 processors Thisprogram assumes that your application requires a single BTR andBTW to pass data between the processor and the module
Ladder logic alternates the execution of BTR and BTW instructionsThe processor checks data validity before accepting read data andsets one enable bit at a time
Refer to Figure 67 for generalized ladder logic and to Figure 68 forexample ladder logic with entered values
56071
3F 2
0
06
15047
0
gt1
5gt7 $$$
222
gtgt
06
gt1
5gt7
CCC
gtgt
0
06
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
6ndash10 Block Transfer Programming
1313
5607E
813 2
0
lt98gt0676gt60
61
)
gt1
E
5
5gt7
lt(
E
6
E
E
06
lt98gt0676gt65gt
61
)
gt1
E
5
5gt7
lt(
E
6
7gtAgt6(gt
7gtAgt6(gt
15965
E
E
Rung DescriptionsRungs 0 and 1 - Rungs 0 and 1 execute BTW and BTR instructionsalternately When the processor completes the BTW instruction itenables the BTR instruction immediately in the same scan Enablinga block transfer instruction places the block transfer request inqueue There is one queue for each IO chassis Waiting timedepends on the number of queued requests ahead of it
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
The input Status word stores a maximum count of 999 (BCD) Ifusing binary resolution the maximum count is 1111 1111 1111 (4095binary) To count beyond these full scale values you may want touse either of the following ladder programs for PLCndash2 or PLCndash3family processors
Both programs (Figure 71 and Figure 72) extend the count beyond999 (4095 binary) in the same manner Either program compares thenew count value with the value in the previous scan (old value) Ifthe difference of the new value less the old value is greater than aconstant (a constant less than 9992 or 40952) the count passedthrough zero If the sign of the difference is negative the up counteris incremented by one if positive the down counter is decrementedby one
8
2amp GGG
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
7ndash2 Special Programming
1313
5617(
8 2amp GGG 9) =
1313
1313
0 0
90-8
660
90
6B9
577490
-9lt5
13
1313
gt
13
H
900 577490
-9lt5
K690+69+5
060 6B9 90 769 660 904 096 13134
7 0+ 5776 606 0+ 900 =90 5 0+69+K69A 0+ 60 0+ 904 0+ 900 0 lt 0+ - 0+
090lt 90 97 0+ -8 =+lt7 97 333 96 34
13
1313
gt333
K69 0BBlt5774
50790
706 0+69+ E 7 0+ 97 0+ 5776 0B0+ 60 0+ 90A 7 90B 0+ 560 0+ 904
0+69+5
gt
13
1313
gt333
K69 90BBlt5774
50790
0+69+5
gt
1313
50 90-8
660
90
6B9790
5ltL 0+ 090lt 90 5 9B 0+ 660 90 09 0+ 6B9 90
0
0 0
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
7ndash3Special Programming
1313
5617)
8 2amp GGG 9 =
6 6 69
6 6 6
Mgtgt-gtgtN
E
13
=gtgtgtgt
13
=gtgt5gtgt
=gtgt5gtgt
=gtgt5gtgt
E
13
6 6 6
6 6 6
B
9Bgt0+gt8
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
9B
9Bgt769gtgtgtgt09gtgtgt6
gtgtEgtgtgtE
6gtgtEgtgtgtE
lt
gtgtgtHgtgtgtgt
gtgtEgtgtE
gtgtEgtgtE
gtgtgtgtgtgtFgtgt6
gtgtEgtgtE
gtgtEgtgtE
6gtgtEgtgtE
60
gtgtgtGgtgtgt
gtgtEgtgtE
gtgtEgtgtE
0
906gtgt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
05
906gt59gt
gtgtgtFgtgtgt
gtgtgtFgtgtgtgtgtgtgtgtgtgtgt
9B
gtgtEgtgtE
6gtgtEgtgtE
9Bgt769gtgtgtgt09gtgtgt6
MgtgtgtgtgtN
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
7ndash4 Special Programming
1313
gt 413 95617)=
Rung 0 ndash This rung strips the upper byte of the count value andstores the value
A = BTR statusB = MaskR = Temporary count storage with upper byte removed
A = Temporary count storage with upper byte removedR = New count value
Rung 1 ndash This rung subtracts the old count value from the new valueand stores the difference with its sign
A = New count valueB = Old count valueR = Difference of new count value less old value
Rung 2 ndash This rung looks at the sign and magnitude of the differencefrom rung 1 and compares it with a constant (a constant less than9992 or 40952) If positive the up counter is incremented by oneif negative the down counter is decremented by one
Rung 3 ndash This rung moves the new count value (A) to the old countstorage location (R)
A = New count valueR ndash Old value storage location
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
133
13 (11( lt 8
3 13 13
)=
( =5 =
) 6 8+C 2
5 0 =
( 1
(11(
2 ))$ B A 4B
) 6( B F B B = F 4B B =2 F 4B 5 ( ) 1 4
9) 6( ) ) )) F 2 ) )B F B 2
5) 1313 413 2
0 5) 1313 43 0-
(11(lt
2 ))$ =B2 B ) O 13 29) O 4 2
) 6( H B H B27 B2 F B E B F 134B 2P B F 4B 25 ( ) 1 = 7 B2 F B E B F 4B 2P B F 34B 25 ( ) 1 =
9) 6( ) ) )) 4 F 2 ) )B F B2
5) 13138 4 2
0 5) 13138 4 0-
3 13
lt 4 4 1313 -9
-9 0 B
lt ) B
1) ))$ B 6O
4 $)4 2
) 2 ) ))$
Q B 13 Q B
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
SpecificationsAndash2
133
13 (11( lt 8
1 lt 9) 6 7
8$( 1313
13138
lt E P 6( E P lt E P 6( E P ( () = 4 5 ()4A
9)0)
=0 A 9)( =0 A 9)( 5$ + =0 A 9)( 0 1 deg7 = deg
( 0) =0 A )1(A )( =0 A )1(A )( 5$ + =0 A )1(A )( 0 1 deg7 = deg
6 +$ =0 5A )1(A )( 5) + 3R (
19)()(
13 =0 A )1( 1((
B =0 7A 9)(( Q +C
5 $ 1B (
6 67 $ B- 1+C R +C +CB- +C R R 3+C
70- $ 1B Q 1+C ( )
( 0 $ 1B = )
67 $ B 1+C R 1+C +C
6 ) A = )))
0$) =) $
)
($lt( =2
13 = ) )) 8+CP 3= O ) 8+C 13 = ) )) 8+C
7 ( 4 4 1313
7 ( 0O
133 ) =4413
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
Specifications Andash3
133
13 (11( lt 8
7 ( (C
($
=44 )) (- =4 2
= ) 1
lt lt lt O)
O)
) 3-- 5A) E A A $ A $ A 4--lt4A 6O
01 6 A) -K A
($ )( ( 4 6 ) 13134A S ( ( 4T
1 wwwabcom 5 $A A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
SpecificationsAndash4
133
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
1313A )A
13138A )A
2
)) 1 A ( A
1 ) A ) A
1 )((A 2)A lt 2)A lt 2)A 13lt 2)A 3
A
A )A
A
A
A
4
A
)1313A 13138A A A ) A ) A ( A
8
-A ( )A
- A
2)1 )(A (
) A 13ltA
2 ) OA
A A
) ( A
) A
lt
1$( )A
1$( -9 A
A A
)A
)2(A $ OA
))((A )(( ) A
) A 1 A )A
) A 1 A
)A A
) OA 2A
) A 1 A ( A
)( )A A
)((1 A 2( A 13( A
)(( )A
Index
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
IndexIndash2
1313
A ltA 3
A -A
( A 13
( )A ) A ) A
A
A ) (A (A 13
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
$ 6)
$ ) A ) ) 4
4
4 4 4 4 4 5 4
9= amp13 4 9= amp
)-)
2)
2)
(
=$
2 0 $
)
(U
$
O
( U
U
9
1 4
L lt-
6 E 1( A $ 4A $ 5A $ +4A 9+ E=13
7IE = 4$ 33 313
8
(11( (11(lt (11(028 G101E(E ))
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
9
lt 79lt5 +6
lt
gt6
9B
NO POSTAGE NECESSARY
IF MAILED IN THE
UNITED STATES
BUSINESS REPLY MAILFIRST-CLASS MAIL PERMIT NO 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
TECHNICAL COMMUNICATION1 ALLEN BRADLEY DRMAYFIELD HEIGHTS OH 44124-9705
Indash2
1313
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313
1313
At Allen-Bradley customer service means experienced representatives at CustomerSupport Centers in key cities throughout the world for sales service and support Ourvalue-added services include
1313
bull SupportPlus programsbull telephone support and 24-hour emergency hotlinebull software and documentation updatesbull technical subscription services
8 5
bull application engineering assistancebull integration and start-up assistancebull field servicebull maintenance support
bull lecture and lab coursesbull self-paced computer and video-based trainingbull job aids and workstationsbull training needs analysis
gt13 8
bull your only ldquoauthorizedrdquo sourcebull current revisions and enhancementsbull worldwide exchange inventorybull local support
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
1313 ) ) 131344 $ 3 1313446 33
31313)$( 61 A 4
Introduction_Catagory Types
Print Spec Sheet
JIT Printing Specifications | RA-QR005D-EN-P - 4032009 | ||||||||||||||||||||||||||||||||
Printing Specification | YOUR DATA HERE | Instructions | NO | ||||||||||||||||||||||||||||||
(required) Category | D5 | Select Print Category ABC or D from category list on Introduction_Catagory Types tab | 11rdquo x 17rdquo | LOOSE -Loose Leaf | YES | Pre-sale Marketing | TOP | ||||||||||||||||||||||||||
(required) Finished Trim Size Width | 85rdquo x 11rdquo | 85rdquo x 11rdquo | PERFECT - Perfect Bound | A1 | LEFT | ||||||||||||||||||||||||||||
(required) Publication Number | 1771-UM006B-EN-P | Sample 2030-SP001B-EN-P | 3rdquo x 5rdquo | SADDLE - Saddle Stitch | A2 | RIGHT | CORNER | ||||||||||||||||||||||||||
Use Legacy Number | NO | YES or NO | 18rdquo x 24rdquo Poster | PLASTCOIL - Plastic Coil (Coil Bound) | A4 | BOTTOM | SIDE | ||||||||||||||||||||||||||
Legacy Number if applicable | Sample Legacy Number 0160-533 | 24rdquo x 36rdquo Poster | STAPLED1 -1 position | A3 | |||||||||||||||||||||||||||||
Publication Title | EncoderScanner Modules | Sample ElectroGuard Selling Brief | 36rdquo x 24rdquo Poster | STAPLED1B - bottom 1 position | A5 | ||||||||||||||||||||||||||||
(required) Business Group | Marketing Commercial | As entered in DocMan | 4rdquo x 6rdquo | STAPLED2 - 2 positions | A6 | ||||||||||||||||||||||||||||
(required) Cost Center | 19021 | As entered in DocMan - enter number only no description Example - 19021 | CMKMKE CM Integrated Arch - 19021CMKMKE Market Access Program - 19105 | 475rdquo x 7rdquo (slightly smaller half-size) | THERMAL - Thermal bound (Tape bound) | A7 | |||||||||||||||||||||||||||
BindingStitching | SADDLE - Saddle Stitch | Review key on right | Saddle-Stitch Items All page quantities must be divisible by 420 sheets max on 20 (text and cover) 20 sheets = 80-page pub16 sheets max on 20 (text) and 90 (cover) 16 sheets = 64-page pubPerfect Bound Items475 sheets max on 20 no cover 475 sheets = 950-page pub470 sheets max wcover 90 index unless indicated otherwise) 470 sheets = 940-page pubCoil Bound Items400 sheets max of 20 (if adding cover deduct equivalent number of pages to equal cover thickness) (90 index unless indicated otherwise) 400 sheets = 800-page pubTape Bound Items125 sheets max on 20 no cover 125 sheets = 250-page pub120 sheets max wcover (90 index unless indicated otherwise) 120 sheets = 240-page pubDouble Wire Bound Items250 sheets max on 20 (if adding cover deduct equivalent number of pages to equal cover thickness) (90 index unless indicated otherwise) 250 sheets = 500-page pub | 475rdquo x 775rdquo | THERMALO - Thermal Bound (Tape bound - offline) | A8 | |||||||||||||||||||||||||||
(required) Page Count of Publication | 68 | Total page count including cover | 55rdquo x 85rdquo (half-size) | Wire O - Double Wire Bound (offline) | A9 | ||||||||||||||||||||||||||||
Paper Stock Color | White | White is assumed For color options contact your vendor | 6rdquo x 4rdquo | Post Sale Technical Communication | |||||||||||||||||||||||||||||
Number of Tabs Needed | 5 tab in stock at RR Donnelley | 7385rdquo x 9rdquo (RSI Std) | B1 | ||||||||||||||||||||||||||||||
Stitching Location | Blank Corner or Side | 825rdquo x 10875rdquo | B2 | ||||||||||||||||||||||||||||||
Drill Hole YESNO | NO | All drilled publications use the 5-hole standard 516 inch-size hole and a minimum of frac14 inch from the inner page border | 825rdquo x 11rdquo (RA product profile std) | B3 | |||||||||||||||||||||||||||||
Glue Location on Pad | Glue location on pads | 8375rdquo x 10875 | B4 | ||||||||||||||||||||||||||||||
Number of Pages per Pad | Average sheets of paper 25 50 75100 Max | 9rdquo x 12rdquo (Folder) | B5 | ||||||||||||||||||||||||||||||
Ink Color | One color assumes BLACK 4 color assume CMYK Indicate PMS number herehellip | A4 (8 frac14rdquo x 11 frac34rdquo) (210 x 297 mm) | Catalogs | ||||||||||||||||||||||||||||||
Used in Manufacturing | YES | A5 (583rdquo x 826rdquo) (148 x 210 mm) | C1 | ||||||||||||||||||||||||||||||
Comments | C2 | ||||||||||||||||||||||||||||||||
Part Number | 957678-18 | JIT POD | |||||||||||||||||||||||||||||||
D1 | |||||||||||||||||||||||||||||||||
D2 | |||||||||||||||||||||||||||||||||
D3 | |||||||||||||||||||||||||||||||||
D4 | |||||||||||||||||||||||||||||||||
D5 | |||||||||||||||||||||||||||||||||
D6 | |||||||||||||||||||||||||||||||||
D7 | |||||||||||||||||||||||||||||||||
D8 | |||||||||||||||||||||||||||||||||
D9 |
This tab summarizes Rockwell Automation Global Sales and Marketing preferred printing standards It also provides guidance on whether a publication should be released as JIT (print on demand) or if it requires an RFQ for offset printingFind your publication type in the first section below Use the assigned Printing Category information to determine the standard print specifications for that document type The Printing Categories are defined below the Publication Type section Note there may be slightly different print specifications for the categories depending on the region (EMEA or Americas)For more information on Global Sales and Marketing Printing Standards see publication RA-CO004 in DocMan | |||||||||||||
Publication Type and Print Category | |||||||||||||
Publication Type | Off Set Print Category Spec (See table below) | JIT Spec (See table below) | Description | Order Min | Order Max | Life Cycle Usage Release Option | |||||||
AD | NA - Puttman | NA | Advertisement Reprint Colour | NA | NA | Presale Internal | |||||||
AP | A3 | D2 | Application Solution or Customer Success Story | 5 | 100 | Presale External | |||||||
AR | NA | NA | ArticleEditorialByline | NA | NA | Presale Internal | |||||||
News Release (press releases should not be checked into DocMan or printed) | |||||||||||||
AT | B3 B4 | D5 | Application Techniques | 5 | 100 | Presale External | |||||||
BR | A2 Primary A1 | NA | Brochures | 5 | 100 | Presale External | |||||||
CA | C2 Primary C1 | NA | Catalogue | 1 | 50 | Presale External | |||||||
CG | NA | NA | Catalogue Guide | 1 | 50 | Presale External | |||||||
CL | NA | NA | Collection | 5 | 50 | Presale External | |||||||
CO | A5 A6 A9 | D5 | Company Confidential Information | NA | NA | NA Confidential | |||||||
CP | E-only | E-only D5 | Competitive Information | 5 | 50 | NA Confidential | |||||||
DC | E-only | E-only | Discount Schedules | NA | NA | Presale Internal | |||||||
DI | A1 A3 | NA | Direct Mail | 5 | 100 | Presale Internal | |||||||
DM | NA | NA | Product Demo | 5 | 50 | Presale Internal | |||||||
DS | B3 | D5 | Dimensions Sheet | 1 | 5 | Post External | |||||||
DU | B3 | D5 | Document Update | 1 | 5 | Post External | |||||||
GR | B2 | D6 | Getting Results | 1 | 5 | Post External | |||||||
IN | B3 | D5 | Installation instructions | 1 | 5 | Post External | |||||||
LM | NA | NA | Launch KitMaterials | 5 | 50 | Presale Internal | |||||||
PC | B3 | D5 | Packaging Contents | ||||||||||
PL | E-only Primary B3 | E-only | Price List | 5 | 50 | Presale Internal | |||||||
PM | B2 | D6 | Programming Manual | 1 | 5 | Post External | |||||||
PP | A3 | D1 | Product Profile NOTE Application Solutions are to be assigned the AP pub type | 5 | 100 | Presale External | |||||||
QR | B2 Primary B3 B5 | D5 D6 | Quick Reference | 1 | 5 | Post External | |||||||
QS | B2 Primary B3 B5 | D5 D6 | Quick Start | 1 | 5 | Post External | |||||||
RM | B2 | D5 D6 | Reference Manual | 1 | 5 | Post External | |||||||
RN | B3 | D5 | Release Notes | 1 | 5 | Post External | |||||||
SG | B1 Primary B4 | D5 D6 | Selection Guide Colour | 5 | 100 | Presale External | |||||||
SG | B2 | D5 D6 | Selection Guide BW | 5 | 100 | Presale External | |||||||
SP | A1 A2 A3 A4 | NA | Service ProfileSales Promotion NOTE Service profiles are to be assigned the PP pub type | 5 | 100 | Presale Internal | |||||||
SR | B2 B3 | D5 D6 | Specification Rating Sheet | 5 | 100 | Presale External | |||||||
TD | B2 Primary B3 B4 B5 | D5 D6 | Technical Data | 5 | 100 | Presale External | |||||||
TG | B2 B3 | D6 | Troubleshooting Guide | 1 | 5 | Post External | |||||||
UM | B2 Primary B4 | D6 | User Manual BW | 1 | 5 | Post External | |||||||
WD | B3 | D5 | Wiring Diagrams Dwgs | 1 | 5 | Post Internal | |||||||
WP | B3 Primary B5 | D5 | White Paper | 5 | 100 | Presale External | |||||||
Pre-sale Marketing | All paper in this category is White Brightness 85 or better Opacity 87 or better | ||||||||||||
Category | Color Options | AP EMEA Paper Requirements | Canada LA US Paper Requirements | ||||||||||
A1 | 4 color | 170gsm 2pp | 100 gloss cover 100 gloss text | ||||||||||
A2 | 4 color | 170gsm folded 4pp | 100 gloss cover 80 gloss text | ||||||||||
A3 | 4 color | Cover 170gsm with Body 120gsm gt 4pp | 80 gloss cover 80 gloss text | ||||||||||
A4 | 2 color | 80 gloss cover 80 gloss text | |||||||||||
170gsm Silk ndash 120gsm Silk | |||||||||||||
A5 | 2 color | 80 gloss cover 80 matt sheet text | |||||||||||
170gsm Silk ndash 120gsm Silk | |||||||||||||
A6 | 1 color | 170gsm Silk ndash 120gsm Silk | 80 gloss cover 80 matt sheet text | ||||||||||
A7 | 4 color cover | 10 Point Cover C2S | |||||||||||
2 color text | Category being deleted | 50 matte sheet text | |||||||||||
Selection Guide | |||||||||||||
A8 | 4 color cover | Category being deleted | 50 matte sheet text self cover | ||||||||||
2 color text | |||||||||||||
Selection Guide | |||||||||||||
A9 | 2 color | 100gsm bond | 50 matte sheet text self cover | ||||||||||
Selection Guide | |||||||||||||
Post Sale Technical Communication | |||||||||||||
Category | Color Options | AP EMEA Paper Requirements | Canada LA US Paper Requirements | ||||||||||
B1 | 4 color cover | 270gsm Gloss 100gsm bond | 10 Point Cover C2S | ||||||||||
2 color text | 50 matte sheet text | ||||||||||||
B2 | 1 color | 60 Cover | |||||||||||
160gsm Colortech amp 100gsm Bond | 50 matte sheet text | ||||||||||||
B3 | 1 color | 50 matte sheet text self cover | |||||||||||
100gsm bond | |||||||||||||
B4 | 2 color | 60 Cover | |||||||||||
160gsm Colortech amp 100gsm Bond | 50 matte sheet text | ||||||||||||
B5 | 2 color | 50 matte sheet text self cover | |||||||||||
100gsm bond | |||||||||||||
Catalogs | |||||||||||||
Category | Color Options | AP EMEA Paper Requirements | Canada LA US Paper Requirements | ||||||||||
C1 | 4 color cover | 270gsm Gloss 90gsm silk | 10 Point Cover C2S | ||||||||||
4 color text | 45 Coated Sheet | ||||||||||||
C2 | 4 color cover | 270gsm Gloss 80gsm silk | 10 Point Cover C2S | ||||||||||
2 color text | 32-33 Coated Sheet | ||||||||||||
JIT POD | |||||||||||||
Category | Color Options | AP EMEA Paper Requirements | Canada LA US Paper Requirements | ||||||||||
D1 | 4 color | 170gsm white silk | 80 gloss cover coated 2 sides | ||||||||||
D2 | 4 color | 120gsm white silk | 80 gloss text coated 2 sides self cover | ||||||||||
D3 | 4 color | Cover 170gsm with Body 120gsm | 80 gloss cover 80 gloss text coated 2 sides | ||||||||||
D4 | 1 color | 160gsm tab | 90 index | ||||||||||
D5 | 1 color | 80gsm bond | 20 bond self cover | ||||||||||
D6 | 1 color | Cover 160gsm tab with Body 80gsm bond | 90 index 20 bond | ||||||||||
D7 | 2 color | 160gsm tab | 90 index | ||||||||||
D8 | 2 color | 80gsm bond | 20 bond self cover | ||||||||||
D9 | 2 color | Cover 160gsm tab with Body 80gsm bond | 90 index 20 bond | ||||||||||
D10 | Combination 4 color cover with 2 color body | Cover 160gsm with Body 80gsm | 90 index 20 bond |
Print Spec Sheet
JIT Printing Specifications | RA-QR005D-EN-P - 4032009 | ||||||||||||||||||||||||||||||||
Printing Specification | YOUR DATA HERE | Instructions | NO | ||||||||||||||||||||||||||||||
(required) Category | D5 | Select Print Category ABC or D from category list on Introduction_Catagory Types tab | 11rdquo x 17rdquo | LOOSE -Loose Leaf | YES | Pre-sale Marketing | TOP | ||||||||||||||||||||||||||
(required) Finished Trim Size Width | 85rdquo x 11rdquo | 85rdquo x 11rdquo | PERFECT - Perfect Bound | A1 | LEFT | ||||||||||||||||||||||||||||
(required) Publication Number | 1771-UM006B-EN-P | Sample 2030-SP001B-EN-P | 3rdquo x 5rdquo | SADDLE - Saddle Stitch | A2 | RIGHT | CORNER | ||||||||||||||||||||||||||
Use Legacy Number | NO | YES or NO | 18rdquo x 24rdquo Poster | PLASTCOIL - Plastic Coil (Coil Bound) | A4 | BOTTOM | SIDE | ||||||||||||||||||||||||||
Legacy Number if applicable | Sample Legacy Number 0160-533 | 24rdquo x 36rdquo Poster | STAPLED1 -1 position | A3 | |||||||||||||||||||||||||||||
Publication Title | EncoderScanner Modules | Sample ElectroGuard Selling Brief | 36rdquo x 24rdquo Poster | STAPLED1B - bottom 1 position | A5 | ||||||||||||||||||||||||||||
(required) Business Group | Marketing Commercial | As entered in DocMan | 4rdquo x 6rdquo | STAPLED2 - 2 positions | A6 | ||||||||||||||||||||||||||||
(required) Cost Center | 19021 | As entered in DocMan - enter number only no description Example - 19021 | CMKMKE CM Integrated Arch - 19021CMKMKE Market Access Program - 19105 | 475rdquo x 7rdquo (slightly smaller half-size) | THERMAL - Thermal bound (Tape bound) | A7 | |||||||||||||||||||||||||||
BindingStitching | SADDLE - Saddle Stitch | Review key on right | Saddle-Stitch Items All page quantities must be divisible by 420 sheets max on 20 (text and cover) 20 sheets = 80-page pub16 sheets max on 20 (text) and 90 (cover) 16 sheets = 64-page pubPerfect Bound Items475 sheets max on 20 no cover 475 sheets = 950-page pub470 sheets max wcover 90 index unless indicated otherwise) 470 sheets = 940-page pubCoil Bound Items400 sheets max of 20 (if adding cover deduct equivalent number of pages to equal cover thickness) (90 index unless indicated otherwise) 400 sheets = 800-page pubTape Bound Items125 sheets max on 20 no cover 125 sheets = 250-page pub120 sheets max wcover (90 index unless indicated otherwise) 120 sheets = 240-page pubDouble Wire Bound Items250 sheets max on 20 (if adding cover deduct equivalent number of pages to equal cover thickness) (90 index unless indicated otherwise) 250 sheets = 500-page pub | 475rdquo x 775rdquo | THERMALO - Thermal Bound (Tape bound - offline) | A8 | |||||||||||||||||||||||||||
(required) Page Count of Publication | 68 | Total page count including cover | 55rdquo x 85rdquo (half-size) | Wire O - Double Wire Bound (offline) | A9 | ||||||||||||||||||||||||||||
Paper Stock Color | White | White is assumed For color options contact your vendor | 6rdquo x 4rdquo | Post Sale Technical Communication | |||||||||||||||||||||||||||||
Number of Tabs Needed | 5 tab in stock at RR Donnelley | 7385rdquo x 9rdquo (RSI Std) | B1 | ||||||||||||||||||||||||||||||
Stitching Location | Blank Corner or Side | 825rdquo x 10875rdquo | B2 | ||||||||||||||||||||||||||||||
Drill Hole YESNO | NO | All drilled publications use the 5-hole standard 516 inch-size hole and a minimum of frac14 inch from the inner page border | 825rdquo x 11rdquo (RA product profile std) | B3 | |||||||||||||||||||||||||||||
Glue Location on Pad | Glue location on pads | 8375rdquo x 10875 | B4 | ||||||||||||||||||||||||||||||
Number of Pages per Pad | Average sheets of paper 25 50 75100 Max | 9rdquo x 12rdquo (Folder) | B5 | ||||||||||||||||||||||||||||||
Ink Color | One color assumes BLACK 4 color assume CMYK Indicate PMS number herehellip | A4 (8 frac14rdquo x 11 frac34rdquo) (210 x 297 mm) | Catalogs | ||||||||||||||||||||||||||||||
Used in Manufacturing | YES | A5 (583rdquo x 826rdquo) (148 x 210 mm) | C1 | ||||||||||||||||||||||||||||||
Comments | C2 | ||||||||||||||||||||||||||||||||
Part Number | 957678-18 | JIT POD | |||||||||||||||||||||||||||||||
D1 | |||||||||||||||||||||||||||||||||
D2 | |||||||||||||||||||||||||||||||||
D3 | |||||||||||||||||||||||||||||||||
D4 | |||||||||||||||||||||||||||||||||
D5 | |||||||||||||||||||||||||||||||||
D6 | |||||||||||||||||||||||||||||||||
D7 | |||||||||||||||||||||||||||||||||
D8 | |||||||||||||||||||||||||||||||||
D9 |