Milltronics PL-551 Informacje Techniczne Strona 340

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 441
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 339
SECTION SIX - PARAMETRIC PROGRAMMING
Rounds (ROUND) rounds a decimal value to an integer value.
Values halfway in-between are rounded up.
ROUND [2.3] = 2
ROUND [7.88] = 8
ROUND [1.5] = 2
ROUND [-1.5] = -2
Values exactly halfway between are rounded to the nearest even number.
ROUND [2.5] = 2
ROUND [3.5] = 4
Mathematic expressions
Any combination of the previously described expressions are made up of arithmetic functions.
Examples: X[SIN[P123]*COS[P124]]
Y[2.5+[P2/P3]*SQRT[P4]]
Z[[P2DIV3]+[P2MOD3]]
Conditional statements
The Centurion 6 supports two types of conditional statements. These statements are used to
transfer control of a program from one point to another based on some condition generated in the
program. These statements are the IF-THEN statement and the WHILE-WEND statement.
IF-THEN
The IF-THEN statement is a way of conditionally executing a block if the results of an
expression evaluates to true. The expression must contain one of the relational operators which
allows the expression to be reduced to either true or false. If the expression is true, the THEN
portion of the IF statement is executed. If the expression is false, the next line after the IF-THEN
statement is executed.
Example of General Form:
[any ] (relational) [any ]
If [mathematical] (operator ) [mathematical] Then any action
[expression ] [expression ]
N20 IF P1 LT P2 THEN GOTO 15
N21
or
N22 IF P1 < P2 GOTO 15
N21
326
Przeglądanie stron 339
1 2 ... 335 336 337 338 339 340 341 342 343 344 345 ... 440 441

Komentarze do niniejszej Instrukcji

Brak uwag