Download MELSEC Data Link Library Reference Manual

Transcript
CHAPTER 4 FUNCTIONS
Explanation
• The number of transient transmissions performed inside of the function changes with the specified
randomly-specified devices.
• A longer function processing time is required for the random write function as compared with the batch write
function. Consider using the batch write function if a shorter function processing time is required.
• When accessing another station, the extended comment information will be deleted by writing data to the
block (extended file register) to which the extended comment is assigned.
• When accessing another station, the sub2 and sub3 programs will be deleted by writing data to the block
(extended file register) which overlaps with the setting areas of the sub2 and sub3 programs.
4
• If an error occurs when writing devices randomly to B or W of the own station in MELSECNET(II) or
MELSECNET/10, blocks with errors may exist among blocks in which the write function is normally
completed.
• The following explains how to specify the randomly-specified devices (dev).
Randomly-specified devices (dev)
dev[0]
Number of blocks
dev[1]
Device type of block number 1
dev[2]
Start device number of block number 1
dev[3]
Points of block number 1
dev[4]
Device type of block number 2
dev[5]
Start device number of block number 2
dev[6]
Points of block number 2
Block number 1
Block number 2
• The following shows an example when writing data to multiple devices.
Example) When all bits of M100 to M115 are set to OFF, and 10, 200, 300, and 400 are written to D10, D11,
D12, and D13 respectively.
Randomly-specified devices (dev)
dev[0]=2;
dev[1]=DevM;
dev[2]=100;
dev[3]=16;
dev[4]=DevD;
dev[5]=10;
dev[6]=4;
Two specified ranges (M100 to M115, D10 to D13)
M100 and later
16 points (M100 to M115)
D10 and later
4 points (D10 to D13)
Written data (buf)
buf[0]=0;
All bits are OFF.
buf[1]=10;
Stores 10 to D10.
buf[2]=200;
Stores 11 to D200.
buf[3]=300;
Stores 12 to D300.
buf[4]=400;
Stores 13 to D400.
67
4.3 Function Details
4.3.5 mdRandWEx (writing extended devices randomly)
The number of blocks that can be specified is within 1 to 32767.