=                Assign a 32-bit local TML variable with data got from another axis

Syntax                        

VAR32D = [Axis] VAR32S

local VAR32D = [A] VAR32S

VAR32D = [Axis] VAR32S, DM

local VAR32D = [A] VAR32S, DM

VAR32D = [Axis] (VAR16S), TypeMem

local VAR32D = [A] &(VAR16S), TM

VAR32D = [Axis] (VAR16S+), TypeMem

local VAR32D = [A] &(VAR16S), TM, then V16S+=2

 

Operands        VAR32x: long variable VAR32x

               Axis: an integer 1 to 255 representing the Axis ID of the source axis

DM: data memory operand

TypeMem: memory operand. One of dm (0x1), pm (0x0) or spi (0x2) values

(VAR16x): contents of variable VAR16x, representing a 16-bit address of a variable

PlaceTML

Binary code

DescriptionAssigns a 32-bit local TML variable with data got from another axis. The source on the remote axis can be: a 32-bit TML variable or 2 consecutive memory location with lower address indicated by a 16-bit TML variable (a pointer) from the remote axis. If the pointer variable is followed by a + sign, after the assignment, it is incremented by 2.

Remark: If the TML variables from the remote axis are user variables, these must be declared in the local axis too. Moreover, for correct operation, these variables must have the same address in both axes, which means that they must be declared on each axis on the same position. Typically, when working with data transfers between axes, it is advisable to establish a block of user variables that may be the source, destination or pointer of data transfers, and to declare these data on all the axes as the first user variables. This way you can be sure that these variables have the same address on all the axes.

The memory location can be of 3 types: RAM for data (dm), RAM for TML programs (pm), EEPROM SPI-connected for TML programs (spi).

TypeMem

One instruction uses a 9-bit short address for the source variable. Bit value X specifies the destination address range:

Addressrange

All predefined or user-defined TML data are inside these address ranges, hence these instructions can be used without checking the variables addresses. However, considering future developments, the TML also includes assignment instructions using a full address where the destination address can be any 16-bit value. In this case destination variable is followed by “,dm”.  

 

Execution        Copies a 32-bit value from the remote source to the local destination

 

Example1        

long VarLoc, VarExt;

VarLoc = [15]VarExt;

 

Before instruction

 

After instruction

VarLoc on local axis

x

 

VarLoc on local axis

0x1234ABCD

VarExt on axis 15

0x1234ABCD

 

VarExt on axis 15

0x1234ABCD

 

Example2        

long VarLoc, VarExt;

...

VarLoc = [15]VarExt, dm;

 

Before instruction

 

After instruction

VarLoc on local axis

x

 

VarLoc on local axis

0xF0E1A2B3

VarExt on axis 15

0xF0E1A2B3

 

VarExt on axis 15

0xF0E1A2B3

 

Example3        

long VarLoc;

int pVarExt;

...

VarLoc = [15](pVarExt), dm;

 

Before instruction

 

After instruction

pVarExt on axis 15

0x1234

 

pVarExt on axis 15

0x1234

At dm address 0x1234 on axis 15

0xFEDC

 

At dm address 0x1234 on axis 15

0xFEDC

At dm address 0x1235 on axis 15

0x2233

 

At dm address 0x1235 on axis 15

0x2233

VarLoc on local axis

x

 

VarLoc on local axis

0x2233FEDC

 

Example4        long VarLoc;

int pVarExt;

...

VarLoc = [15](pVarExt+), dm;

 

Before instruction

 

After instruction

pVarExt on axis 15

0x1234

 

pVarExt on axis 15

0x1236

At dm address 0x1234 on axis 15

0xFEDC

 

At dm address 0x1234 on axis 15

0xFEDF

At dm address 0x1235 on axis 15

0x2233

 

At dm address 0x1235 on axis 15

0x2233

VarLoc on local axis

X

 

VarLoc on local axis

0x2233FEDC