The text of a manual · part 5 of 9
Analog Output Module User Manual (Cat. No. 1771-OFE Series B), pages 41 to 50
Pages 41 to 50 of 84
The original document is the PDF (555 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1771-OFE1
Page 41
4-5
Table 4.B PLC-2 Family Data Table Word ALLEN-BRADLEY Programmable Controller DATA TABLE WORD ASSIGNMENTS (64-WORD) PROJECT NAME
OFE PROGRAM
DESIGNER
WORD ADDR
Comments:
PAGE ADDRESS PROCESSOR
2
OF TO
2
PLC-2 FAMILY & PLC-3
DATA TABLE SIZE
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
DESCRIPTION CH 1 DATA CH 2 DATA CH 3 DATA CH 4 DATA 0100 0 4095 0 4095 20 275 100 500
WORD ADDR
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
DESCRIPTION
Block length for block transfer write is 00. Unscaled channels have a minimum scaling value of 0 and a maximum scaling value of 4095. If channels 1 and 2 were configured for + 10V operation, then the minimum scaling value would be -4095 and the maximum scaling value would be +4095. Since channel 3 has a negative minimum scaling value, you must set the polarity bit (bit 10) associated with channel 3’s minimum scaling word in the configuration word (word 5 of the write block). 12891
Publication 1771-6.5.30 - November 1998
Page 42
4-6
Figure 4.3 Binary Configuration Word Represented in BCD Channel 3 Minimum Scaling Factor Polarity Set (1) = Negative Reset (0) = Positive Word/Dec. Bit
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
Word/Octal Bit
17
16
15
14
13
12
11
10
07
06
05
04
03
02
01
00
Word 5
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
Binary
BCD 12892
Block Transfer Programming Ć PLC-3 Family Processors Only
Block transfer operation with the PLC-3 processor uses one binary file in a data table section for module location and other related data. This is the block transfer control file. The block transfer data file stores data that you want transferred to your module (during block transfer write) or from your module (block transfer read). The address of the block transfer data file is stored in the block transfer control file. A sample program segment is shown in Figure 4.4 and described in the following paragraphs. The industrial terminal prompts you to create a control file when either block transfer instruction is entered. The same block transfer control file is used for both read and write instructions for your module. PLC-3 Example Program
Publication 1771-6.5.30 - November 1998
Module Location
Rack 1, Module Group 0, Slot 1
Block Transfer Control File
FB1:0
BTW File (Configuration file)
FB2:1
BTR File (Buffer file)
FB3:1
Output Data File
FB4:1
Storage Bit
B0/0
BTW Done Bit
B1:0/05
BTR Done Bit
B1:0/15
Module Configuration
1771-OFE1 (Voltage Version)
Voltage Range
1 to 5V
Data Format
BCD
Scaling Parameters
Channels 1 and 2 = No scaling Channel 3 = Ć20 to 275 Channel 4 = 100 to 500
Page 43
4-7
Figure 4.4 PLC-3 Sample Program Structure Program Action Upon completion of a successful read block transfer, data from the module is moved from the buffer file (block transfer read file) to a storage data file. This prevents the module from using invalid data should block transfer communications fail. At powerĆup, the program performs a write block transfer that configures the module. When the first write block transfer is complete, the program toggles between read and write block transfers. The program takes into account that the read and write request bits cannot be set simultaneously. Rungs 1 and 2 The first two rungs of the sample program segment toggle requests for the read and write instructions. Notice that the EXAMINE ON instructions in Rungs 1 and 2 are the done bits of the read and write instructions. By latching or unlatching a storage bit, the write done bit (XXXXX:XXXX/05) triggers the BTR instruction and the read done bit (XXXXX:XXXX/15) triggers the BTW instruction.
1
2
3
Rung 3 The write block transfer instruction in Rung 3 sends configuration, output, and scaling data to the module from the processor in one program scan. Rung 4 The read block transfer instruction in Rung 4 sends module status information and a copy of the output data to the processor from the module in one program scan. Rung 5 When a read block transfer has been successfully completed, its done bit is set. When the done bit (XXXXX:XXXX/15) is set, it enables the fileĆtoĆfile move instruction. The read block transfer data file (buffer) is then moved into a storage data file. This prevents the processor from transmitting invalid data should a block transfer communication fault occur.
4
5
Write Block Transfer Done Bit
Storage Bit L
Read Block Transfer Done Bit
Storage Bit U
Storage Bit
Storage Bit
Read Block Transfer Done Bit
BTW BLOCK XFER WRITE Rack Addrress: Group Address: Module Address: Data Address: Length: CNTL:
xxx x xxxxxx xxxxx:xxxx x xxxxx:xxxx
BTR BLOCK XFER READ Rack Address: Group Address: Module Address: Data Address: Length: CNTL:
xxx x xxxxxx xxxxx:xxxx x xxxxx:xxxx
FILES FROM A TO R File A: File R: Counter Address: Position/Length: Mode:
xxxxx:xxxx xxxxx:xxxx xxxxx 0/x All/Scan
Enable EN 02 Done DN 05 Error ER 03 Enable EN 12 Done DN 15 Error ER 13 Enable EN 12 Done DN 15 Error ER
Publication 1771-6.5.30 - November 1998
Page 44
4-8
Figure 4.5 PLC-3 Example Program
Rung Number RM0
Rung Number RM1
Rung Number RM2
FB001:0000
B0000 L 00
05 FB001:0000 15
BTW BLOCK XFER WRITE Rack Address: Group Address: Module Address: Data Address: Length: CNTL:
B0000 00
Rung Number RM3
BTR BLOCK XFER READ Rack Address: Group Address: Module Address: Data Address: Length: CNTL:
B0000 00
001 0 1 = High FB002:0001 0 FB001:0000
B0000 U 00 CNTL LE 02 CNTL DN 05 CNTL ER 03
CNTL LE 12 CNTL DN 15 CNTL ER 13
001 0 1 = High FB003:0001 0 FB001:0000
Table 4.C PLC-3 Data Table Word Assignments for Example 1 Start = FB002:0000 Word #
0
1
2
3
4
5
6
7
00000
0000
2048
1024
0150
0350
0100
0000
4095
00008
0000
4095
0020
0275
0100
0500
Block Transfer Programming Ć PLC-5 Family Processors Only
The PLC-5’s bidirectional program is very simple because the processor handles the enable bits and ensures valid data. Two examples are shown. The first is a write-only program you can use when module status is not required. The second is a read/write program. Important:
Publication 1771-6.5.30 - November 1998
If the 1771-OFE module is configured in BCD data format and you are using a PLC-5 processor, extra programming will have to be added to the ladder program (i.e. a CPT or TOD instruction) to convert binary data to BCD data before it is transferred to the 1771-OFE module’s block transfer write data file. Also, when checking your program’s operation, remember to verify proper output voltage/current values based on the data values sent to the module.
Page 45
4-9
Figure 4.6 PLC-5 Example Program 1 Program Action (Example 1) Rung 1 1 The BTW is writing in an mode. As soon as the instruction executes, it is reenabled for another transfer. Instruction execution could also be scheduled using a timer done bit or some other input condition.
BTW
BLOCK XFER WRITE Rack Address: Group Address: Module Address: Control Block: Data File: Length: Continuous:
N10:0 15
Module Location
0 0 0 N10:0 N10:5 13 N
EN DN ER
Rack 0, Module Group 0, Slot 0
File Configuration Control Array
N10:0
Data File
N10:5
Configuration Word
N10:9
Enable Bit
N10:0/15
Figure 4.7 PLC-5 Example Program 2 Program Action (Example 2) Rung 1 1 The enable bits of both instructions alternate execution between rungs. This rung is executed first. When the BTR is done, both enable bits are off until the next rung is scanned at which time the BTW is enabled. Rung 2 The BTW is writing in an 2 mode. As soon as the instruction executes, it is reenabled for another transfer. Instruction execution could also be scheduled using a timer done bit or some other input condition.
N10:0
N11:0
15
15
N10:0
N11:0
15
15
BTR BLOCK XFER READ Rack Address: Group Address: Module Address: Control Block: Data File: Length: Continuous:
0 0 0 N11:0 N11:5 5 N
BTW BLOCK XFER WRITE Rack Address: Group Address: Module Address: Control Block: Data File: Length: Continuous:
0 0 0 N10:0 N10:5 13 N
Module Location
Rack 0, Group 0, Slot 0
File Configuration
BTR
Control Array
N11:0
Data File
N11:5
Output Data Image
N11:5 through N11:8
Status Word
N11:9
Enable Bit
N11:0/15
File Configuration
BTW
Control Array
N10:0
Data File
N10:5
Configuration Word
N10:9
Enable Bit
N10:0/15
EN DN ER
EN DN ER
Publication 1771-6.5.30 - November 1998
Page 46
4-10
Other Programming Considerations
When writing your program, there are some additional programming techniques that you should consider. They are:
• • • • • block length and scaling considerations block transfer boundary word - PLC-2 family processors module update time buffering data - PLC-2 family processors only system expansion recommendations
Block Length and Scaling Considerations There are three possible write block configurations that involve scaling:
• no channels scaled • fewer than four channels scaled • all four channels scaled No Channels Scaled If you do not wish to scale any of your data, you can enter a block length of five words in the write block transfer instruction. The bit that indicates BCD or 12-bit binary data format (Bit 17) in Word 5, the module configuration word, is the only bit in Word 5 that is examined by the module. The remaining bits (00-16) are ignored by the module because these bits indicate scaling value polarity and data polarity. The module does not acknowledge negative data unless scaling is used. Fewer than Four Channels Scaled To scale only one, two, or three of the four channels, enter a block length of 00 and enter the appropriate scaling values for the channels to be scaled. You must enter 0 or -4095 for the minimum scaling value and +4095 for the maximum scaling value for any unscaled channels, depending on the range selected.
Page 47
4-11
All Four Channels Scaled To scale all four channels, enter a block length of 00 and enter the appropriate scaling values for the four channels, as shown in the following table. If You Want
No Channels Scaled
Fewer than Four Channels Scaled
All Four Channels Scaled
And Channel Is Configured for:
Then Enter:
+10V, 0-10V, 1-5V, 4-20 mA, 0-50mA
A Block Length of 5 No Scaling Information
+10V
A Block Length of 00 Appropriate Scaling Values Ć4095 Minimum Scaling Value and +4095 Maximum Scaling Value for Unscaled Channel(s)
0-10V, 1-5V, 4-20 mA, 0-50mA
A Block Length of 00 Appropriate Scaling Values 0 Minimum Scaling Value and 4095 Maximum Scaling Value for Unscaled Channels
+10V, 0-10V, 1-5V, 4-20 mA, 0-50mA
A Block Length of 00 Appropriate Scaling Values
Block Transfer Boundary Word Ć PLC-2 Family Processors Only The purpose of the boundary word is to tell the processor not to search for additional block transfer addresses. You set the boundary word by entering one word (16 bits) of zeros in the timer/counter accumulated value area of the data table, after the word containing the last block transfer module address. For example, if the last block transfer data address in the accumulated value area of the data table is 035, the block transfer boundary word is addressed as 036. Figure 4.8 shows the data table structure and a sample GET/PUT instruction used to program a block transfer boundary word.
Publication 1771-6.5.30 - November 1998
Page 48
4-12
Figure 4.8 Data Table Structure and GET/PUT Instruction Example for Block Transfer Boundary Word
Timer/Counter Accumulated Values Area
030 First Block Transfer Data Address 031 032 033 034 035 Last Block Transfer Data Address 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 036 Address of Block Transfer Boundary W 037 Beginning Address for Timer/Counter S
Block Transfer Boundary Word Instruction 036 G 000
Publication 1771-6.5.30 - November 1998
036 PUT 000
12
Page 49
4-13
Module Update Time Update time is defined as the amount of time it takes for the output module to receive a block transfer scan and update all output channels. Refer to Figure 4.9. The output module updates the four output channels in:
• 8 milliseconds when BCD data format and scaling are used • 1.6 milliseconds when binary data format and no scaling are used Block transfer from the processor is inhibited during this time span. Figure 4.9 Module Output Update Time Y
Y
Y
Legend: X = Block Transfer inhibited while update is being completed for 8 milliseconds with BCD and scaling, 1.6 milliseconds with binary and no scaling
X
X
Y = Block transfer enabled 12896
System Expansion Recommendations Ć PLC-2 Processors Only
Chapter Summary
If you plan to add more block transfer modules to your system at some future date, we recommend that you reserve a few words in the first available time/counter value area of the data table for block transfer addresses. This eliminates the need to reconfigure your data table.
In this chapter you learned how to write data to the module, the data formats used for block transfer, special programming techniques, and were given sample program examples.
Publication 1771-6.5.30 - November 1998
Page 50
Publication 1771-6.5.30 - November 1998