String support calls – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 112

Advertising
background image

Operating Functions

Chapter 5

5–75

5.10.2.2
Cursor Positioning on an Industrial Terminal

Allen-Bradley Industrial Terminal – Refer to the Industrial Terminal User’s
Manual (publication number 1770-6.5.3), Table 6-3. You can control
cursor positioning by typing:

(CTRL)(P)(COLUMN#)(;)(ROW#)(A).

The ASCII equivalent of (CTRL)(P) is DLE. Using Appendix B, the DEC
equivalent of ASCII DLE is 16.

PRINT CHR(16), “40;10ATEST”

This prints “TEST” at column 40 row 10 on your Allen-Bradley Industrial
Terminal.

To enhance the BASIC Module we have added several string manipulation
routines that make programming easier. Strings in the BASIC Module are
declared by the STRING statement. You must execute the STRING
statement before you can access or call any strings or string routines. The
STRING statement has two arguments or numbers that follow it. They are:

the total amount of space to allocate to string storage and,

the maximum size in characters of each string.

Since you terminate strings using a carriage return character, each string is
given an extra byte of storage for its carriage return if it is the maximum
length. You can determine the number of strings allowed by taking the first
number and dividing it by one plus the second number. Note that you must
use the strings consecutively starting with string 0 through the allowed
number of strings. All strings are allocated the maximum number of
characters regardless of the actual number used.

All of these routines use or modify strings as part of their operation. The
mechanism for passing a string to the support routine is to PUSH its
number or subscript onto the stack. The support routine can then get the
string number from the module’s argument stack, and locate it in string
memory.

Many of these routines also require the length of a string as an input. This
number must normally be inclusively between zero and the second number
used in the last STRING statement which specifies the maximum size of a
string. However, in all cases, if a string length argument of minus one ( -1)
is given, it is interpreted as the maximum allowable string length.

5.10.2
The CHR Operator
(continued)

5.10.3
String Support Calls

Advertising