C Control I Unit-M 2.0 BASIC 5 Vdc Inputs / outputs 16 x digital I/Os/8 x analog or digital I/Os/2 x analogue outputs (s 198822 Hoja De Datos

Los códigos de productos
198822
Descargar
Página de 73
Wandlung von Datenformaten
FLOAT(Term oder Variable)
Wandlung eines Term oder einer Variable von INTERGER zu  FLOAT
INT(Variable)
-  Wandlung einer Variablen von FLOAT nach INTEGER
Schleifen mit reinen Float Variablen
Schleifen mit gemischten Datentypen
FUNCTIONS mit Parameterübergabe und Rückgabe
6
MyFloat = FLOAT(MyWord) 
MyFloat = MyFloat*FLOAT(MyWord) 
MyFloat = MyFloat*FLOAT(MyWord*MyWord) 
MyFloat = MyFloat*FLOAT(MyWord*MyByte) 
MyWord = INT(MyFloat)
MyWord = 3*INT(MyFloat)/MyWord
MyByte = 3*INT(MyFloat)/MyWord
COUNTER=123.4567
ENDVALUE=999.567
'---- FOR COUNTER=123.4567 TO 999.567 STEP 0.123 ----
DO
COUNTER=COUNTER+0.123
LCD.POS 1,1
LCD.PRINT COUNTER & "          "
LOOP UNTIL (COUNTER>ENDVALUE) 
FOR LOOPCOUNTER=0 TO 3000 
RESULT=FLOAT(LOOPCOUNTER)/10.9
LCD.POS 2,1
LCD.PRINT RESULT & "      "
NEXT 
FUNCTION MyFunction(FVAL1 as FLOAT,FVAL2 as FLOAT)
. . . . . . . 
MyFunction=FVAL1*FVAL2
. . . . . . . 
END FUNCTION 
FLOATVAR=MyFunction(10.9, 33.0)