WR6K-OM-E Rev A
ISSUED: October 2003
271
At this point, the quantity represented by A has not been changed. Only at the end of the
calculation is the final value placed in the memory location labeled A.
Note that you can write more than one statement on a line, separated by colons, like this
A = B * Cos (34 * Theta) * Sin (55 * Theta) : B = A * A + Z * Z
Order of Calculations
Operations are performed in the following order:
1.
Contents of brackets
2.
Exponentiation
3.
Division and multiplication
4.
Addition and subtraction
If there is any doubt as to how the calculation will be done, use brackets. These will also make
the order of the calculations clear to any reader of the program, which is desirable if you are to
give it to a customer, who will want to know what was intended.
Here are some examples of the uses of brackets:
Brackets are worked out before any other operations are performed.
Use brackets to force the result you want, and also to clarify a calculation.
A 1 1 1 1 1 1 1 1 255 0 1 0 1 1 0 1 0 90
(B OR C) AND (D OR E)
B 1 1 1 1 0 0 0 0 240 0 0 0 0 0 0 0 0 0
B OR (C AND D) OR E
C 1 0 1 0 1 0 1 0 130 1 1 1 1 1 0 1 0 250 B OR (C AND (D OR E))
D 0 1 0 1 0 1 0 1 85 0 1 0 1 1 1 1 1 95
((B OR C) AND D) OR E)
E 0 0 0 0 1 1 1 1 15
F 0 0 0 0 0 0 0 0 0
A 7
315 A * B * (C / D) * E * F
B 6
8.75 A * B * C / (D * E * F)
C 5
35
A * B * (C / (D * E) ) * F
D 4
E 3
F 2
Check these results to see whether any errors, deliberate or otherwise, have been introduced.
Summary of Contents for 6000 SERIES
Page 65: ...WR6K OM E Rev A ISSUED October 2003 63 Proper Orientation of Drive ...
Page 131: ...WR6K OM E Rev A ISSUED October 2003 129 Example ...
Page 141: ...WR6K OM E Rev A ISSUED October 2003 139 ...
Page 236: ...Operator s Manual 234 ISSUED October 2003 WR6K OM E Rev A Example 6 ...
Page 261: ...WR6K OM E Rev A ISSUED October 2003 259 ...
Page 286: ...Operator s Manual 284 ISSUED October 2003 WR6K OM E Rev A ...
Page 304: ...Operator s Manual 302 ISSUED October 2003 WR6K OM E Rev A ...
Page 307: ...WR6K OM E Rev A ISSUED October 2003 305 Convolve two signals ...
Page 348: ...Operator s Manual 346 ISSUED October 2003 WR6K OM E Rev A ...
Page 402: ...Operator s Manual 400 ISSUED October 2003 WR6K OM E Rev A ...