Official GSK Agents in South Africa
Tel: +27 11 626 2720, [email protected]
Chapter 3 G Commands
177
Ⅰ
Programming
ii. When #j exceeds the range from -1 to 1, the system alarms P/S.
iii. The constant replaces the variables #j.
4. Arc tangent #i=ATAN[#j]/[#k]
Specify the lengths of two sides and separate them with a slash “/”.
i. Result output range:
When No.180#7 NAT is set to 1: 90°~ 270°;
[For example] #1=ATAN[-1]/[-1]: #1=225°;
When No.180#7 NAT is set to 0 -90°~ 90°;
[For example]#1=ATAN[-1]/[-1]: #1=45.0°;
ii. The constant replaces the variables #j.
5. Natural logarithm #i=LN[#j]
The constant replaces the variables #j
6. Exponential function #i=EXP[#j]
The constant replaces the variables #j
7. ROUND function
When arithmetical operation or logic operation IF or WHILE includes ROUND, ROUND rounds in
the first decimal place.
For example: #1=ROUND[#2]: #2=1.2345, the variables 1 is 1.0.
8. FUP FIX
After CNC executes the operation, the result integer absolute value is bigger the previous
absolute value, which is called FUP; the result integer absolute value is less than the one, which is
call FIX. Pay more attention to the negative execution.
Example:
Hypothetically, #1=1.2, #2= -1.2
When #3=FUP[#1] is executed, 2.0 is assigned to #3.
When #3=FIX[#1] is executed, 1.0 is assigned to #3.
When #3=FUP[#2] is executed, -2.0 is assigned to #3.
When #3=FIX[#2] is executed, -1.0 is assigned to #3.
3.28.2 Transfer & Cycle
In the program, the system uses GOTO and IF statement to change the control flow. There are
three types of transfer and cycle operation.
1. GOTO statement (unconditional transfer).
2. Condition control IF statement.
3. WHILE cycle statement.
1) Unconditional transfer (GOTO statement )
Transfer to the block which serial number is n. The system alarms when others exceeds the
range from 1 to 99999, and it specifies the serial number with the statement.
Format:
GOTO n; n: serial number(1~99999)
Example:
GOTO 1;
GOTO #101;
2) Conditional control (IF statement )
GOTO format:
IF[ conditional statement]GOTO n;
When the specified conditional statement is valid, the system transfers to the block which serial
number is n; When the specified conditional statement is valid, the system executes the next block.
Example: