Table of Contents - TG Drives
Table of Contents - TG Drives Table of Contents - TG Drives
30 Compiler Symbols PL2 NATIVE POSITION LANGUAGE Reg, XReg, or instruction-dependent operators. Use parentheses to force the compiler to parse the expression if the expression is a const_expr.Format: [Let] Reg = Reg let_operator SConst [Let] XReg = XReg let_operator SConst Example: [Let] MyRegister = MyRegister * MyValue + 3 MyValue + 3 is a const_expr and is evaluated during compilation. indirect_reg Designates an internal 32-bit register and is accessed as R(Rnnn). COMPILER SYMBOLS A symbol can contain the letters “A” to “Z” and “a” to “z”, the underscore ’_’ character, and digits “0” to “9”. With the following restrictions: • The first character must be a letter or an underscore. • By default, the compiler recognizes only the first 64 characters as significant. VSymbol Alias for a value. A VSymbol can be used as an alias for const or const_expr. VSymbols are constant values and are defined using .DEFINE directives. Example: .DEFINE ENDPOS = 1000 .DEFINE STAPOS = ENDPOS + 2000 RSymbol Alias for a register. RSymbols that can be used as an alias for Reg. Rsymbols are constant values and are defined using .DEFINE directives. Example: .DEFINE REG12 = R12 .DEFINE MAXSPD = REG12 XSymbol Alias for an extended register. An XSymbol can be used as an alias for XReg. XSymbols are constant values and are defined using .DEFINE directives. Example: .DEFINE MPOLES = Motor.Poles .DEFINE MPOL = MPOLES ISymbol Alias for an indirect register address. An ISymbol can be used as an alias for an indirect_reg. ISymbols are constant values are defined using .DEFINE directives. Example: .DEFINE IDXREG = R(R40) .DEFINE IDX = IDXREG .DEFINE IDXFOO = R(REG12) ISymbol Alias for an indirect register address. An ISymbol can be used as an alias for an indirect_reg. ISymbols are constant values are defined using .DEFINE directives. Example: .DEFINE IDXREG = R(R40) .DEFINE IDX = IDXREG .DEFINE IDXFOO = R(REG12) User's Manual 5.1 Inmotion Technologies AB Doc. No.9032 0027 01 (B), Rev. 11.07.2001
PL2 NATIVE POSITION LANGUAGE Special Compiler Functions LSymbol Alias for line number. An LSymbol can be used as an alias for a line_number. Lsymbols are used when a line_number is referenced, such as: GOTO Start Vector.CycInt, @Cyclic Vector.PosErr, @Error line_number Line numbers can be specified in two forms: Absolute and Relative. The typical form is: label [:] program statement A label becomes an LSymbol if it starts with a character and ends with a colon symbol; this is the relative line_number form. Example: Start: Pg.Speed = 10000 The label can be a number, in which case the line number is absolute. 10 PG.Speed = 10000 The last definition has the side effect to define the location counter to 10, just as if it was preceded by the line: .ORG 10 The reason for this is that the PL compiler also should be able to compile programs uploaded from a motion controller. space_char The space character has significance in the DMC compiler. Example: L E T R 1 0 = 5 0 LETR10=50 The above statements are not equivalent, it must be typed as, LETR10=50 Or LETR10 = 50 PREDEFINED COMPILER SYMBOLS _DMC_ Is defined when the DMC compiler is used. _V0500_ Is defined if version 5 of the compiler is used SPECIAL COMPILER FUNCTIONS The Pl2 Language compiler has the following special mathematical functions: Sin (a ,b ,c) Cos (a ,b ,c) The Sine and Cosine can be used to calculate constant values for cam tables or similar applications. The functions are evaluated as: Sin (angle, period, amplitude) = amplitude * Sine(angle/period), angle/period is in radians Cos (angle ,period, amplitude) = amplitude * Cosine( angle/period ) User's Manual 5.1 Inmotion Technologies AB Doc. No.9032 0027 01 (B), Rev. 11.07.2001 31
- Page 1 and 2: HEAD OFFICE INMOTION TECHNOLOGIES A
- Page 3 and 4: Table of Contents Table of Contents
- Page 5 and 6: Related items .....................
- Page 7 and 8: Related items .....................
- Page 9: Creating/Editing Source Code ......
- Page 12 and 13: 12 System architecture register val
- Page 14 and 15: 14 B002 Timing and execution flow T
- Page 16 and 17: 16 Function Block Diagram SOFTWARE
- Page 18 and 19: 18 Function Block Diagram Figure 5.
- Page 20 and 21: 20 Function Block Diagram Function
- Page 22 and 23: 22 Load a new firmware release SOFT
- Page 24 and 25: 24 User's Manual 5.1 Inmotion Techn
- Page 26 and 27: 26 Argument types executing results
- Page 28 and 29: 28 Mnemonic Operators PL2 NATIVE PO
- Page 32 and 33: 32 Compiler directives PL2 NATIVE P
- Page 34 and 35: 34 Compiler directives Warnings: No
- Page 36 and 37: 36 Spline function compilation dire
- Page 38 and 39: 38 Multiline Macro MACRO DEFINITION
- Page 41 and 42: PL2 Mnemonics GENERAL The general f
- Page 43 and 44: PL2 MNEMONICS Standard set Mnemonic
- Page 45 and 46: PL2 MNEMONICS TRACE RELATED MNEMONI
- Page 47 and 48: PL2 MNEMONICS Indexed Addressing Mn
- Page 49 and 50: PL2 MNEMONICS If r_length < r_Membe
- Page 51 and 52: PL2 MNEMONICS Text mode \000 Intern
- Page 53 and 54: Extended register groups INTRODUCTI
- Page 55 and 56: EXTENDED REGISTER GROUPS STACK HAND
- Page 57 and 58: EXTENDED REGISTER GROUPS RD1, Resol
- Page 59 and 60: EXTENDED REGISTER GROUPS RD1, Resol
- Page 61 and 62: EXTENDED REGISTER GROUPS RD1.FiltSp
- Page 63 and 64: EXTENDED REGISTER GROUPS RD2, Resol
- Page 65 and 66: EXTENDED REGISTER GROUPS RD2, Resol
- Page 67 and 68: EXTENDED REGISTER GROUPS RD2.ChkLow
- Page 69 and 70: EXTENDED REGISTER GROUPS Pos Inc Pr
- Page 71 and 72: EXTENDED REGISTER GROUPS Pg.ASpeed
- Page 73 and 74: EXTENDED REGISTER GROUPS MOTOR, MOT
- Page 75 and 76: EXTENDED REGISTER GROUPS 2-Pole: 81
- Page 77 and 78: EXTENDED REGISTER GROUPS Motor.Base
- Page 79 and 80: EXTENDED REGISTER GROUPS REG, PID R
PL2 NATIVE POSITION LANGUAGE<br />
Special Compiler Functions<br />
LSymbol Alias for line number. An LSymbol can be used as an alias for<br />
a line_number. Lsymbols are used when a line_number is<br />
referenced, such as:<br />
GOTO Start<br />
Vector.CycInt, @Cyclic<br />
Vector.PosErr, @Error<br />
line_number Line numbers can be specified in two forms: Absolute and<br />
Relative. The typical form is:<br />
label [:] program statement<br />
A label becomes an LSymbol if it starts with a character and<br />
ends with a colon symbol; this is the relative line_number<br />
form.<br />
Example:<br />
Start: Pg.Speed = 10000<br />
The label can be a number, in which case the line number is<br />
absolute.<br />
10 PG.Speed = 10000<br />
The last definition has the side effect to define the location<br />
counter to 10, just as if it was preceded by the line:<br />
.ORG 10<br />
The reason for this is that the PL compiler also should be able<br />
to compile programs uploaded from a motion controller.<br />
space_char The space character has significance in the DMC compiler.<br />
Example:<br />
L E T R 1 0 = 5 0 LETR10=50<br />
The above statements are not equivalent, it must be typed as,<br />
LETR10=50<br />
Or<br />
LETR10 = 50<br />
PREDEFINED COMPILER SYMBOLS<br />
_DMC_ Is defined when the DMC compiler is used.<br />
_V0500_ Is defined if version 5 <strong>of</strong> the compiler is used<br />
SPECIAL COMPILER FUNCTIONS<br />
The Pl2 Language compiler has the following special mathematical functions:<br />
Sin (a ,b ,c)<br />
Cos (a ,b ,c)<br />
The Sine and Cosine can be used to calculate constant values for cam tables or<br />
similar applications.<br />
The functions are evaluated as:<br />
Sin (angle, period, amplitude) = amplitude * Sine(angle/period), angle/period is in<br />
radians<br />
Cos (angle ,period, amplitude) = amplitude * Cosine( angle/period )<br />
User's Manual 5.1 Inmotion Technologies AB<br />
Doc. No.9032 0027 01 (B), Rev. 11.07.2001<br />
31