162
3 DETAILS OF FUNCTION
3.2 MELSEC Data Link Functions
■
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 functions
• Page 154 mdOpen
• Page 146 mdClose
• Page 155 mdRandREx
Device to be written randomly
Description
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.
plDev
Specified value
Description
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 3: LCN100 to LCN101
plDev[8]
100
Start device number = 100
plDev[9]
2
Number of write points = 2
psBuf
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
psBuf[6]
0x0000
Upper bit of LCN100
psBuf[7]
0x0000
Lower bit of LCN101
psBuf[8]
0x0001
Upper bit of LCN101
Return value
Description
0 (0000H)
Normal
Other than 0
Error
For details on the error, refer to the following chapter.
Содержание MELSEC iQ-R C
Страница 1: ...MELSEC iQ R C Controller Module Programming Manual ...
Страница 2: ......
Страница 201: ...I 199 MEMO ...
Страница 203: ...I 201 MEMO ...
Страница 207: ......