beautypg.com

Mtop, Cby([expr]), Dby([expr]) – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 38

background image

Publication 1746-RM001A-US-P

3-16 Expressions and Operators

MTOP

Use the MTOP operator to retrieve the last valid memory address in RAM that is
available to the module. After reset, the module sizes the external memory and
assigns the last valid memory address to the system control value MTOP. The
module does not use any external RAM beyond the value assigned to MTOP. If this
value has not been changed by CALL 77, then the last valid BASIC address is
5FFFH (24575).

CBY([expr])

Use the CBY operator to retrieve data from the program or code memory address
location of the module. You cannot assign CBY a value; it can only be read. The
argument for the CBY operator must be a valid integer between 0 and 65535
(0FFFFH). If it is not a valid integer, a bad argument error occurs.

DBY([expr])

Use the DBY operator to retrieve or assign data to or from the internal data
memory of the module. Both the value and the argument in the DBY operator
must between 0 and 255 inclusive. This is because there are only 256 internal
memory locations in the module and one byte can only represent a quantity
between 0 and 255 inclusive.

Example

Result

>PRINT MTOP

24575

PH0.MTOP

5FFFH

IMPORTANT

Improper use of this operator may cause a malfunction of the
module.

Example

Result

A = CBY(1000)

The value in the program or code memory address location 1000 is
assigned to variable A.

IMPORTANT

Improper use of this operator may cause a malfunction of the
module.

Example

Result

A = DBY(B)

The value in internal memory location B is assigned to
variable A. B must be between 0 and 255.

DBY(250) = CBY(1000)

The value in program or code memory location 1000 is
assigned to internal memory location 250.