8: I
NSTRUCTIONS
R
EFERENCE
8-10
FC6A S
ERIES
MICROS
MART
U
SER
’
S
M
ANUAL
FC9Y-B1722
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.
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:
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.
(D0, D1)
3.14
(D2, D3)
(D4, D5)
1.414
(D100, D101)
(D102, D103)
(D104, D105)
3.14
1.414
MOV(F)
S1(R)
D1(R)
REP
D0
D100
3
Not a normal
number
Not executed
M8004=ON
Previous value is
retained
Data Type
Status
Word
Exceeds range between 0 and 65,535
Integer
Exceeds range between -32,768 and 32,767
Double Word
Exceeds range between 0 and 4,294,967,295
Long
Exceeds range between -2,147,483,648 and 2,147,483,647
Float
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.
Содержание MICROSmart FC6A Series
Страница 1: ...B 1722 8 FC6A SERIES User s Manual...
Страница 12: ...TABLE OF CONTENTS Preface 11 FC6A SERIES MICROSMART USER S MANUAL FC9Y B1722...
Страница 182: ...2 PRODUCT SPECIFICATIONS 2 152 FC6A SERIES MICROSMART USER S MANUAL FC9Y B1722...
Страница 434: ...8 INSTRUCTIONS REFERENCE 8 18 FC6A SERIES MICROSMART USER S MANUAL FC9Y B1722...
Страница 520: ...11 SD MEMORY CARD 11 54 FC6A SERIES MICROSMART USER S MANUAL FC9Y B1722...
Страница 554: ...13 TROUBLESHOOTING 13 26 FC6A SERIES MICROSMART USER S MANUAL FC9Y B1722...
Страница 567: ...FC6A SERIES MICROSMART USER S MANUAL FC9Y B1722 A 13 APPENDIX ASCII Character Code Table...