![GSK 980TDi Скачать руководство пользователя страница 194](http://html1.mh-extra.com/html/gsk/980tdi/980tdi_user-manual_2275219194.webp)
Official GSK Agents in South Africa
Tel: +27 11 626 2720, [email protected]
GSK980TDi Turning CNC System User Manual
178
Ⅰ
Programming
When the variable #1 is more than 10, the system transfers to the block which serial
number is N2.
N2 G00 X10.0;
THEN format:
IF[conditional expression]THEN<macro program statement >;
When the condition expression is valid, the system executes only one statement following THEN.
Example:
IF[#1 EQ #2] THEN #3=0;
When #1 value is equal to the #2, 0 is assigned to the variable #3; when they are not equal, the
system orderly executes the followings instead of the assignment statement after THEN.
Conditional expression: the conditional expression must include the conditional operator, two
sides of conditional operator can be variable, constant or expression, and it must be closed with the
brackets ‘[’ ‘]’.
Conditional operator: the system uses the conditional operators listed in the following table.
Conditional operator
Meaning
EQ or = =
Equal to (=)
NE or <>
Not equal to (
≠
)
GT or >
More than (>)
GE or >=
More than or equal to (
≥
)
LT or <
Less than (<)
LE or <=
Less than or equal to (
≤
)
Example: IF[3<>2]GOTO 2; its meaning: when 3 is not equal 2, the system skips to N2 block;
IF[#101>=7.22]THEN #101=SIN30; its meaning: when #101 is more than or equal to
7.22, the system executes the assignment after THEN. i.e. the sine value of 30 degree
is assigned to the variable #101.
Typical program: the following program counts the sum of the integer 1~10.
3) Cycle (WHILE statement)
Specify one conditional expression after WHILE. When the specified conditional is valid, the
system executes the blocks between DO and END; otherwise, the system skips to the block after
END.
Example:
O9500
#1=0
;
… …the sum is initialized to be 0
#2=1
;
… …the summand number is initialized to be 1
N1 IF[#2 GT 10]GOTO2
;
… … the system skips to N2 when the summand is more than 10
#1= #1+#2
;
… …count the sum of two numbers
#2= #2+1
;
… … the summand adds 1
GOTO1
;
… … unconditionally skip to the block N1
N2 M30
;
… … end of program
Program
IF [#1GT10] GOTO2;
If the condition
is not met.
If the condition
is met.
Содержание 980TDi
Страница 17: ...Official GSK Agents in South Africa Tel 27 11 626 2720 design efamatic com 1 Programming I Programming...
Страница 225: ...Official GSK Agents in South Africa Tel 27 11 626 2720 design efamatic com 209 Operation II Operation...
Страница 379: ...Official GSK Agents in South Africa Tel 27 11 626 2720 design efamatic com 363 Connection III Connection...
Страница 539: ...Official GSK Agents in South Africa Tel 27 11 626 2720 design efamatic com 523 IV Appendix IV Appendix...