Assignment & Data Transfer - Setup 32-bit variable

The “Assignment and Data Transfer – 32-bit Long or Fixed Data” dialogue helps you:

1.Assign a value to a 32-bit long or fixed TML parameter/variable
2.Assign a value to the high (16MSB) or low (16LSB) part of a 32-bit long or fixed data
3.Transfer in 2 consecutive memory locations, a 32-bit value or the value of a 32-bit long or fixed TML parameter or variable

 

a32

Select Set 32-bit variable to assign a value to a 32-bit long or fixed TML parameter or variable. Introduce its name and choose one of the possible sources:

With value / 32 bit variable:  A 32-bit value or the value of a 32-bit variable. Introduce in the associated field the value or the variable name.
With data / program / E2ROM memory contents located at address set in pointer variable: The value of 2 consecutive memory locations. The first memory address (the lowest) is provided by another 16-bit (pointer) variable. Introduce in the associated field the pointer variable name. Check then increment the pointer variable to automatically increment by two the pointer value, after the assignment is done. This option is particularly useful for repetitive assign operations where source is placed in successive memory locations. The memory type is split into 3 categories: data – for the RAM area for TML data, program – for the RAM area for TML programs and E2ROM – for the EEPROM area for TML programs.

Remark: The data memory may be used to extend the number of user-defined variables. By data exchanges with TML variables, the data memory locations may be used as a temporary buffer. Work for example for these operations with the RAM locations reserved but not used by the cam tables.

With inverse (-) of variable: The inverse (negate) value of a 32-bit TML parameter or variable. Introduce in the associated field the variable name
With 16-bit value of variable…left shifted with: The value of a 16-bit TML data, left shifted with 0 to 16 bits. Introduce in the associated fields the variable name and the shift value.

Select Set low / high part of 32-bit variable… with value/16-bit variable…to copy a 16-bit data into the higher or lower 16-bits or a 32-bit TML data. The 16-bit data can be either an immediate value or a 16-bit TML data. Choose low or high part and introduce in the associated field the value or the variable name.

Remarks:

The left shift operation is done with sign extension. If you intend to copy the value of an integer TML data into a long TML data preserving the sign use this operation with left shift 0
If you intend to copy the value of a 16-bit unsigned data into a 32-bit long variable, assign the 16-bit data in low part of the long variable and set the high part with zero.

Select Set data / program / E2ROM memory contents located at address set in the pointer variable to transfer in 2 consecutive memory locations, a 32-bit value or the value of a 32-bit integer TML parameter or variable. The first memory address (the lowest) is provided by another 16-bit (pointer) variable. Introduce in the associated field the pointer variable name and the 16-bit value or the variable name. Check then increment the pointer variable to automatically increment by two the pointer value, after the assignment is done. This option is particularly useful for repetitive assign operations where destination is placed in successive memory locations. The memory type is split into 3 categories: data – for the RAM area for TML data, program – for the RAM area for TML programs and E2ROM – for the EEPROM area for TML programs.

Remark: When this operation is performed having as source an immediate value, the TML compiler checks the type and the dimension of the immediate value and based on this generates the binary code for a 16-bit or a 32-bit data transfer. Therefore if the immediate value has a decimal point, it is automatically considered as a fixed value. If the immediate value is outside the 16-bit integer range (-32768 to +32767), it is automatically considered as a long value. However, if the immediate value is inside the integer range, in order to execute a 32-bit data transfer it is necessary to add the suffix L after the value, for example: 200L or –1L.

OK: Close this dialogue and save the assignment or data transfer in your motion sequence list.

Cancel: Close this dialogue without anything in your motion sequence list.

Help: Open this help page.

 

See also:

Assignment and Data Transfer: 32-bit data – TML Programming Details

Motion Programming