Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 6 of 14

Analog Input Module, Cat. No. 1771-IFE, User Manual: 3 - Module Programming

Pages 25 to 29 of 63, from Analog Input Module, Cat. No. 1771-IFE, User Manual

The original document is the PDF (516 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-IFE

Page 25

Chapter

3

Module Programming

Chapter Objectives

In this chapter we describe: block transfer programming sample programs in the PLC-2, PLC-3 and PLC-5 processors module scan time issues

Block Transfer Programming

Your module communicates with your processor through bidirectional block transfers. This is the sequential operation of both read and write block transfer instructions. The block transfer write (BTW) instruction is initiated when the analog module is first powered up, and subsequently only when the programmer wants to write a new configuration to the module. At all other times the module is basically in a repetitive block transfer read (BTR) mode. The application programs for the three processor families were written to accomplish this handshaking in the described manner. They are minimum programs; all the rungs and conditioning must be included in your application program. If you wish to disable BTRs for any reason, or add interlocks to the BTW rung to prevent writes from happening at certain times, you are allowed to do it. You may not eliminate any storage bits or interlocks that are included in our examples. If interlocks are removed, the program may not work properly. The analog input module will work with a default configuration of zeroes entered in all five words of a five word BTW configuration block. See the configuration default section to understand what this configuration will look like. Also, refer to Appendix B for example configuration blocks and instruction addresses to get started.

ATTENTION: In PLC-2 family processors you must not enable both the read and write instructions at the same time. Undesirable data could transfer, resulting in unpredictable machine operation. Using the prescribed programs will prevent this situation.

3-1

Page 26

Chapter 3 Module Programming

PLC-2 Programming

The PLC-2 program example regulates when each block transfer will be initiated to eliminate problems caused by limited regulation of bidirectional block transfers. Both storage bits are needed, as shown in the example, to accomplish this task in all PLC-2 systems, local or remote, with long or short program scans. Therefore, the program as shown is the minimum required. Note that PLC-2 processors that do not have the block transfer instruction must use the GET-GET block transfer format which is outlined in Appendix E. Figure 3.1 PLC-2 Family Sample Program Structure

Rung 1 Block transfer read buffer: the file-to-file move instruction holds the 1 block transfer read (BTR) data (file A) until the processor checks the data integrity. If the data was successfully transferred, the processor energizes the BTR done bit, initiating a data transfer to the buffer (file R) for use in the program. If the data is corrupted during the BTR 2 operation, the BTR done bit is not energized and data is not transferred to the buffer file. In this case, the data in the BTR file will be overwritten by data 3 from the next BTR. Rungs 2 and 3 These rungs provide for a user-initiated 4 block transfer write (BTW) after the module is initialized at power-up. Pressing the pushbutton locks out BTR operation and initiates a BTW that 5 reconfigures the module. Block transfer writes will continue for as long as the pushbutton remains closed. Rungs 4 and 5 These rungs provide a sequence to the module at power-up. They also make sure that only one block transfer (read or write) is enabled during a particular program scan. Rungs 6 and 7 These rungs are the conditioning block transfer rungs. Include all the input conditioning shown in the example program.

6

Block Transfer Read Done Bit

FILE TO FILE MOVE COUNTER ADDR: XXX POSITION: XXX FILE LENGTH: XXX FILE A: YYYY - XXXX FILE R: XXX - XXX RATE PER SCAN XXX

Block Transfer Write Done Bit

Pushbutton [1]

Block Transfer Write Done Bit

Storage Bit A

Power-up Bit

BTR Done Bit

Storage Bit B

7

Storage Bit A

Storage Bit A U Storage Bit B L

Block Transfer Read Done Bit

Power-up Bit

DONE DN 15 Storage Bit A L

Pushbutton [1]

Power-up Bit

ENABLE EN 17

Storage Bit B

BTR BLOCK XFER READ DATA ADDR: XXX MODULE ADDR: RGS BLOCK LENGTH: XX FILE: YYYY - XXX BTW

Storage Bit B U

ENABLE EN X7 DONE DN X7

ENABLE BLOCK XFER WRITE EN DATA ADDR: XXX X6 MODULE ADDR: RGS BLOCK LENGTH: XX DONE DN FILE: XXXX - XXXX X6

[1] You can replace the pushbutton with a timer bit to initiate the block transfer write on a timed basis. You can also use any storage bit in memory. 10954-I

3-2

Page 27

Chapter 3 Module Programming

PLC-3 Programming

Block transfer instructions with the PLC-3 processor use 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 (when programming a block transfer write) or from your module (when programming a block transfer read). The address of the block transfer data files are stored in the block transfer control file. The industrial terminal prompts you to create a control file when a block transfer instruction is being programmed. The same block transfer control file is used for both the read and write instructions for your module. A different block transfer control file is required for every module. A sample program segment with block transfer instructions is shown in Figure 3.2, and described below. Figure 3.2 PLC-3 Family Sample Program Structure

Program Action At power-up, the user program examines, the BTR done bit in the block transfer read file, initiates a block transfer write to configure the module, and then does consecutive block transfer reads continuously. The power-up bit can be examined and used anywhere in the program. Rungs 1 and 2 Rungs 1 and 2 are the block transfer read and write instructions. The BTR done bit in rung 1, being false, initiates the first read block transfer. After the first read block transfer, the module performs a block transfer write and then does continuous block transfer reads until the pushbutton is used to request another block transfer write. After this single block transfer write is performed, the module returns to continuous block transfer reads automatically.

1

2

Block Transfer Read Done Bit

BTR BLOCK XFER READ RACK: XXX GROUP: X MODULE: X=XXXX DATA: XXXXX=XXXX LENGTH = X CNTL: XXXXX:XXXX

Pushbutton Power-up Bit

Block Transfer Write Done Bit

BTW BLOCK XFER WRITE XXX RACK : X GROUP : X = XXXX MODULE: XXXXX = XXXX DATA: LENGTH = X CNTL: XXXXX:XXXX

ENABLE EN 12 DONE DN 15 ERROR ER 13 ENABLE EN 02 DONE DN 05 ERROR ER 03

3-3

Page 28

Chapter 3 Module Programming

PLC-5 Programming

The PLC-5 program is very similar to the PLC-3 program with the following exceptions: 1.

You must use enable bits instead of done bits as the conditions on each rung.

2.

A separate control file must be selected for each of the block transfer instructions. Refer to Appendix B.

Figure 3.3 PLC-5 Family Sample Program Structure Program Action Rungs 1 and 2 At power-up, the program enables a block transfer read and examines the power-up bit in the BTR file (rung 1). Then, it initiates one block transfer write to configure the module (rung 2). Thereafter, the program continuously reads data from the module (rung 1). A subsequent BTW operation is enabled by a pushbutton switch (rung 2). Changing processor mode will not initiate a block transfer write.

1

2

BTR Enable Bit

Pushbutton

Power-up Bit

BTR BLOCK TRANSFER READ RACK: X X GROUP: X MODULE: XX:XX CONTROL: XX:XX DATA FILE: LENGTH: X CONTINUOUS: N BTW Enable

BTW BLOCK TRANSFER WRITE RACK: X X GROUP: X MODULE: XX:XX CONTROL: XX:XX DATA FILE: LENGTH: X CONTINUOUS: N

EN DN ER

EN DN ER

10956-I

3-4

Page 29

Chapter 3 Module Programming

Module Scan Time

Scan time is defined as the amount of time it takes for the input module to read the input channels and place new data into the data buffer. Scan time for your module is shown in Appendix A. The following description references the sequence numbers in Figure 3.4. Following a block transfer write “1” the module inhibits communication until after it has configured the data “2,” performed self-calibration “3,” scanned the inputs “4,” and filled the data buffer “5.” Write block transfers, therefore, should only be performed when the module is being configured or calibrated. Any time after the second scan begins “6,” a BTR request “7” can be acknowledged. This interrupts the scan and the BTR empties the buffer. Following the BTR, the input module inhibits block transfer communications with the programmable controller until it has scanned its inputs “8” and new data is ready ”9.” The input module repeats the scan sequence “10,” updating the input values until another block transfer request is received. Therefore, BTRs will only be completed as frequently as the total scan time of the input module. Figure 3.4 Block Transfer Time Module available to perform block transfer

End of block transfer write

Block Transfer Write time

Configure time

1

2

Calibration time

See note

3

1st Scan

4

2nd Scan

5

Note: Configure/Calibration time: Single-ended mode = 100ms without filter, 102ms with filter Differential mode = 56ms without filter, 58ms with filter Scan time: = 12.5 ms for 8 differential inputs (no scaling or digital filter); = 25 ms for 16 single-ended inputs (no scaling or digital filter)

Chapter Summary

6

3rd Scan

7

8

9

10

12689

In this chapter, you learned how to program your programmable controller. You were given sample programs for your PLC-2, PLC-3 and PLC-5 family processors. You also read about module scan time. 3-5