IDEC MICROSmart FC6A Series User Manual page 492

Windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

8: I
R
NSTRUCTIONS
EFERENCE
User Program Execution Errors
When an advanced instruction is executed, a user program execution error occurs when any of the following conditions are met.
• the result of the adavnced instruction is invalid
• source or destination device that is indirectly specified in the advanced instruction exceeds the valid device range
• the advanced instruction does not operate correctly
For example, the data in the source device does not comply with the normal floating-point format when the data type is Float (F).
For details about device ranges, see "Devices" on page 6-1.
When a user program execution error occurs, special internal relay M8004 turns on and the corresponding error code is stored in
special data register D8006. For details about the error codes, see "User Program Execution Error" on page 13-6.
When a user program execution error occurs, instructions operate as follows:
• When the source data is invalid, the execution of the advanced instruction is canceled and the data in the destination device is not changed.
• When the execution result is invalid, a value is stored in the destination device.
For details on stored values, see the descriptions of relevant instructions.
• If a user program execution error occurred during a repeat operation, the operation is canceled and the next repeat operation is executed.
M8004 is retained even when no further user program execution errors occur during subsequent repeat operations.
Example: User program execution error during a repeat operation
When the source data does not comply with the normal floating-point format.
When the second repeat operation is executed, special internal relay M8004 turns on because the source data is not a normal
number in floating-point format.
The second repeat operation is canceled and the third repeat operation is executed.
MOV(F)
(D0, D1)
Not a normal
(D2, D3)
(D4, D5)
Carry and Borrow
When the result of an operation exceeds the valid device range, a carry (CY) or borrow (BW) occurs.
Carrying and borrowing occur in the following conditions according to the data type:
Data Type
Word
Integer
Double Word
Long
Float
When a carry or borrow occurs, special internal relay M8003 (carry and borrow) turns on.
For example, when D0 has a value of FFFF (hex) and +1 is added using an INC instruction, the result is 10000 (hex), but when the
data type is Word (W), 0000 (hex) is stored in D0 and 1 is stored in M8003.
8-10
S1(R)
D1(R)
D0
D100
3.14
Not executed
number
M8004=ON
1.414
Exceeds range between 0 and 65,535
Exceeds range between -32,768 and 32,767
Exceeds range between 0 and 4,294,967,295
Exceeds range between -2,147,483,648 and 2,147,483,647
If an overflow or underflow occurs
For details on overflow and underflow, see "Carry and Borrow in Floating-Point Data Processing" on
page 8-8.
FC6A S
MICROS
ERIES
REP
3
(D100, D101)
3.14
(D102, D103)
(D104, D105)
1.414
Status
U
'
M
FC9Y-B1722
MART
SER
S
ANUAL
Previous value is
retained

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents