Data Types - Rockwell Automation Allen-Bradley SLC 500 BASIC Reference Manual

Hide thumbs Also See for Allen-Bradley SLC 500 BASIC:
Table of Contents

Advertisement

Data Types

1
Data Types
This chapter provides you a method of defining or displaying data within the
BASIC programming language through the use of:
• data types
• variables
Data types are broken down into three sections: argument stack, string and
numeric elementary data types, and backplane conversion data.
Argument Stack
The argument stack (A-stack) stores all constants that the BASIC or BASIC-T
module is currently using. Operations such as add, subtract, multiply, and divide
always operate on the first two numbers of the argument stack and return the result
to the stack. The argument stack is 203 bytes long. Each floating point number
placed in the stack requires 6 bytes of storage. The argument stack can hold up to
33 floating point numbers before overflowing.
In addition, the PUSH command saves data to the argument stack and the POP
command restores data from the stack. PUSHes and POPs are typically associated
with CALLs. PUSHes and POPs are mechanisms used to transfer information to
and from CALL routines.
PUSH makes a copy of the variable being PUSHed, then puts that copy on the top
of the argument stack. POP takes the value on the top of the argument stack and
copies it to the variable being POPped.
String Data Types
A string is a character or group of characters stored in memory. Usually, the
characters stored in a string make up a word or a sentence. Strings allow you to use
characters instead of numbers. Strings are shown as:
$([expr])
The module uses single-dimension string variables,
a string variable (the
define and manipulate 255 different strings in the module. Initially, no memory is
allocated for strings. Memory is allocated using the STRING statement. Strings are
declared and manipulated through the $ operator.
value) ranges from 0 to 254. This means that you can
2
Chapter
. The dimension of
Publication 1746-RM001A-US-P

Advertisement

Table of Contents
loading

This manual is also suitable for:

Allen-bradley slc 500 basic-t1746-bas1746-bas-t

Table of Contents