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
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:
G Precision: 8 significant digits
G Range: "1E-127 to
"99999999E+127
Maximum Distance Allowed
RS-232-CRS-423RS-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
LEDDescription
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.
ProblemProbable CauseRecommended 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 failureSend 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
PinNameDescription
1
1
1
2
1
3
4RTSRTS is an RS-423 compatible hardware handshaking output line. This line changes to a mark (1) state when the
5CTSCTS is an RS-423A compatible hardware handshaking input line. This line must be in a mark (1) state for the
6DSRDSR is a general purpose RS-423A compatible input line. The BASIC Module transmits or receives in the mark (1)
71,9,10Signal
8DCDIf 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,25422 TXDRS-422A compatible equivalent of the RS-423A TXD line. Differential serial output lines.
16, 18422 RXDDifferential RS-422A compatible serial input lines.
20DTRDTR 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
TXDTXD is an RS-423A compatible serial output port.
RXDRXD is an RS-423A compatible serial input data port.
Common
NCNo 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.
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
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.