EasyManua.ls Logo

Mitsubishi Electric MELSEC iQ-R Series - Page 101

Mitsubishi Electric MELSEC iQ-R Series
126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
3 DETAILS OF FUNCTION
3.2 MELSEC iQ-R Series Data Link Functions
99
3
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)
Values specified to the write data storage destination (psBuf)
Number of bytes of write data
(psBuf[0] to psBuf[8] = 9) 2 = 18
Return value
Relevant function
Page 82 mdrClose
Page 90 mdrOpen
Page 91 mdrRandR
Device to be written randomly Current value
M100 to M115 Turns all the bits 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.
Write position Specified value Description Block
plDev[0] 3 Number of blocks = 3
plDev[1] DevM Device type = M Block 1: M100 to M115
plDev[2] 100 Start device number = 100
plDev[3] 16 Number of write points = 16
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 all bit devices from M100 to M115 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
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

Other manuals for Mitsubishi Electric MELSEC iQ-R Series

Related product manuals