3 DETAILS OF FUNCTION
3.2 MELSEC Data Link Functions
163
3
mdRandWLabelEx
This function writes devices corresponding to labels randomly.
■
Format
long mdRandWLabelEx(long lPath, long lNetNo, long lStNo, long* plDev, short* psBuf, long lBufSize, unsigned long long
ullLbCode)
■
Argument
The specification method of the randomly selected device (plDev) is as follows:
• One block comprises of three elements such as device type, start device number, and number of write points, the total
number of blocks will be stored in the first element of the randomly-specified device (plDev).
■
Description
• This function writes data to a device, which is specified to the randomly selected device (plDev), of a module specified to
the network number (lNetNo) and the station number (lStNo).
• The data to be written is stored to the write data storage destination (psBuf) in word units. A bit device and a word device
are stored per 1 point, and a double-word device is stored in word units.
• Specify so that the total number of write points specified for each block is 10240 points or less. Otherwise, a size error (-5)
occurs.
• Note that the extension comment information will be deleted when the data is written to the block to which an extension
comment is assigned (extension file register).
• Also, note that sub 2 or sub 3 program will be deleted when data is written to a block (extension file register) overlapping
with the program setting area for sub 2 or sub 3.
• When '0' is specified to the label code (ullLbCode), the device is written without checking the label code.
Argument
Name
Description
IN/OUT
lPath
Channel
Specify the path of the channel.
IN
lNetNo
Network number
Specify the network number of target module.
IN
lStNo
Station number
Specify the station number of target module.
IN
plDev
Randomly selected device
Specify the number of blocks, device type, start device number, and device points of
devices to be written.
IN
psBuf
Write data storage destination
Specify the storage destination (address) of write data.
Reserve a continuous area for the write data storage destination.
IN
lBufSize
Write data storage destination
size
Unused (Even if a value is specified, the operation is not affected.)
IN
ullLbCode
Label code
Specify the label code acquired with the mdGetLabelInfo function.
IN
plDev
Description
plDev[0]
Number of blocks
plDev[1]
Device type
Block 1
plDev[2]
Start device number
plDev[3]
Number of write points
plDev[4]
Device type
Block 2
plDev[5]
Start device number
plDev[6]
Number of write points
plDev[3n+1]
Device type
Block n
plDev[3n+2]
Start device number
plDev[3n+3]
Number of write points
Summary of Contents for MELSEC iQ-R C
Page 1: ...MELSEC iQ R C Controller Module Programming Manual ...
Page 2: ......
Page 201: ...I 199 MEMO ...
Page 203: ...I 201 MEMO ...
Page 207: ......