Precautions When Using The Mathematical Function - Omron NT631 Series Reference Manual

Programmable terminals
Hide thumbs Also See for NT631 Series:
Table of Contents

Advertisement

Mathematical Function

2-18-3 Precautions When Using the Mathematical Function

Combining One-word
and Two-word Operands
Calculation Errors
Downloaded from
Elcodis.com
electronic components distributor
that the calculations were performed. (All of the calculation results are ex-
amined.)
4. If any results have changed, the new results are written to the corresponding
numeral memory table or word allocated in the host.
The host will not be notified that new results have been written to the numer-
al memory table, but the same results will be written to words in the host if the
numeral memory tables have been allocated in the host.
5. Once all of the results have been written, the PT returns to step 1 and reads
all of the values to be used as operands again.
While the PT is operating, the processing in steps 1 through 5 is repeated cycli-
cally. Execution of the calculations cannot be stopped during operation.
When both one-word and two-word operands have been used in the same for-
mula, the calculation will be performed using two-word operands and the cal-
culation result will be stored using the same number of words as the last calcula-
tion result.
If the result cannot be stored in the number of words used in the last calculation
result (overflow or underflow), the result will not be stored and the last result will
remain valid.
Whenever possible, use the same size operands within each formula. In the fol-
lowing example, the size of the operands or result refers to the number of words.
• Example: Size of result = Largest operand in the formula
N0000
=
N0001
(1 word)
(1 word)
The calculation on the right is performed as a one-word calculation and the re-
sult is stored as one word. If the calculation results in an overflow or underflow
(F000 + 1234 for example), the result will not be stored and the last storable
result will remain valid.
• Example: Size of result < Largest operand in the formula
N0000
=
N0001
(1 word)
(2 words)
The calculation on the right is performed as a two-word calculation and the re-
sult is stored as one word. If the calculation results in an overflow or underflow
(F000 + 1234 for example), the result will not be stored and the last storable
result will remain valid.
• Example: Size of result > Largest operand in the formula
N0000
=
N0001
(2 words)
(1 word)
The calculation on the right is performed as a one-word calculation and the re-
sult is stored as two words. In this case, an overflow or underflow will not occur
in the calculation result.
If a calculation error occurs, the calculation will be invalid and the result won't be
refreshed. (The last result will remain valid.) The host will not be notified in this
case either, but it is possible to monitor the calculation results at the host and
verify that the calculation was executed if necessary.
• Division by 0 (/ or %)
An error will occur if the denominator (b in a÷b) of a calculation is 0. When the
denominator is specified in a numeral table or host word, be sure that the con-
+
N0002
(1 word)
+
N0002
(1 word)
+
N0002
(1 word)
Section
2-18
273

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nt31 seriesNt21 seriesNt31c seriesNt631c series

Table of Contents