IDEC SmartAXIS FT9Z-1A01 User Manual page 340

Table of Contents

Advertisement

13: S
CR I P TS
Data comparison and copying
Example 7.22 Word-unit data comparison
Script
[D0000] = MEMCMP([D0100], [D0200], 10);
Operation Description
Compares the values of 10 words from D0100 (up to D0109) with the values of 10 words from D0200 (up to D0209).
If the value for each is entirely equal, 1 is stored in D0000. If even a single one is not equal, 0 is stored.
Compare each
D0100
D0101
D0102
D0107
D0108
D0109
Note: Even if the data type is set to D (double word), L (long), or F (float), the comparison is performed from the starting device in word units.
Example 7.23 Bit-unit data comparison
Script
[D0000] = MEMCMP([D0100.02], [D0200.00], 10);
Operation Description
Compares the third bit of D0100 through the third bit of D0109 with the state of the bits from the first bit of D0200 through the
first bit of D0209.
If the value for each is entirely equal, 1 is stored in D0000. If even a single one is not equal, 0 is stored.
3rd bit of D0100
3rd bit of D0101
3rd bit of D0102
3rd bit of D0107
3rd bit of D0108
3rd bit of D0109
Note: Even if the data type is set to D (double word), L (long), or F (float), the comparison is performed from the starting device in bit units.
Example 7.24 Word-unit data copy
Script
MEMCPY([D0100], [D0200], 10);
Operation Description
Copies the value of 10 word devices from D0200 (up to D0209) to 10 word devices from D0100 (up to D0109).
Copy each
D0100
D0101
D0102
D0107
D0108
D0109
Note: Even if the data type is set to D (double word), L (long), or F (float), the data is copied from the starting device in word units.
13-32
D0200
D0201
D0202
D0207
D0208
D0209
Compare each
1st bit of D0200
1st bit of D0201
1st bit of D0202
1st bit of D0207
1st bit of D0208
1st bit of D0209
D0200
D0201
D0202
D0207
D0208
D0209
S
A XI S P
M AR T
/ L
U
'
M
FT9Y-B 1378
R O
I TE
SER
S
ANUAL

Advertisement

Table of Contents
loading

Table of Contents