**Calculation Parameters R**
1. **Function**
The calculation parameter R allows an NC program to be not only suitable for a specific machining operation at a given value, but also to dynamically calculate the required value during runtime. These parameters can be used in both scenarios—either calculated automatically or manually set. The values of these parameters can be adjusted through the operation panel. Once assigned, they can be linked to the addresses defined by variables in the program.
2. **Programming**
You can assign values to R parameters using the format:
`R0=...`
`R1=...`
...
`R249=...`
3. **Description**
There are 250 available calculation parameters in total.
- R0 to R99: Free to use for general calculations.
- R100 to R249: Used as transfer parameters for machining cycles. If you're not using a machining cycle, these can also be freely used for other purposes.
4. **Assignment**
**Example One:**
`R0=3.5678`, `R1=-37.3`, `R2=2`, `R3=-7`, `R4=-45678.1234`
You can also use exponential notation to assign larger ranges of values, such as from `10^-300` to `10^+300`.
The exponent is written after the `EX` symbol. The maximum number of characters allowed is 10 (including symbols and decimals).
Example Two:
`R0=-0.1EX-5` means `R0 = -0.0000001`
`R1=1.874EX8` means `R1 = 187,400,000`
Note: Multiple assignments can be made within one block. Expressions can also be used for assignment.
5. **Address Assignment**
By assigning R parameters to NC addresses, the flexibility and versatility of the NC program increase significantly. Values, arithmetic expressions, or other R parameters can be assigned to any NC address. However, there are exceptions for addresses N, G, and L.
When assigning values, place the `=` symbol after the address character. Negative signs can also be included.
For axis addresses (like X, Y, Z), each assignment must be on a separate block.
Example:
`N10 G0 X=R2 ; Assigning R2 to the X-axis`
6. **Calculation Rules**
The calculation parameters follow standard mathematical rules. Parentheses have the highest priority, followed by multiplication and division, then addition and subtraction.
---
**Second Tag – Program Jump Target**
1. **Function**
- Tags are used to mark jump targets in the program. They enable branching and control flow.
- A tag must consist of two characters, starting with a letter or an underscore.
- The colon (`:`) must follow the tag name. It should be placed at the beginning of the program segment. If the segment has a sequence number, the tag comes after it.
- A tag cannot appear in the same line as any other instruction.
2. **Program Examples**
`N10 MARKE1: G1 X20 ; Marke1 is a tag, a jump target`
`...`
`TR789: G0 X10 Z20 ; TR789 is a tag, no sequence number`
---
**Absolute Jump**
1. **Function**
The NC program runs in the order it is written. You can change the execution order by inserting a jump instruction. The target must be a tagged block within the same program. Absolute jumps require their own block.
2. **Programming**
- `GOTOF Label` – Forward jump (to the end of the program)
- `GOTOB Label` – Backward jump (to the start of the program)
- `Label` refers to the tag name.
- AWL instructions may also be used for jumps.
---
**Four Conditional Jumps**
1. **Function**
Conditional jumps use the `IF` statement to check a condition. If the condition is true (non-zero), the program jumps to the target label. The target must be a valid block within the program. Each conditional jump requires its own block. Using conditions can simplify complex logic.
2. **Programming**
- `IF condition GOTOF Label` – Jump forward if condition is met
- `IF condition GOTOB Label` – Jump backward if condition is met
3. **Comparison Operators**
| Operator | Meaning |
|----------|-------------------|
| `==` | Equal |
| `<>` | Not equal |
| `>` | Greater than |
| `<` | Less than |
| `>=` | Greater than or equal |
| `<=` | Less than or equal |
These operators can be used in expressions to define jump conditions. If the condition is not satisfied, the result is zero.
4. **Examples**
- `R1 > 1`
- `1 < R1`
- `R1 < R2 + R3`
- `R6 >= SIN(R7 * R7)`
---
**Five Program Jump Example**
Here’s a sample code snippet:
```
G54 X0 Y0 Z10 F100 M03 S100
R10 = -15 R11 = -9.06
L1
R10 = 15 R11 = -9.06
L1
R10 = 0
L2
```
Subroutine L1:
```
G0 X=R10 + 12.5 - 4 Y=R11
G1 Z-6 F100
G3 I=4 - 12.5
G1 X=R10 + 8 Y=R11
G41 D1 X=R10 + 4 Y=R11
G2 I-4
G0 Z5
R1 = 4
R2 = 90
AAA:
R3 = R1 * COS(R2) + 4 + R10
R4 = R1 * SIN(R2) - R1
G0 X=R3 Y=R11
G1 Z=R4 F300
G2 I=R10 - R3
G0 Z1
R2 = R2 - 1
IF R2 >= 0 GOTOB AAA
G0 Z10
M17
```
Subroutine L2:
```
R1 = 35
R2 = 15
R3 = 0
G0 X=R1 + R10 Y=R11
G1 Z-5 F100
AAA:
R4 = R1 * COS(R3) + R10
R5 = R2 * SIN(R3) + R11
G1 X=R4 Y=R5 F100
R3 = R3 + 1
IF R3 <= 360 GOTOB AAA
G0 Z5
M17
```
---
**Six Subroutines**
1. **Application**
There is no fundamental difference between main programs and subroutines. Subroutines are useful for repeated operations, such as cutting a specific contour. Machining cycles are also considered subroutines. By assigning calculation parameters, different processes can be performed.
2. **Structure**
A subroutine is structured similarly to a main program. It ends with an `M2` or `RET` command, returning control to the main program.
3. **End of Program**
- `M2` ends the program and stops the machine.
- `RET` ends the subroutine without interrupting the continuous path mode (`G64`).
Using `M2` will stop the machine and exit the continuous path mode.
4. **Subroutine Naming**
Choose a name that starts with a letter, followed by letters, numbers, or underscores. It can be up to 8 characters long and must not conflict with main program names.
5. **Calling Subroutines**
Subroutines can be called directly by their name. Each call must be in a separate block.
Example:
`N10 L785 P3 ; Call subroutine L785 three times`
`N20 WELLE7 ; Call subroutine WHEE7`
6. **Repetition**
If a subroutine is called multiple times, the number of repetitions can be specified using the `P` address. The maximum is 9999 (e.g., `P1` to `P9999`).
7. **Nesting**
Subroutines can be nested up to three levels deep, including the main program. Note that machining cycle programs are also considered level one.
8. **Modal Functions**
When returning from a subroutine, ensure all modal functions (like G90/G91) are properly reset. Avoid modifying higher-level R parameters unless necessary.
Longtrack Tyre,Low Noise Tires,Tires With Excellent Wear Resistance,Tires With Superior Handling Performance
WINMAX AND MACROYAL TYRE GROUP , https://www.glamorcorp.com