Rockwell-automation 9301 Series RSView32 Users Guide Manuel d'utilisateur Page 523

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 769
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 522
14–10 RSView32 User’s Guide
Arithmetic operators
Arithmetic operators calculate values based on two or more numeric
values. The arithmetic operators are:
String operands
The + operator can be used to join string operands. For example, the
expression “hello” + “world” returns: helloworld.
Symbol Operator Example
(For these examples, tag1 = 5 and tag2 = 7)
+ addition tag1 + tag2
returns a value of 12
- subtraction tag1 - tag2
returns a value of –2
* multiplication tag1 * tag2
returns a value of 35
/ division tag1 / tag2
returns a value of 0.7142857
MOD, % modulus (remainder) tag2 MOD tag1
returns a value of 2
The modulus operator is the remainder of one number
divided by another. For example, the remainder of 13
divided by 5 is 3; so 13 % 5 = 3.
Important: This operator is for integers only, not floating
point numbers.
** exponent tag1 ** tag2
returns a value of 78125
Be sure that any tag value you use as a divisor cannot at some point
have a value of zero. Expressions that attempt to divide a number by
zero produce an error at runtime.
IMPORTANT
Vue de la page 522
1 2 ... 518 519 520 521 522 523 524 525 526 527 528 ... 768 769

Commentaires sur ces manuels

Pas de commentaire