ACR Electronics FPR-10 PROGRAMMER Manuel Page 62

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 199
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 61
Parker Hannifin
62 Programmer’s Guide
Example 2
When the following IF statement proves true, the message “OK”
prints.
IF(P0=1234) THEN PRINT “ok”
Example 3
The following concatenates strings $V1 and $V2, and sets string $V0
equal to the result.
$V0 = $V1 + $V2
Example 4
The following program generates a random number from 0 to 999.
As the program loops, it counts each loop. When the number equals
123, the program exits the loop and prints the count.
PROGRAM
DIM LV(2) : REM dimension 2 long variables
LV0=0 : REM set LV0 equal to 0
_LOOP1
LV1=RND(1000) : REM set LV1 equal to random number
LV0=LV0+1 : REM increment LV0 with each loop
IF (LV1<>123) THEN GOTO LOOP1
PRINT “Done in”;lv0;”tries”
ENDP
Example 5
The following flashes the first 30 outputs in a random sequence.
PROGRAM
DIM DV(1) : REM dimension 1 floating point variable
_LOOP2
DV0=RND(4294967295) : REM set DV0 equal to random number
P4097= DV0 : REM set onboard outputs equal to DV0
GOTO LOOP2
ENDP
Vue de la page 61
1 2 ... 57 58 59 60 61 62 63 64 65 66 67 ... 198 199

Commentaires sur ces manuels

Pas de commentaire