The text of a manual · part 15 of 17
1771-DB Basic Module User Manual, pages 141 to 150
Pages 141 to 150 of 167
The original document is the PDF (943 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-DB
Page 141
Chapter 6 Programming
6.5 PLC-5 Family Processors (continued)
Figure 6.7 Sample PLC-5 Family Ladder Logic
6.5.1 Rung Description for Sample PLC-5 Family Ladder Logic
Rungs 1 and 2 – Rungs 1 and 2 execute the BTR and BTW instructions alternately. When the BTR completes the BTW enables immediately following the BTR scan. Important: Do not select the continuous mode when using bidirectional block-transfer. Continuous mode does not allow use of the status bits in the block-transfer instructions. Important: Set the block-transfer-write timeout bit (control block, word 0, bit 08) to minimize the impact of the block-transfer instructions on the program scan time. See the following Section 6.6, “Block-Transfer Programming Tips” for more information.
6–9
Page 142
Chapter 6 Programming
6.6. Block-Transfer Programming Tips
1. The block lengths PUSHed for CALLs 4 and 5 must equal the corresponding lengths on your BTW/BTR instructions in the processor. 2. If a BTW appears first in your ladder logic, put CALLs 3 or 6 first in your BASIC program. If a BTR appears first in your ladder logic, put CALLs 2 or 7 first in your BASIC program. 3. Set the PLC-5 block-transfer-write timeout bit (block-transfer control block, word 0 bit 8) to eliminate excessive PLC-5 scan times. When the timeout bit sets, the processor attempts two DB block-transfers before generating a block-transfer error. The error condition resets the enable bit and restarts the block-transfer in our program example, figure 6.7. 4. If your application requires bidirectional block-transfers, you can use CALL 6 or 3 and CALL 7 or 2 as necessary if: you use an equal number of each type. you alternate their use (e.g. CALL 6, CALL 7, CALL 6, CALL 7)You can put the calls anywhere in the program. They can occur at any time interval. 5. If your application requires a one way block-transfer (all write-block-transfers or all read-block-transfers, use only the associated CALLs (4, and 3 or 6; 5, and 2 or 7).
6–10
Page 143
Chapter 7
Data Types
7.1 Chapter Objectives
This chapter describes the data types and formats used by the BASIC Module Data Conversion CALL routines. After reading this chapter you should be able to interpret and manipulate the data values generated by your module.
7.2 Output Data Types
Converted data is exchanged with programmable controllers using block-transfers. You can generate the following data types with the BASIC Module: 16-bit binary (XXXX) 3-digit, signed, fixed decimal BCD (" XXX.) 4-digit, unsigned, fixed decimal BCD (XXXX.) 4-digit, signed, octal (" XXXX) 6-digit, signed, fixed decimal BCD (" XXXXXX.) 3.3-digit, signed, fixed decimal BCD (" XXX.XXX)
7.2.1 16-bit Binary (4 Hex Digits)
This value requires one word of the processor data table. The data is represented by 16 straight binary bits (figure 7.1). The value ranges from 0 to 65,535. No sign, overflow or underflow bits are affected or decoded. If you use a value larger than 65,535 or a negative number you get a BAD ARGUMENT error. Figure 7.1 16 Bit Binary Word (4 digit hex)
Page 144
Chapter 7 Data Types
7.2.2 3-digit, Signed, Fixed Decimal BCD
This value requires one word of the processor data table. The data is represented by a 3-digit binary coded decimal integer (figure 7.2). Overflow, underflow and sign are also indicated. An underflow or overflow condition sets the appropriate bit and a value of 000 is returned. The value ranges from -999 to +999. Fractional portions of any number used with the routine are truncated. Figure 7.2 Truncated 3-Digit BCD Integer
7.2.3 4-digit, Unsigned, Fixed Decimal BCD
7–2
This value requires one word of the processor data table. The data is represented by a 4-digit BCD integer (figure 7.3). The value ranges from 0-9999. There is no indication of sign, underflow or overflow. However, if a value of greater than 9999 is converted, the value reported is 0000. Fractional portions of any number used with the routine are truncated.
Page 145
Chapter 7 Data Types
7.2.3 4-digit, Unsigned, Fixed Decimal BCD (continued)
7.2.4 4-digit, Signed, Octal
Figure 7.3 Truncated 4-Digit BCD Integer
This value requires one word of the processor data table. The data is represented by a 4-digit octal integer (figure 7.4). The value ranges from "7777 8 ("4095). Overflow, underflow and sign are also indicated. If an overflow or underflow condition exists, the appropriate bit is set and the value of 0000 is reported. Fractional portions of any number used in this routine are truncated. Figure 7.4 Truncated 4-Digit Octal Integer
7–3
Page 146
Chapter 7 Data Types
7.2.5 6-digit, Signed, Fixed Decimal BCD
This value requires two words of the processor data table. The first word contains overflow, underflow and sign data and the three most significant digits of the 6-digit BCD integer. The second word contains the lower three digits of the value (figure 7.5). The value ranges from -999999 to +99999. If an overflow or underflow condition exists, the appropriate bit is set and a value of 000000 is reported. Fractional portions of any number used with this routine are truncated. Figure 7.5 Truncated 6-Digit BCD Integer
7–4
Page 147
Chapter 7 Data Types
7.2.6 3.3-digit, Signed, Fixed Decimal BCD
This value requires two words of the processor data table. The first word contains the overflow, underflow, sign data and the three most significant digits of the value. The second word contains the lower three digits of the value (figure 7.6). The value ranges from -999.999 to +999.999. If an overflow or underflow condition exists, a value of 000.000 is reported and the appropriate bit is set. Any digits more than 3 places to the right of the decimal point are truncated. Figure 7.6 Truncated 3.3-Digit BCD
7–5
Page 148
Chapter 7 Data Types
7.3 Input Data Types
The BASIC Module interfaces with the PLC-2, PLC-3 and PLC-5 family processors. You can send the following data types to the BASIC Module types to the BASIC Module: 16-bit binary (4 Hex digits) (XXXX) 3-digit, signed, fixed decimal BCD (" XXX.) 4-digit, unsigned, fixed decimal BCD (XXXX.) 4-digit, signed, octal (" XXXX.) 6-digit, signed, fixed decimal BCD (" XXXXXX.) These data formats are the same as those described under ”Output Data Types” except for 3.3-digit BCD. Refer to the above descriptions. The BASIC Module converts the data looking at the sign bit when applicable. Refer to the programming manual for your processor for the proper data formats.
7–6
Page 149
Chapter 8
Editing A Procedure
8.2 Chapter Objectives
After reading this chapter you should be able to make corrections or modifications to your BASIC programs using the editing features presented.
8.2 Entering the Edit Mode
To invoke the edit mode, type [EDIT] and the line number of the RAM program line to edit. For example: uEDIT 10. The following features are available in the edit mode. right/left cursor control replace a character insert a character delete a character retype a line
8.3 Editing Commands/Features
Use the following editing commands to make corrections or modifications to your BASIC program in RAM.
8.3.1 Move
The move feature provides right/left cursor control. The space bar moves the cursor one space to the right. The [RUB OUT](DELETE) key moves the cursor one space to the left.
8.3.2 Replace
The replace feature allows you to replace the character at the cursor position. Type the new character over the previous one.
Page 150
Chapter 8 Editing A Procedure
8.3.3 Insert
Invoke the insert command by typing [CTRL]A. This command inserts text at the cursor position. You must type a second [CTRL]A to terminate the insert. Important: When you use insert, all text to the right of the cursor disappears until you type the second [CTRL]A. Total line length is 79 characters.
8.3.4 Delete
Invoke the delete command by typing [CTRL]D. This command deletes the character at the cursor position.
8.3.5 Retype
Invoke the retype command by typing the [RETURN] key. This feature retypes the line and initializes the cursor to the first character.
8.3.6 Exits
Invoke the exit command by typing [CTRL]Q or [CTRL]C.[CTRL]Q exits the editor and replaces the old line with the edited line. [CTRL]C exits the editor with no changes made to the line.
8.3.7 Renumber
Invoke the renumber command by typing any of the following commands: REN, begins at the start of the program and continues through the end of the program. The new line numbers begin at 10 and increment by 10. REN[NUM], begins at the start of the program and continues through the end of the program. The new line numbers begin at 10 and increment by NUM.
8–2