3 DETAILS OF FUNCTION
3.2 MELSEC iQ-R Series Data Link Functions
101
3
■ 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), the start I/O number (lIoNo), the station number (lStNo), and the CPU number (sCPU).
• 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)
will occur.
• 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.
■ Example
The following tables show the examples of values specified to the randomly selected device (plDev) and the write data
storage destination (psBuf), and the number of bytes of write data.
Values specified to the randomly selected device (plDev)
Data specified for the write data storage destination (psBuf)
Number of bytes of write data
(psBuf[0] to psBuf[8] = 9) 2 = 18
Device to be written randomly Current value
M100 Turns the bit OFF.
D10 to D13 Stores 10 in D10, 200 in D11, 300 in D12, and 400 in D13.
LCN100 to LCN101 Stores 0x1 in LCN100, and 0x10000 in LCN101.
Setting target Specified value Description Block
plDev[0] 3 Number of blocks = 3
plDev[1] DevM Device type = M Block 1: M100
plDev[2] 100 Start device number = 100
plDev[3] 1 Number of write points = 1
plDev[4] DevD Device type = D Block 2: D10 to D13
plDev[5] 10 Start device number = 10
plDev[6] 4 Number of write points = 4
plDev[7] DevLCN Device type = LCN Block 5: LCN100 to LCN101
plDev[8] 100 Start device number = 100
plDev[9] 2 Number of write points = 2
Write position Specified value Description
psBuf[0] 0 Turns the bit device for M100 OFF.
psBuf[1] 10 D10=10
psBuf[2] 200 D11=200
psBuf[3] 300 D12=300
psBuf[4] 400 D13=400
psBuf[5] 0x0001 Lower bit of LCN100 = 0x0001
psBuf[6] 0x0000 Upper bit of LCN100 = 0x0000
psBuf[7] 0x0000 Lower bit of LCN101 = 0x0000
psBuf[8] 0x0001 Upper bit of LCN101 = 0x0001