36 varptr! function – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 104

Advertising
background image

7Ć16

slave_reg is a variable name or expression of type string

representing the starting register in the device that is to be read

from or written to. The format of this parameter is dependent on

the module used. See the instruction manual for the specific

Interface module for the correct format.
master_var is a variable name or expression of type double

integer, representing the actual hexadecimal address of the first

location that is to be read from or written to in the Interface

module. See below for more information.
num_regs is variable name or expression of type integer that

defines the number of bits or registers (16 bits each) to be

transferred; cmd_code determines whether the variable

represents bits or registers. Note that if you are transferring

double integer (32Ćbit) variables, the număregs parameter must

specify the number of 16Ćbit variables to move. For example, if

you want to move two double integer variables starting at

address 270480H, număregs must be equal to 4.

The masterăvar parameter can be specified using any one of the

three methods described below.
1. The absolute hexadecimal address of the first bit, integer, or

double integer on the Interface module to be read or written. For

example:

270480H

2. A variable name which represents the absolute hexadecimal

address of the first bit, integer, or double integer on the Interface

module to be read or written. Typically, the VARPTR! function is

used to yield the absolute address. For example, if in your task

you define the following:

ADDRESS! = VARPTR! (FIRSTăREG%)

then you can use ADDRESS! as the masterăvar parameter. This

assumes that FIRSTăREG% has been defined as a 16Ćbit integer

variable on the Interface module

3. An expression which, when solved, will yield an absolute

hexadecimal address of the first bit, integer, or double integer to

be read or written. For example, the masterăvar parameter could

be:

VARPTR! (FIRSTăBIT@)

where FIRSTăBIT@ has been defined as a boolean on the

Interface module.

For more detailed information, see the instruction manual for each

specific Interface module.

7.36

VARPTR! Function

Format:

VARPTR!(variable)

where:

variable is a common boolean (single bit), integer (16 bits), or

double integer (32 bits) defined in the configuration as the

Advertising
This manual is related to the following products: