The text of a manual · part 1 of 17
1771-DB Basic Module User Manual, pages 1 to 10
Pages 1 to 10 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 1
wy
Allen-Bradley
1771-DB Basic Module
User Manual
L-1
Page 2
Table of Contents
Using This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 What this manual contains . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Definitions of major terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Important information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 1 2 2
Introducing the BASIC Module . . . . . . . . . . . . . . . . . . . . . .
1
2.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 General Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Hardware Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Software Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 2 3 4
Installing the BASIC Module . . . . . . . . . . . . . . . . . . . . . . .
1
3.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Installing the BASIC module . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Power Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Module Location in the I/O Chassis . . . . . . . . . . . . . . . . . . . 3.2.3 Module Keying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4 Configuration Plugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.5 Module Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.6 Initial Start-up Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Module Status LED’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Installing the User Prom . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Electrostatic Discharge . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Battery (continued) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 2 2 2 3 5 5 6 7 9 9 10
Using the Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I–1
4.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Using the BASIC Module Program and Peripheral Communication Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Program Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Program Port (continued) . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Using the XOFF/XON Commands for the Program Port . . . . 4.3.2 Connecting a T3/T4 Industrial Terminal to the Program Port . 4.3.3 Connecting a T30 Industrial Terminal (Cat. No. 1784-T30) to the Program Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I–1 I–1 I–3 I–5 I–6 I–7 I–8 I–9
Page 3
ii
Table of Contents
4.3.4 Connecting a T50 Industrial Terminal (Cat. No. 1784-T50) to the Program Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4.1 Configuring the Software . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4.2 Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Peripheral Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 Using the XON/XOFF Commands for the Peripheral Port . . . 4.4.2 Connecting A T30 Industrial Terminal (1784-T30) to the Peripheral Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.2.1 Hardware Configuration . . . . . . . . . . . . . . . . . . . . . . . . 4.4.3 Connecting a 1770-SA/SB Recorder to the Peripheral Port . . 4.4.4 Connecting a 1770-HC Printer to the Peripheral Port . . . . . . 4.4.5 Connecting RS-422 Devices . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Cable Assembly Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I–9 I–10 I–10 I–11 I–12 I–12 I–14 I–15 I–15 I–16 I–19
Operating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
5.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Definition of Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 Format Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4 Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.5 Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.7 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.8 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.9 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.10 Relational Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.11 System Control Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.12 Argument Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.13 Control Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Description of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Command: RUN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2 Command: CONT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3 Command: LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.4 Command: LIST# or LIST[ . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.5 Command: NEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.6 Command: NULL [integer] . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.7 Command: Control C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.7.1 Command: Disabling Control C . . . . . . . . . . . . . . . . . . . 5.3.8 Command: Control S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.9 Command: Control Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.10 Overview of EPROM File Commands . . . . . . . . . . . . . . . . 5.3.11 Commands: RAM and ROM [integer] . . . . . . . . . . . . . . . . . 5.3.11.1 RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.11.2 ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 1 2 2 2 3 3 3 4 4 4 5 5 6 6 7 7 8 9 9 9 9 10 10 10 10 11 11
Page 4
Table of Contents
5.3.12 Command: XFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.13 Command: PROG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.13.1 User PROM Check and Description – CALL 81 . . . . . . . 5.3.14 Command: PROG1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.15 Command: PROG2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Description of Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1 Statement: CALL [integer] . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.2 Statement: CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.3 Statement: CLEARI (clear interrupts) . . . . . . . . . . . . . . . . . . 5.4.4 Statement: CLEARS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5 Statements: CLOCK1 and CLOCK0 . . . . . . . . . . . . . . . . . . CLOCK1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CLOCK0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.6 Statements: DATA – READ – RESTORE . . . . . . . . . . . . . . DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . READ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RESTORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.7 Statement: DIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.8 Statements: DO – UNTIL [rel expr] . . . . . . . . . . . . . . . . . . . 5.4.10 Statement: END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.11 Statements: FOR – TO – (STEP) – NEXT . . . . . . . . . . . . . 5.4.12 Statements: GOSUB [ln num] – RETURN . . . . . . . . . . . . . GOSUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RETURN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.13 Statement: GOTO [ln num] . . . . . . . . . . . . . . . . . . . . . . . . 5.4.14 Statements: ON [expr] GOTO [ln num], [ln num],...[ln num], ON [expr] GOSUB[ln num], [ln num],...[ln num] . . . . . . . . . . . . 5.4.15 Statements: IF – THEN – ELSE . . . . . . . . . . . . . . . . . . . . 5.4.16 Statement: INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.17 Statement: LD@ [expr] . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.18 Statement: LET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.19 Statement: ONERR [ln num) . . . . . . . . . . . . . . . . . . . . . . . 5.4.20 Statement: ONTIME [expr],[ln num] . . . . . . . . . . . . . . . . . . 5.4.21 Statement: PRINT or P. . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22 Special Print Formatting Statements . . . . . . . . . . . . . . . . . 5.4.22.1 PRINT TAB([expr]) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22.2 PRINT SPC([expr]) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22.3 PRINT CR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22.4 PRINT USING (special characters) . . . . . . . . . . . . . . . 5.4.22.5 PRINT USING(Fx) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22.6 PRINT USING(#.#) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22.7 PRINT USlNG(0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.22.8 Reset Print Head Pointer – CALL 99 . . . . . . . . . . . . . . 5.4.23 Statement: PRINT# or P.# . . . . . . . . . . . . . . . . . . . . . . . . 5.4.24 Statements: PH0., PH1., PH0.#, PH1.# . . . . . . . . . . . . . . . 5.4.25 Statement: PUSH[expr] . . . . . . . . . . . . . . . . . . . . . . . . . .
iii
12 12 13 14 14 16 16 16 16 17 17 17 17 18 18 18 18 19 19 22 22 23 23 24 24 25 25 26 28 29 30 31 32 33 33 33 33 34 34 35 35 36 36 37 38
Page 5
iv
Table of Contents
5.4.26 Statement: POP[var] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.27 Statement: REM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.28 Statement: RETI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.19 Statement: ST@ [expr] . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.30 Statement: STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.31 Statement: STRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 Description of Arithmetic, and Logical Operators and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.1 Dual Operand (dyadic) Operators . . . . . . . . . . . . . . . . . . . . 5.5.1.1 Comments on logical operators .AND.,.OR. and .XOR. . . 5.5.2 Unary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2.1 General Purpose Operators . . . . . . . . . . . . . . . . . . . . . 5.5.2.2 Log Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2.3 Trig Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2.4 Comments on Trig Functions . . . . . . . . . . . . . . . . . . . . 5.5.3 Understanding Precedence of Operators . . . . . . . . . . . . . . . 5.5.4 How Relational Expressions Work . . . . . . . . . . . . . . . . . . . . 5.6 Special Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1 Special Function Operators . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1.1 GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1.2 TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.2 System Control Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.2.1 MTOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.2.2 LEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Data Transfer Support Routines . . . . . . . . . . . . . . . . . . . . . . 5.7.1 Update Block-Transfer-Read Buffer (timed) – CALL 2 . . . . . . 5.7.2 Update Block-Transfer-Write Buffer (timed) – CALL 3 . . . . . . 5.7.3 Set Block-Transfer-Write Length – CALL 4 . . . . . . . . . . . . . . 5.7.4 Set Block-Transfer-Read Length – CALL 5 . . . . . . . . . . . . . 5.7.5 Update Block-Transfer-Write Buffer – CALL 6 . . . . . . . . . . . 5.7.6 Update Block-Transfer-Read Buffer – CALL 7 . . . . . . . . . . . 5.7.7 Disable Interrupts – CALL 8 . . . . . . . . . . . . . . . . . . . . . . . . 5.7.8 Enable Interrupts – CALL 9 . . . . . . . . . . . . . . . . . . . . . . . . 5.7.9 Input Call Conversion Routines . . . . . . . . . . . . . . . . . . . . . . 5.7.9.1 3-Digit Signed, Fixed Decimal BCD to Internal Floating Point ”XXX – CALL 10 . . . . . . . . . . . . . . . . . . . . . . 5.7.9.2 16-Bit Binary (4-digit hex) to Internal Floating Point – CALL 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7.9.3 4-Digit Signed Octal to Internal Floating Point ”XXXX – CALL 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7.9.4 6-Digit, Signed, Fixed Decimal BCD to Internal Floating Point ”XXXXXX – CALL 13 . . . . . . . . . . . . . . . . . . . 5.7.9.5 4-Digit BCD to Internal Floating Point XXXX – CALL 17 . . 5.7.10 Output Call Conversion Routines . . . . . . . . . . . . . . . . . . . 5.7.10.1 Internal Floating Point to 3-Digit, Signed, Fixed Decimal BCD ”XXX – CALL 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39 40 41 41 41 42 43 43 44 45 45 46 46 47 48 49 50 50 50 50 52 52 52 52 53 53 54 54 54 54 54 55 55 55 55 55 56 56 56 57
Page 6
Table of Contents
5.7.10.2 Internal Floating Point to 16-Bit Unsigned Binary (4 digit hex) – CALL 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7.10.3 Internal Floating Point to 4-Digit, Signed Octal ”XXXX–Call 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7.10.4 Internal Floating Point to 6-Digit, Signed, Fixed Decimal BCD ”XXXXXX – CALL 23 . . . . . . . . . . . . . . . . . . . . . . . . . 5.7.10.5 Internal Floating Point to 3.3-digit, Signed, Fixed Decimal BCD ”XXX.XXX – CALL 26 . . . . . . . . . . . . . . . . . . . . . . . . . 5.7.10.6 Internal Floating Point to 4-digit BCD XXXX – CALL 27 . 5.8 Peripheral Port Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.1 Peripheral Port Support – Parameter Set – CALL 30 . . . . . . . 5.8.2 Peripheral Port Support – Display Peripheral Port Parameters –CALL 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.3 Save Program to Data Recorder – CALL 32 . . . . . . . . . . . . . 5.8.4 Verify Program with Data Recorder – CALL 33 . . . . . . . . . . . 5.8.5 Load Program from Data Recorder – CALL 34 . . . . . . . . . . . 5.8.6 Get Numeric Input Character from Peripheral Port – CALL 35 5.8.7 Get the Number of Characters in the Peripheral Port Buffers – CALL 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.8 Clear the Peripheral Ports Input or Output Buffer – CALL 37 . 5.8.9 Save Labeled Program to Data Recorder (1770-SB only) – CALL 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.10 Load Labeled Program from Data Recorder (1770-SB only) – CALL 39 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.11 Print the Peripheral Port Output Buffer and Pointer – CALL 110 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.12 Print the Peripheral Port Input Buffer and Pointer – CALL 111 5.8.13 Reset the Peripheral Port to Default Settings – CALL 119 . . 5.9 Wall Clock Support Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.9.1 Setting the Wall Clock Time (Hour, Minute, Second) – CALL 40 5.9.2 Setting the Wall Clock Date (Day, Month, Year) – CALL 41 . . 5.9.3 Set Wall Clock – Day of Week – CALL 42 . . . . . . . . . . . . . . 5.9.4 Date/Time Retrieve String – CALL 43 . . . . . . . . . . . . . . . . . 5.9.5 Date Retrieve Numeric (Day, Month, Year) – CALL 44 (2) . . . 5.9.6 Time Retrieve String – CALL 45 . . . . . . . . . . . . . . . . . . . . . 5.9.7 Time Retrieve Number – Call 46 . . . . . . . . . . . . . . . . . . . . . 5.9.8 Retrieve Day of Week String – CALL 47 . . . . . . . . . . . . . . . 5.9.9 Retrieve Day of Week Numeric – CALL 48 . . . . . . . . . . . . . . 5.9.10 Date Retrieve String – CALL 52 . . . . . . . . . . . . . . . . . . . . 5.10 Description of String Operators . . . . . . . . . . . . . . . . . . . . . . 5.10.1 The ASC Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.10.2 The CHR Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.10.2.1 Clearing the Screen on an Allen-Bradley Industrial Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.10.2.2 Cursor Positioning on an Industrial Terminal . . . . . . . . . 5.10.3 String Support Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.10.3.1 String Repeat – CALL 60 . . . . . . . . . . . . . . . . . . . . . .
v
57 57 58 58 58 59 59 60 61 61 62 63 65 65 65 66 66 67 67 67 68 68 68 69 69 69 70 70 70 71 71 72 74 74 75 75 80
Page 7
vi
Table of Contents
5.10.3.2 String Append (Concatenation) – CALL 61 . . . . . . . . . . 5.10.3.3 Number to String Conversion – CALL 62 . . . . . . . . . . . 5.10.3.4 String to Number Conversion – CALL 63 . . . . . . . . . . . 5.10.3.5 Find a String in a String – CALL 64 . . . . . . . . . . . . . . . 5.10.3.6 Replace a String in a String – CALL 65 . . . . . . . . . . . . 5.10.3.7 Insert String in a String – CALL 66 . . . . . . . . . . . . . . . . 5.10.3.8 Delete String from a String – CALL 67 . . . . . . . . . . . . . 5.10.3.9 Determine Length of a String – CALL 68 . . . . . . . . . . . 5.11 Memory Support Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.11.1 ROM to RAM Program Transfer – CALL 70 . . . . . . . . . . . . 5.11.2 ROM/RAM to ROM Program Transfer – CALL 71 . . . . . . . 5.11.3 RAM/ROM Return – CALL 72 . . . . . . . . . . . . . . . . . . . . . 5.11.4 Battery-backed RAM Disable – CALL 73 . . . . . . . . . . . . . 5.11.5 Battery-backed RAM Enable – CALL 74 . . . . . . . . . . . . . . 5.11.6 Protected Variable Storage – CALL 77 . . . . . . . . . . . . . . . 5.12 Miscellaneous Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.12.1 Program Port Baud Rate – CALL 78 . . . . . . . . . . . . . . . . . 5.12.2 Blink the Active LED by Default – CALL 79 . . . . . . . . . . . . 5.12.3 Check Battery Condition – CALL 80 . . . . . . . . . . . . . . . . . 5.12.4 User PROM Check and Description – CALL 81 . . . . . . . . . 5.12.5 Reset Print Head Pointer – CALL 99 . . . . . . . . . . . . . . . . . 5.12.6 Print the Argument Stack – CALL 109 . . . . . . . . . . . . . . . . 5.12.7 Print the Peripheral Port Output Buffer and Pointer – CALL 110 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.12.8 Print the Peripheral Port Input Buffer and Pointer – CALL 111 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.12.9 Reset the Peripheral Port to Default Settings – CALL 119 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
81 81 82 83 84 85 86 87 87 88 88 89 90 90 90 92 92 93 93 93 94 94
Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
6.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Block-Transfer with the BASIC Module . . . . . . . . . . . . . . . . . 6.2.1 Block-Transfer-Write and Block-Transfer-Read Buffers . . . . 6.3 Block-Transfer with PLC-2 Family Processors . . . . . . . . . . . . 6.3.1 PLC-2 Processor Program . . . . . . . . . . . . . . . . . . . . . . . . 6.3.1.1 Rung Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4 PLC-3 Family Processors . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.1 Rung Description for Sample PLC-3 Family Ladder Logic – Single Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5 PLC-5 Family Processors . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.1 Rung Description for Sample PLC-5 Family Ladder Logic . . 6.6. Block-Transfer Programming Tips . . . . . . . . . . . . . . . . . . . .
1 1 1 2 2 3 5
94 94 95
7 7 9 10
Page 8
Table of Contents vii
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
7.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Output Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.1 16-bit Binary (4 Hex Digits) . . . . . . . . . . . . . . . . . . . . . . . . 7.2.2 3-digit, Signed, Fixed Decimal BCD . . . . . . . . . . . . . . . . . . 7.2.3 4-digit, Unsigned, Fixed Decimal BCD . . . . . . . . . . . . . . . . 7.2.4 4-digit, Signed, Octal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.5 6-digit, Signed, Fixed Decimal BCD . . . . . . . . . . . . . . . . . . 7.2.6 3.3-digit, Signed, Fixed Decimal BCD . . . . . . . . . . . . . . . . 7.3 Input Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 2 2 3 4 5 6
Editing A Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
8.2 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Entering the Edit Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Editing Commands/Features . . . . . . . . . . . . . . . . . . . . . . . . 8.3.1 Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.2 Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.3 Insert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.4 Delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.5 Retype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.6 Exits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.7 Renumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4 Editing a Simple Procedure . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 1 1 2 2 2 2 2 4
Error Messages and Anomalies . . . . . . . . . . . . . . . . . . . . .
1
9.1 Chapter Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Error Messages from BASIC . . . . . . . . . . . . . . . . . . . . . . . . 9.3 Error Messages from CALL Routines . . . . . . . . . . . . . . . . . . 9.3.1 Data Conversion CALL Error Messages . . . . . . . . . . . . . . 9.3.2 Peripheral Port Support CALL Error Messages . . . . . . . . . . 9.3.3 Wall Clock CALL Error Messages . . . . . . . . . . . . . . . . . . . 9.3.4 String Support CALL Error Messages . . . . . . . . . . . . . . . . 9.3.5 Memory Support CALL Error Messages . . . . . . . . . . . . . . . 9.3.6 Miscellaneous CALL Error Messages . . . . . . . . . . . . . . . . 9.4 Anomalies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 3 3 3 4 5 6 7 7
Quick Reference Guide . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
Decimal/Hexadecimal/Octal/ASCII Conversion Table . . . . .
1
Basic Module Programming Hints . . . . . . . . . . . . . . . . . . .
1
BASIC Module Programming Hints . . . . . . . . . . . . . . . . . . . . . . .
1
Page 9
Chapter 1
Using This Manual
1.1 Chapter Objectives
Read this chapter before you use the BASIC Module. It tells you how to use this manual properly and efficiently.
1.2 What this manual contains
This manual shows you how to install and operate your module. It gives you information about: hardware specifications. installing the module. the BASIC instruction set. programming the module. This manual is not a BASIC tutorial document. We assume that you are familiar with BASIC programming.
1.3 Audience
Before you read this manual or try to use the BASIC Module, you should be familiar with the operation of the 1771 I/O structure as it relates to your particular processor. Refer to our Publication Index (publication number SD499) for the appropriate Programming and Operations manual.
1.4 Definitions of major terms
To make this manual easier for you to read and understand, we avoid repeating product names where possible. We refer to the: BASIC Language Module (Cat. No. 1771-DB) as the BASIC Module. Industrial Terminal System (Cat. No. 1770-T3/T4) as the industrial terminal. Data Recorder (Cat. No. 1770-SA/SB) as the 1770-SA/SB Recorder. RS-232-C compatible devices which communicate with the BASIC Module, such as the Industrial Terminal, SA/SB Recorder, computers, robots, barcode readers, or data terminals, as RS-423A/RS-232C devices.
Page 10
Chapter 1 Using This Manual
1.5 Important information
There are three different types of precautionary statements in this manual: Important, CAUTION and WARNING. Important: used to point out specific areas of concern when operating your BASIC Module. CAUTION: used to make you aware of instances where damage to your equipment could occur. WARNING: used to make you aware of instances where personal injury could occur.
1.6 Conventions
In this manual, we use certain notational conventions to indicate keystrokes and items displayed on a CRT or printer. A keystroke is shown in parentheses: (ENTER)
1–2