FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
23-5
23: F
ILE
D
ATA
P
ROCESSING
I
NSTRUCTIONS
NDSRC (N Data Search)
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Source S1 data specifies the value to be sought and the valid range depends on the data type.
The search range cannot straddle data registers and non-retentive data registers. Make sure that the sum of data register numbers designated by
S1 and S2 does not result in a different data register range.
For source S3 and destination D1, 1 word is always used without regard to the data type.
Destination D1 occupies two consecutive data registers starting with the device designated by D1.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MICROSmart. When a user program execution error occurs, the execution of the
instruction is canceled and the next instruction is executed.
When data in S2 to S2+(S3) does not comply with floating-point format, the data is skipped to continue the search and the results are stored in D1
and D1+1.
The NDSRC instruction cannot be used in an interrupt program.
If used, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MICROSmart.
When S3 is zero or the sum of S2 and S3 is not within the valid data register range, a user program execution error will result, turning on special
internal relay M8004 and ERR LED on the FC6A Series MICROSmart. When a user program execution error occurs, the execution of the instruction is
canceled and the next instruction is executed.
For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the NDSRC instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Valid Data Types
Quantity of Source and Destination Devices
Depending on the data type, source devices S1 and S2 use a different quantity of devices. Source device S3 and destination device
D1 always use 1 word without regards to the data type.
When input is on, a value specified by device S1 is searched for. Data
registers are searched, starting with the data register assigned by device S2.
Device S3 specifies the quantity of 1-word or 2-word blocks of data registers
to search, depending on the data type.
The offset of the data register where a match first occurred is stored in data
register assigned by device D1. The number of matches is stored in the next
data register. When the search results in no match, 65,535 is stored in device
D1 and 0 is stored in device D+1.
NDSRC(*)
S1
*****
S2
*****
S3
*****
D1
*****
Device
Function
I
Q
M
R
T
C
D
P
Constant
Repeat
S1 (Source 1)
Value to be sought
—
—
—
—
—
—
X
—
X
—
S2 (Source 2)
First data register number to search
—
—
—
—
—
—
X
—
—
—
S3 (Source 3)
Quantity of blocks to search
—
—
—
—
—
—
X
—
X
—
D1 (Destination 1)
Search result
—
—
—
—
—
—
X
—
—
—
W (word)
X
When a word device such as D (data register) is assigned as the source, 1 point (word or integer data) or 2
points (double-word, long, or float data) are used.
I (integer)
X
D (double word)
X
L (long)
X
F (float)
X
Device
W (word), I (integer)
D (double word), L (long), F (float)
S1, S2
1 word device
2 word devices
S3, D1
1 word device
1 word device
Summary of Contents for MICROSmart FC6A Series
Page 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Page 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...