Rockwell Automation 1771-DB User Manual

Allen-Bradley
1771–DB Basic Module
User Manual
I–1

Table of Contents

Using This Manual
1.1 Chapter Objectives What this manual contains
1.2
1.3
Audience Definitions of major terms
1.4
1.5
Important information
1.6
Conventions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introducing the BASIC Module
2.1 Chapter Objectives
2.2
General Features
2.3
Hardware Features Software Features
2.4 Specifications
2.5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing the BASIC Module
3.1 Chapter Objectives Installing the BASIC module
3.2
3.2.1 Power Requirements
3.2.2
Module Location in the I/O Chassis
3.2.3
Module Keying Configuration Plugs
3.2.4
3.2.5
Module Installation Initial Start-up Procedure
3.2.6
3.3
Module Status LED’ Installing the User Prom
3.4
3.4.1 Electrostatic Discharge
3.5 Battery Battery (continued)
3.5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
s
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
1 1 1 1 2 2
1. . . . . . . . . . . . . . . . . . . . . .
1 1 2 3 4
1. . . . . . . . . . . . . . . . . . . . . . .
1 1 2 2 2 3 5 5 6 7 9 9
10
Using the Serial Ports
4.1 Chapter Objectives Using the BASIC Module Program and Peripheral
4.2
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
Connecting a T3/T4 Industrial T
4.3.2
4.3.3
Connecting a T30 Industrial T
Program Port
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
erminal to the Program Port
erminal (Cat. No. 1784-T30) to the
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .
I–1. . . . . . . . . . . . . . . . . . . . . . . . . . . .
I–1 I–1
I–3 I–5 I–6 I–7 I–8
.
I–9
Table of Contentsii
4.3.4
Connecting a T50 Industrial T
to the Program Port
Configuring the Software
4.3.4.1 Wiring
4.3.4.2
4.4
Peripheral Port
Using the XON/XOFF Commands for the Peripheral Port
4.4.1 Connecting A T30 Industrial T
4.4.2
to the Peripheral Port
Hardware Configuration
4.4.2.1
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
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
erminal (Cat. No. 1784-T50)
. . . . . . . . . . . . . . . . . . . . . . . .
. . .
erminal (1784-T30)
. . . . . . . . . . . . . . . . . . . . . . . .
. .
. . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I–9 I–10 I–10
I–1
I–12 I–12
I–14 I–15 I–15 I–16 I–19
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating Functions
5.1 Chapter Objectives
5.2
Definition of T
5.2.1 Commands
5.2.2 Statements
5.2.3 Format Statements Data Format
5.2.4 Integers
5.2.5
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 Command: NULL [integer]
5.3.6
5.3.7 Command: Control C
5.3.7.1
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
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command: Disabling Control C
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
erms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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
1 1
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents iii
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
Statement: CALL [integer]
5.4.1
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: GOT
5.4.14 Statements: ON [expr] GOT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
O [ln num]
. . . . . . . . . . . . . . . . . . . . . . . .
O [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] Statement: LET
5.4.18
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4.19 Statement: ONERR [ln num)
5.4.20 Statement: ONTIME [expr],[ln num]
Statement: PRINT or P
5.4.21
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
5.4.23
5.4.24
Reset Print Head Pointer – CALL 99 Statement: PRINT# or P Statements: PH0., PH1., PH0.#, PH1.#
5.4.25 Statement: PUSH[expr]
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
.#
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . .
. . . . . . . . . . . .
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
Table of Contentsiv
5.4.26 Statement: POP[var]
5.4.27 Statement: REM
5.4.28
Statement: RETI Statement: ST@ [expr]
5.4.19
5.4.30
Statement: ST
OP
5.4.31 Statement: STRING Description of Arithmetic, and Logical Operators
5.5
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 Log Functions
5.5.2.2 T
5.5.2.3
rig Functions
5.5.2.4 Comments on T
5.5.3
Understanding Precedence of Operators
5.5.4 How Relational Expressions Work Special Operators
5.6
Special Function Operators
5.6.1
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 Data Transfer Support Routines
5.7
5.7.1 Update Block-T
5.7.2 Update Block-Transfer-W
5.7.3 Set Block-Transfer-W
5.7.4 Set Block-T
5.7.5 Update Block-Transfer-W
5.7.6 Update Block-T
5.7.7
Disable Interrupts – CALL 8
5.7.8
Enable Interrupts – CALL 9 Input Call Conversion Routines
5.7.9
5.7.9.1
3-Digit Signed, Fixed Decimal BCD to Internal
Floating Point ”XXX – CALL 10
16-Bit Binary (4-digit hex) to Internal Floating
5.7.9.2
Point – CALL 1
4-Digit Signed Octal to Internal Floating
5.7.9.3
Point ”XXXX – CALL 12
6-Digit, Signed, Fixed Decimal BCD to Internal
5.7.9.4
Floating Point ”XXXXXX – CALL 13
5.7.9.5
4-Digit BCD to Internal Floating Point XXXX – CALL 17
Output Call Conversion Routines
5.7.10
5.7.10.1
Internal Floating Point to 3-Digit, Signed, Fixed Decimal
BCD ”XXX – CALL 20
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
rig Functions
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
ransfer-Read Buf
rite Length – CALL 4
ransfer-Read Length – CALL 5
ransfer-Read Buf
fer (timed) – CALL 2
rite Buf
fer (timed) – CALL 3
rite Buf
fer – CALL 6
fer – CALL 7
. . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .
. . . . . .
. .
. .
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
Table of Contents v
5.7.10.2
5.7.10.3
5.7.10.4
5.7.10.5
5.7.10.6 Peripheral Port Support
5.8
5.8.1
5.8.2
5.8.3
5.8.4 V
5.8.5
5.8.6
Internal Floating Point to 16-Bit Unsigned Binary
(4 digit hex) – CALL 21
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Internal Floating Point to 4-Digit, Signed
Octal ”XXXX–Call 22
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Internal Floating Point to 6-Digit, Signed, Fixed Decimal
BCD ”XXXXXX – CALL 23
. . . . . . . . . . . . . . . . . . . . . . . . .
Internal Floating Point to 3.3-digit, Signed, Fixed Decimal
BCD ”XXX.XXX – CALL 26
. . . . . . . . . . . . . . . . . . . . . . . . .
Internal Floating Point to 4-digit BCD XXXX – CALL 27
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Peripheral Port Support – Parameter Set – CALL 30
. . . . . . .
Peripheral Port Support – Display Peripheral Port
Parameters –CALL 31
Save Program to Data Recorder – CALL 32
erify Program with Data Recorder – CALL 33
Load Program from Data Recorder – CALL 34
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
Get Numeric Input Character from Peripheral Port – CALL 35
5.8.7 Get the Number of Characters in the Peripheral Port Buf
5.8.8
5.8.9 (1770-SB only) – CALL 38
5.8.10 (1770-SB only) – CALL 39
5.8.11 Pointer – CALL 1
5.8.12
fers – CALL 36
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Clear the Peripheral Ports Input or Output Buf Save Labeled Program to Data Recorder
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Load Labeled Program from Data Recorder
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Print the Peripheral Port Output Buf
10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Print the Peripheral Port Input Buf
fer and
fer and Pointer – CALL 1
fer – CALL
5.8.13 Reset the Peripheral Port to Default Settings – CALL 1
5.9 W
all Clock Support Calls
5.9.1
Setting the W
5.9.2 Setting the W Set W
5.9.3
5.9.4
Date/T
all Clock Time (Hour all Clock Date (Day
all Clock – Day of W
ime Retrieve String – CALL 43
5.9.5 Date Retrieve Numeric (Day
5.9.6
T
ime Retrieve String – CALL
T
ime Retrieve Number – Call 46
5.9.7
5.9.8 Retrieve Day of W
5.9.9 Retrieve Day of Week Numeric – CALL 48
5.9.10
Date Retrieve String – CALL 52
Description of String Operators
5.10
5.10.1
The ASC Operator
5.10.2 The CHR Operator
5.10.2.1
5.10.2.2
5.10.3
5.10.3.1
Clearing the Screen on an Allen-Bradley
Industrial T
erminal
Cursor Positioning on an Industrial T
String Support Calls
String Repeat – CALL 60
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
, Minute, Second) – CALL 40
, Month, Y
eek – CALL 42
ear) – CALL 41
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
, Month, Y
45 69
ear) – CALL 44 (2)
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
eek String – CALL 47
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
erminal
. . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
57 57 58 58
58
.
59 59
60 61 61 62 63
65
37 65
.
65 66 66
19
11 . .
67 67 67 68
. .
68 68 69
. . .
69
70 70 70 71 71 72 74
74 75 75 80
Table of Contentsvi
5.10.3.2
5.10.3.3
5.10.3.4
5.10.3.5
5.10.3.6
5.10.3.7
5.10.3.8
5.10.3.9
5.11 Memory Support Calls
5.11.1 ROM to RAM Program T
5.11.2 ROM/RAM to ROM Program T
5.11.3 RAM/ROM Return – CALL 72
5.11.4 Battery-backed RAM Disable – CALL 73
5.11.5
5.11.6
5.12 Miscellaneous Calls
5.12.1
5.12.2
5.12.3
5.12.4 User PROM Check and Description – CALL 81
5.12.5
5.12.6
5.12.7
5.12.8
5.12.9
String Append (Concatenation) – CALL 61 Number to String Conversion – CALL 62 String to Number Conversion – CALL 63 Find a String in a String – CALL 64 Replace a String in a String – CALL 65 Insert String in a String – CALL 66 Delete String from a String – CALL 67 Determine Length of a String – CALL 68
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
ransfer – CALL 70
ransfer – CALL 71
. . . . . . . . . . . . . . . . . . . . .
Battery-backed RAM Enable – CALL 74 Protected V
Program Port Baud Rate – CALL 78 Blink the Active LED by Default – CALL 79 Check Battery Condition – CALL 80
Reset Print Head Pointer – CALL 99 Print the Argument Stack – CALL 109 Print the Peripheral Port Output Buf
Pointer – CALL 1
Print the Peripheral Port Input Buf
Pointer – CALL 1
Reset the Peripheral Port to Default
Settings – CALL 1
ariable Storage – CALL 77
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
fer and
11
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
fer and
. . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . .
. . . . . . . . .
81 81 82 83 84 85 86 87 87 88 88 89 90 90 90 92 92 93 93 93 94 94
94 94 95
Programming
6.1 Chapter Objectives
6.2 Block-T
6.2.1 Block-Transfer-W
6.3 Block-Transfer with PLC-2 Family Processors
6.3.1 PLC-2 Processor Program
6.3.1.1
6.4 PLC-3 Family Processors
6.4.1 Logic – Single Data Set
6.5 PLC-5 Family Processors
6.5.1
6.6. Block-Transfer Programming Tips
ransfer with the BASIC Module
Rung Description
Rung Description for Sample PLC-3 Family Ladder
Rung Description for Sample PLC-5 Family Ladder Logic
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
rite and Block-T
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ransfer-Read Buf
. . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
fers
. . . .
. .
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 2 2 3 5
7 7 9
10
Table of Contents vii
Data Types
7.1 Chapter Objectives Output Data T
7.2
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 4-digit, Signed, Octal
7.2.4
6-digit, Signed, Fixed Decimal BCD
7.2.5
7.2.6
3.3-digit, Signed, Fixed Decimal BCD
7.3
Input Data T
ypes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ypes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing A Procedure
8.2 Chapter Objectives
8.2
Entering the Edit Mode
8.3
Editing Commands/Features
8.3.1 Move
8.3.2
Replace Insert
8.3.3
8.3.4
Delete Retype
8.3.5
8.3.6 Exits
8.3.7
Renumber
Editing a Simple Procedure
8.4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 2 2 3 4 5 6
1 1 1 1 1 2 2 2 2 2 4
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error Messages and Anomalies
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
W
all Clock CALL Error Messages
String Support CALL Error Messages
9.3.4
9.3.5 Memory Support CALL Error Messages
9.3.6 Miscellaneous CALL Error Messages
9.4
Anomalies
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
Quick Reference Guide
Decimal/Hexadecimal/Octal/ASCII Conversion Table
Basic Module Programming Hints
BASIC Module Programming Hints
. . . . . . . . . . . . . . . . . . . . . . .
1 1 3 3 3 4 5 6 7 7
1
1. . . . . . . . . . . . . . . . . . . . .
1. . . . . . . . . . . . . . . . . . . . . . . . . . .
1. . . . .
1. . . . . . . . . . . . . . . . . . .
Using This Manual
Chapter 1
1.1 Chapter Objectives
1.2 What this manual contains
1.3 Audience
Read this chapter before you use the BASIC Module. It tells you how to use this manual properly and efficiently.
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.
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.
Chapter 1
Using This Manual
1.5 Important information
1.6 Conventions
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.
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
Chapter 2
Introducing the BASIC Module
2.1 Chapter Objectives
2.2 General Features
This chapter discusses the functions and features of the BASIC Module. When you finish reading this chapter, you should:
understand and be able to identify the hardware components of the BASIC Module.
understand the basic features and functions of the BASIC Module.
The BASIC Module (figure 2.1) provides math functions, report generation and BASIC language capabilities for any Allen-Bradley processor that communicates with the 1771 I/O system using block-transfer. It provides:
basic programming using the Intel BASIC-52 language. math functions consistent with the BASIC-52 definition. two independently configurable serial ports capable of connecting to
various user devices. user accessible real-time clock with 5 ms resolution. user accessible “wall” clock/calendar with 1 second resolution. program generation and editing using a dumb ASCII terminal or a
T3/T4 Industrial Terminal in alphanumeric mode. program storage and retrieval using the 1770-SA/SB Recorder. block-transfer communication capability from a PLC-2, PLC-3 or
PLC-5 family processor. on board program PROM burning.
Chapter 2
Introducing the BASIC Module
2.2 General Features (continued)
Figure
2.1
BASIC Module Front Edge
2.3 Hardware Features
2–2
Your module is a one-slot module with the following functions and features:
13 K bytes of battery backed RAM for user programs. 32 K bytes of EPROM storage for user software routines. One RS-423A/232C compatible serial communications
port(PROGRAM port) which works with ASCII terminals providing operator program interaction, command level input printer output, etc. The program port baud rate defaults to 1200 baud. Initially you must set your terminal for 1200 baud. Use CALL 78 to change the program port baud rate. The program port is fixed at no parity, 1 start bit, 1 stop bit and 8 data bits.
It also supports XON/XOFF for interruption of LISTing or to suspend data output from the program port.
Chapter 2
Introducing the BASIC Module
2.3 Hardware Features (continued)
2.4 Software Features
One RS-423A/232C/RS-422 compatible serial communications port (PERIPHERAL port), supporting bi-directional XON/XOFF software handshaking and RTS/CTS, DTR, DSR, DCD hardware handshaking for interfacing to printers and commercial asynchronous modems. You can change the peripheral port configuration using a CALL 30. (Refer to Section 5.8.1). Default values are: 1 start bit, 1 stop bit, 8 bits/character, no parity, handshaking off and 1200 baud. The baud rate is jumper selectable (300 to 19.2 K bps). (Refer to Section 3.2.4 titled, “Configuration Plugs”).
Interface to the 1771 I/O rack backplane to support block-transfer. Wall clock/calendar with battery back-up available for program access. Battery replacement without removing the module from the I/O rack. All power derived from the backplane (1.5 A). Multiple BASIC modules can reside in the same I/O rack and function
independently of each other.
Your module runs BASIC language programs in an interactive mode through the dumb terminal/programming port interface, or on power-up. The execution of these programs allows a direct interface with programmable controller ladder programs.
Your module uses the following devices and features:
terminal for programming, editing, system commands, displaying data and interactive program dialog
serial port for report generation output, upload/download to 1770-SA/SB Recorder
PLC-2, PLC-3 and PLC-5 data table reads and writes using block-transfer
We provide routines to use both the real-time clock and the wall-clock/calendar. The wall-clock time base is seconds.
2–3
Chapter 2
ommunication
Introducing the BASIC Module
2.4 Software Features (continued)
You can start program execution:
by entering commands at the interactive terminal. at power-up initialization.
You can store and execute programs in RAM or EPROM. You can store one user-program in RAM and up to 255 (depending on program size) independent user-programs simultaneously in EPROM memory.
The programs run single-task mode only. You can generate the following data types with the BASIC Module:
16-bit binary (4 hex digits) 3-digit, signed, fixed decimal BCD 4-digit, unsigned, fixed decimal BCD 4-digit, signed, octal 6-digit, signed, fixed decimal BCD
3.3 digit, signed, fixed decimal BCD
Refer to Chapter 7, “Data Types” for more information.
2.5 Specifications
Isolation
G Formats: integer, decimal,
hexadecimal and exponential
G The Programming Port is isolated from
the 1771 I/O backplane. (+500 V)
G The Peripheral Port is isolated from
the 1771 I/O backplane. (+500 V)
G The Programming Port is isolated from
the Peripheral Port. (+500 V)
Communication Rates
G 300, 600, 1200, 2400, 4800, 9600,
19.2 K bits
G Communication rates/distances
Communication
Rate (bps)
300 50 4000 4000
600 50 3000 4000 1200 50 2500 4000 4800 50 800 4000 9600 50 400 4000
19,200 50 200 4000
Wall-clock accuracy
G Formats: integer, decimal,
hexadecimal and exponential
G Absolute: v
@@@@ Drive output +3.6 V minimum
G
Drift v
G
Drift v
@@@@
Port driver and receiver
G Drive output +3.6 V minimum
@@@@
" 5 min/month @ 25° C " 50 ppm/°C " 50 ppm/year @ 25°C
G Receiver sensitivity 200 mV minimum
@@@@
Math
G Precision: 8 significant digits G Range: "1E-127 to
"99999999E+127
Maximum Distance Allowed
RS-232-C RS-423 RS-422
G Formats: integer, decimal,
hexadecimal and exponential
Module location
G One 1771 I/O chassis module slot
Backplane power supply load
G 1.5 A
Environmental Conditions
G Operational temperature: 0°C to 60°C
(32°F to 140°F)
G Storage temperature: -40°C to 85°C
(-40°F to 185°F)
G Relative humidity: 5% to 95%
(non-condensing)
Keying (top backplane connector)
G Between 8 and 10 G Between 32 and 34
2–4
Chapter 3

Installing the BASIC Module

3.1 Chapter
Objectives
3.2 Installing the BASIC module
This chapter describes how to install your BASIC module in a 1771 I/O rack. After reading this chapter you should be able to:
configure the module using the configuration plugs. insert the module into a 1771 I/O backplane. understand module status indicators. install additional EPROM’s.
WARNING: Disconnect and lockout all AC power from the programmable controller and system power supplies before installing modules to avoid injury to personnel and damage to equipment.
Read this installation section completely before beginning. Re-check all option selections and connections before you begin programming.
Before installing your module in the I/O chassis you must:
1. calculate the power requirements of all the modules in each chassis.
(Refer to Section 3.2.1 below).
2. determine the location of the module in the I/O chassis. (Refer to
Section 3.2.2 below).
3. key the backplane connectors in the I/O chassis. (Refer to Section
3.2.3 below).
4. set the module configuration plugs. (Refer to Section 3.2.4 below).
Chapter 3
Installing the BASIC Module
3.2.1 Power Requirements
3.2.2 Module Location in the I/O Chassis
Your module receives its power through the 1771 I/O chassis backplane from the chassis power supply. It does not require any other external power supply to function. When planning your system you must consider the power usage of all modules in the I/O chassis to prevent overloading the chassis backplane and/or power supply. Each BASIC module requires 1.5 A at +5V DC. Add this to the requirements of all other modules in the I/O chassis.
CAUTION: Do not insert or remove modules from the I/O chassis while system power is on. Failure to observe this rule may result in damage to module circuitry.
You can place your module in any I/O slot of the I/O chassis except for the extreme left slot. This slot is reserved for processors or adapter modules. You can place your module in the same module group as a discrete high density module if you are using processors or adapters with single-slot addressing capabilities.
Important: Certain processors restrict the placement of block-transfer output modules. Refer to the user manual for your particular processor for more information.
3.2.3 Module Keying
3–2
Initially you can insert your module into any I/O module slot in the I/O chassis. However, once you designate a slot for a module you must not insert other modules into these slots. We strongly recommend that you use the plastic keying bands shipped with each I/O chassis, to key I/O slots to accept only one type of module. Your module is slotted in two places on the rear edge of the board. The position of the keying bands on the backplane connector must correspond to these slots to allow insertion of the module. You may key any I/O rack connector to receive the module assembly. Snap the keying bands onto the upper backplane connectors between the numbers printed on the backplane (figure 3.1).
Between 8 and 10 Between 32 and 34
3.2.3 Module Keying (continued)
Chapter 3
Installing the BASIC Module
Figure
3.1
Keying Diagram for Placement of Module Keying Bands
3.2.4 Configuration Plugs
You may change the position of these bands if subsequent system design and rewiring makes insertion of a different type of module necessary. Use needle-nose pliers to insert or remove keying bands.
There are three sets of user selectable configuration plugs on the BASIC Module (figure 3.2). You can use these configuration plugs to select:
PROM size. peripheral port baud rate (bps). 422 receiver termination.
3–3
Chapter 3
Installing the BASIC Module
3.2.4 Configuration Plugs (continued)
Figure
3.2
The Configuration Plugs
3–4
All other configuration plugs are factory set. Do not reset these factory set configuration plugs.
Chapter 3
Installing the BASIC Module
3.2.5 Module Installation
3.2.6 Initial Start-up Procedure
Now that you have determined the configuration, power requirements, location, keying and wiring for your module, you are ready to install it in the I/O chassis.
1. Turn off power to the I/O chassis.
2. Insert your module in the I/O rack. Plastic tracks on the top and
bottom of the slots guide the module into position. Do not force the module into its backplane connector. Apply firm, even pressure on the module to seat it properly. Note the rack, module group and slot numbers and enter them in the module address section of the block-transfer instructions.
3. Snap the I/O chassis latch over the module. This secures the module
in place.
You must use the following procedure when powering up the module for the first time. This procedure is a continuation of the installation procedure presented above.
4. Connect the cable from your program terminal to the BASIC Module
program port.
CAUTION: Be sure you properly ground the system be fore turning on power. A difference in ground potential between the BASIC Module serial connectors and your program terminal or other serial device can cause damage to the equipment or loss of module programs.
5. Turn on your program terminal. Select 1200 baud. If you are using an
industrial terminal, select the Alpha Numeric mode, baud rate and press [RETURN].
6. Turn on power to the rack. The following sequence takes place:
Fault (FLT) and ACTIVE LED’s go on. FLT and ACTIVE LED’s go out until power-up diagnostics is
complete. Ignore any other LED activity during power-up. ACTIVE LED goes on.
3–5
Chapter 3
Installing the BASIC Module
3.2.6 Initial Start-up Procedure (continued)
3.3 Module Status LED’s
When the ACTIVE LED comes on observe the sign-on message displayed on the terminal followed by tREADY.
You are now ready to begin BASIC programming. Refer to Chapter 6 for an example program to help you get your processor and BASIC Module communicating properly.
Important: If you break communications with the module check that the terminal is set at the proper baud rate.
There are five LED’s (figure 3.3) on the front panel of the module which indicate the status of the module.
Figure
3.3
Module Status Indicators
3–6
LED Description
ACTIVE (green) Indicates the module has passed power-up diagnostics. You can program
using CALL 79 to:
G remain on (default). G remain on in RUN mode and blink every second when in COMMAND
mode. Refer to Chapter 5 for an explanation of CALL 79.
XMTG (green) ON when data is transmitting on the peripheral port. Lights for either RS-422
or RS-423/RS-232C output.
RCVG (green) ON when data is transmitting on the peripheral port. Lights for either RS-422
or RS-423/RS-232C input. This LED does not indicate whether or not valid data was received.
FAULT (red) When LED is on, indicates either a hardware problem or block-transfer
problem. See below.
BAT LOW (red) Lights when the battery voltage drops below about 3.0V DC.
Chapter 3
Installing the BASIC Module
3.3 Module Status LED’s (continued)
3.4 Installing the User Prom
If the FLT LED lights after the module has been operating properly check the following troubleshooting chart.
Problem Probable Cause Recommended Action
Module’s programming port does not respond
Module’s programming port continues to function but FLT LED goes on and off
Module’s programming port continues to function and FLT LED goes out when processor is switched to program mode
Module’s programming port continues to function and FLT LED remains on
Hardware failure Send module for repair
Problem with block-transfers between processor and BASIC module
Problem with block-transfer circuitry on the BASIC Module
Verify ladder logic
Send module for repair
The BASIC Module has a 32 K byte EPROM installed (figure 3.4). We recommend that you keep JEDEC standard 8 K, 16 K or 32 K byte EPROMs which use 12.5V DC programming voltage as spares. You can buy 32 K byte EPROMs from Allen-Bradley (part numbers 940654-02 or 9406454-03).
3–7
Chapter 3
Installing the BASIC Module
Installing the User Prom (continued)
Figure
3.4
User PROM and Battery Holder
To replace the EPROM:
1. Turn the small screw in the socket just above the chip (figure 3.4) 1/4
turn counterclockwise.
2. Remove the old chip.
3. Insert the new chip with pin one down and the center notch down as
shown in the socket diagram.
4. Turn the small screw in the socket above the chip 1/4 turn clockwise.
5. Refer to the above section titled, “Configuration Plugs” for the proper
setting of the corresponding configuration plug.
3–8
Chapter 3
Installing the BASIC Module
3.4.1 Electrostatic
Discharge
Electrostatic discharge can damage integrated circuits or semiconductors in this module if you touch backplane connector pins. It can also damage the module when you set configuration plugs and/or switches inside the module. Avoid electrostatic damage by observing the following precautions:
Touch a grounded object to rid yourself of charge before handling the module.
Do not touch the backplane connector or connector pins. If you configure or replace internal components, do not touch other
circuit components inside the module. If available, use a static-safe work station.
When not in use, keep the module in its static-shield bag.
CAUTION: Electrostatic discharge can degrade performance or damage the module. Handle as stated above.
3.5 Battery
The 13 K bytes of user RAM and the clock/calendar are battery backed. Drain on the battery should be less than 0.5 mA DC during battery back-up (no power) and less than 50 uA while the module is powered. Battery life during no-power conditions is about 2000 hours. Battery shelf life is about 20,000 hours. When the BAT LOW indicator comes on the battery should maintain the clock and program data for about three days. We recommend immediate replacement.
To replace the battery (figure 3.4):
1. Place a screwdriver in the battery cover slot.
2. Press inwards slightly.
3. Rotate the screwdriver and battery cover counterclockwise 1/4 turn.
4. Release the pressure and remove the battery cover.
5. Replace the battery with the positive (+) terminal out.
6. Replace the battery cover.
3–9
Chapter 3
Installing the BASIC Module
3.5 Battery (continued)
The BAT LOW indicator should go out. You can monitor the battery low condition in revision A and revision B
modules using a XBY(77B4H) statement. Bit 2 high indicates the battery low condition.
With revision C modules use CALL 80 to monitor battery status.
3–10
Using the Serial Ports
Chapter 4
4.1 Chapter
Objectives
4.2 Using the BASIC Module Program and Peripheral Communication Ports
This chapter describes how to use the program serial port and the peripheral serial port to connect terminals, Data Cartridge Recorders, Digital Cassette Recorders, printers and other compatible devices.
The BASIC Module has a program serial port and a peripheral serial port capable of connecting to various user devices (figure 4.1). You can configure each port independently. Both ports are electrically isolated from each other and from the backplane up to 500 V with no external power needed. Both ports operate from 300 baud to 19.2K baud and default to 1200 baud.
Figure
4.1
Program/Peripheral Port Locations
If you use an RS-423/RS-232 device or an Allen-Bradley Industrial Terminal you can use up to a 50 foot maximum cable length for connections from either the program or peripheral ports. Refer to the specifications section in Chapter 2 for cable length recommendations.
Chapter 4
Using the Serial Ports
4.2 Using the BASIC Module Program and Peripheral Communication Ports (continued)
CAUTION: Be sure you properly ground the system before turning on power. A difference in ground potential between the BASIC Module serial connectors and your program terminal or other serial device can cause damage to the equipment or loss of module programs.
4.2.1 Pin Descriptions
Use the following pins for connections made to the program or peripheral ports. Refer to figure 4.2 for pin descriptions. Not all signals are available on both ports.
Signal states are:
mark = logical 1 = – voltage space = logical 0 = + voltage
Pin Name Description
1
1
1
2
1
3 4 RTS RTS is an RS-423 compatible hardware handshaking output line. This line changes to a mark (1) state when the
5 CTS CTS is an RS-423A compatible hardware handshaking input line. This line must be in a mark (1) state for the
6 DSR DSR is a general purpose RS-423A compatible input line. The BASIC Module transmits or receives in the mark (1)
71,9,10 Signal
8 DCD If DCD is enabled using CALL 30, the BASIC Module does not transmit or receive characters until the DCD line is
11,12,13,15 17,19,21,22
23,24 14,25 422 TXD RS-422A compatible equivalent of the RS-423A TXD line. Differential serial output lines. 16, 18 422 RXD Differential RS-422A compatible serial input lines. 20 DTR DTR is an RS-423A compatible hardware handshaking output line. This line changes to a space (0) state when the
1
program port pins
Chassis/ Shield
TXD TXD is an RS-423A compatible serial output port. RXD RXD is an RS-423A compatible serial input data port.
Common
NC No connection
Connect this pin to chassis ground for shielding purposes.
BASIC Module has data in the output queue and is requesting permission to transmit to the data communications equipment.
BASIC Module to transmit on the peripheral port. If no corresponding signal exists on the data communications equipment, connect CTS to RTS.
or space (0) state. Use this line for data recorder interface. Use the signal common pins to reference all RS-423A/RS-422 compatible signals.
in the mark (1) state. When disabled, the module ignores the state of this line.
BASIC Module input queue has accumulated more than 223 characters. The DTR line changes to a mark (1) state when the input queue contains less than 127 characters.
4–2
Chapter 4
Using the Serial Ports
4.3 Program Port
The program port is an RS-423A/232C compatible serial port that provides minimum signal line connection to terminals, printers and other serial devices for operator-program interaction, command level input, printer output etc. Figure 4.2 shows the signals available on both the program port and the peripheral port described later.
Figure
4.2
Program Port and Peripheral Port W

Program Port Peripheral Port Description

1
1
1
2
1
3
4 4 5 5
6 6
1
7
8 8 9 9
10 10
11 11 NC 12 12 NC 13 13 NC 14 14 15 15 NC 16 16 17 17 NC 18 18 19 19 NC 20 20 DTR-Output 21 21 NC 22 22 NC 23 23 NC 24 24 NC 25 25
1
Signal is provided on this pin
iring Connections
1
1
1
2
1
3
1 1
1 1
7
1 1
1
1
1
1
1
Chassis/Shield TXD-Output RXD-lnput
RTS-Output CTS-lnput
DSR-lnput Signal Common DCD-lnput Signal Common Signal Common
RS-422 TXD
RS-422 RXD
RS-422 RXD’
RS-422 TXD’
The baud rate is initially set at 1200 baud. You can use CALL 78 to change the baud rate from 300 to 19.2K bps.
The program port has the following fixed format:
parity: none start bits: 1 stop bits: 1 data bits: 8 receiver threshold: 200 mV driver output (loaded): +3.6V
4–3
Chapter 4
Using the Serial Ports
4.3 Program Port (continued)
Important: The program port always resets the most significant bit of all its data inputs. The range of each byte of data is 0 to 127 (7F the module transmits all bits as specified when using the PRINT CHR() command except for the XOFF (13H) character. The range of each byte of data is 0 to 255 (OFF
Important: The program port automatically inserts a CR, LF sequence after the 79th character column. Use CALL 99 to reset the column counter to zero to allow PRINT page width’s in excess of 79 characters.
You enter BASIC programs through a dumb ASCII terminal, such as an industrial terminal in alphanumeric mode. Refer to section 4.3.2, “Connecting a T3/T4 Industrial Terminal to the Program Port”.
).
H
). On output,
H
4.3.1 Using the XOFF/XON Commands for the Program Port
Use the XOFF/XON commands to disable outputs from the program port in the following way.
1. Use XOFF only on PRINT statements.
2. When XOFF is received during a PRINT, data output and program
execution are suspended immediately.
3. When XOFF is received at any other time, program execution
continues until a PRINT is encountered. When a PRINT is encountered program execution is suspended.
4. Use XON to resume program execution.
The program port accepts uppercase or lowercase input, however, the input receiver changes all commands, keywords or variables to upper case before storing in memory, thus:
u10 print “hello”(CR)
appears as
10 PRINT “hello”
when listed.
4–4
Chapter 4
Using the Serial Ports
4.3.2 Connecting a T3/T4 Industrial Terminal to the Program Port
You can use an Industrial Terminal System as the programming system for the BASIC Module. Connect the module to CHANNEL C only. You can construct cable for distances up to 50 feet. Figure 4.3 shows cable connections to a T3/T4 Industrial Terminal from the program port.
Important: You may continue to use CHANNEL B in existing installations.
Figure
4.3
Cable Connection to T3/T4 Terminal from the Program Port
You can use a T3 or T4 Industrial Terminal with the following keyboard revisions:
T3 Series A, Revision H or later T3 Series B, Revision H or later T3 Series C, Revision A or later T4 Series A, Revision F or later
Refer to the Industrial Terminal Systems User’s Manual (Cat. No. 1770-T1, T2, T3), publication number 1770-6.5.3, and PLC-3 Industrial Terminal User’s Manual (Cat. No. 1770-T4), publication number 1770-6.5.15 for additional information.
4–5
Chapter 4
Using the Serial Ports
4.3.3 Connecting
a T30 Industrial Terminal (Cat. No. 1784-T30) to the Program Port
You can connect a T30 Industrial Terminal to the BASIC Module program port to act as a dumb terminal.
Refer to the following figure 4.4 for BASIC Module/T30 connections.
Figure
4.4
Connecting a T30 Industrial Terminal to a BASIC Module
Important: Jumper T30 Industrial Terminal pin 4,5 and 6; and BASIC Module pins 4 and 5 if you do not use them.
4.3.4 Connecting a T50 Industrial Terminal (Cat. No. 1784-T50) to the Program Port
You can use your T50 Industrial Terminal as a BASIC Module programming device. You must use a terminal driver package to configure the industrial terminal serial port and communications protocol to match the BASIC Module.
These packages include the ability to upload to and download from the hard or floppy disk drives in the industrial terminal.
To upload and download you must:
1. configure the software.
2. construct a cable with the pin connections shown in figure 4.5 under,
“Wiring”.
3. use the upload and download commands of the driver package.
4–6
Loading...
+ 137 hidden pages