3 DETAILS OF FUNCTION
3.2 MELSEC iQ-R Series Data Link Functions
103
3
mdrReceive
This function reads devices in a batch.
■ Format
short mdrReceive(long lPath, short sRoute, long lNetNo, long lIoNo, long lStNo, short sCPU, long lDevType, long lDevNo,
long* plSize, short* psData)
■ Argument
■ Description
• This function reads data for the size specified to the read data size (plSize) from a device, which is specified to the device
type (lDevType) and the start device number (lDevNo), of a module specified to the network number (lNetNo), the start I/O
number (lIoNo), the station number (lStNo), and the CPU number (sCPU).
• When the read data size exceeds the device range, a readable size is returned to the read data size (plSize).
■ Return value
■ Relevant function
Page 82 mdrClose
Page 90 mdrOpen
Page 104 mdrSend
Argument Name Description IN/OUT
lPath Path of channel Specify the path of the opened channel. IN
sRoute Access route Specify the access route to target module.
• 0: CC-Link IE Controller Network
• 1: CC-Link IE Field Network
•2: MELSECNET/H
• 3: CC-Link
• 4: Bus interface
IN
lNetNo Network number Specify the network number of target module.
Page 14 Argument specification
IN
lIoNo Start I/O number Specify the start I/O number divided by 16 of the target module.
Page 14 Argument specification
IN
lStNo Station number Specify the station number of target module.
Page 14 Argument specification
IN
sCPU CPU number Specify the target CPU number.
• 0: Control CPU specification
• 1 to 4: Multiple CPU specification
IN
lDevType Device type Specify the device type for device to be read in batch. IN
lDevNo Start device number Specify the start device number for device to be read in batch.
(For a bit device, set a device number in multiples of 8).
IN
plSize Read data size Specify the read data size in byte units.
(Specify the value in multiples of 4 when double-word device (LZ, LTN, LCN,
LSTN) is specified, or specify the value in multiples of 2 when a word device
or bit device is specified. If the value other than that is specified, the size
error (-5) will occur.)
IN/OUT
psData Read data storage destination Specify the storage destination (address) of read data. OUT
Return value Description
0 (0000H) Normal
Other than 0 (0000H) Error
For details on the error, refer to the following chapter.
Page 108 ERROR CODE LIST