TML Data |
The TML works with the following categories of data: All TML data are identified by their name. The names of the TML registers, parameters or variables are predefined and do not require to be declared. The names of the user variables are at your choice. You need to declare the user variables before using them. The TML uses the following data types:
The data type uint or ulong are reserved for the TML predefined data. The user-defined variables are always signed. Hence you may declare them of type: int, fixed or long. Remark: An unsigned TML data means that in the firmware its value is interpreted as unsigned. Typical examples: register values, time-related variables, protection limits for signals that may have only positive values like temperature or supply voltage, etc. However, the same data will interpreted as signed if it is used in a TML instruction whose operands are treated as signed values. Each TML data has an associated address. This represents the address of the data memory location where the TML data exists. Address ranges for TML registers, variables and parameters are from 0x0200 to 0x03AF and from 0x0800 to 0x09FF. For user-defined variables the address range is between 0x03B0 and 0x03FF. In TML the data components may be addressed in several ways:
Example: CPOS = 2000; // write 2000 in CPOS parameter (command position)
Example: user_var = 0x29E; // write hexadecimal value 0x29E representing CPOS address in // the user-defined pointer variable user_var (user_var),dm = 2000; // write 2000 in the data memory address pointed by // user_var i.e. in the CPOS parameter
Example: CPOS,dm = 2000; // write 2000 in CPOS using direct mode with extended address In the TML instructions the operands (variables) are grouped into 2 categories:
Remarks:
Examples: CPOS(L) = 0x4321; // write hexadecimal value 0x4321 in low part of CPOS CPOS(H) = 0x8765; // write hexadecimal value 0x8765 in high part of CPOS // following the last 2 commands, CPOS = 0x87654321
Examples: user_var = 0x29E; // write CPOS address in pointer variable user_var (user_var),dm = 1000000;// write 1000000 (0xF4240) in the CPOS parameter i.e. // 0x4240 at address 0x29E and 0xF at next address 0x29F (user_var),dm = -1;// write -1 (0xFFFF) in CPOS(L). CPOS(H) remains unchanged (user_var),dm = -1L;// write –1 seen as a long variable (0xFFFFFFFF) in CPOS i.e. // CPOS(L) = 0xFFFF and CPOS(H) = 0xFFFF user_var = 0x2A0; // write CSPD address in pointer variable user_var (user_var),dm = 1.5; // write 1.5 (0x18000) in the CSPD parameter i.e. // 0x8000 at address 0x2A0 and 0x1 at next address 0x2A1
Examples: user_var = 0x29E; // write CPOS address in pointer variable user_var (user_var+),dm = 1000L; // write 1000 seen as long in CPOS, then increment // user_var by 2 (user_var+),dm = 1000; // write 1000 seen as int at address 0x29A (0x29E+2) , // then increment user_var by 1
TML Data categories:
Basic Concepts next topics: Memory Map – Firmware version FAxx Memory Map – Firmware version FBxx
See also: |