IDEC MICROSmart FC6A Series Ladder Programming Manual page 543

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

Indirect assignment
Example 7.33 Indirect read
Script
[D0200] = OFFSET([D0010],[D0020]);
Operation Description
When the value of D0020 is 8, the value of D0018, the device 8 words from D0010, is read and stored in D0200.
D0010
D0200
1234
D0018
Read
Example 7.34 Indirect write
Script
OFFSET([D0010],[D0020]) = 1234;
Operation Description
When the value of D0020 is 3, the constant 1234 is stored in D0013, the device 3 words from D0010.
D0010
1234
D0013
Write
8. Data Type Designations
Example 8.1
Processing that mixes F (float), D (double word), and W (word) data types using data type designations
Script
[D0100] = 1.5;
[D0110] = 10.5;
asd
{
[D0200] = FLOAT2BIN([D0100]);
[D0210] = FLOAT2BIN([D0110]);
[D0300] = [D0200]^[D0210];
}
asword
{
[D0400] = [D0301];
}
Operation Description
The value of D0100 (data type F (float)) is converted to data type D (double word) and stored in D0200 and D0201.
The value of D0110 (data type F (float)) is converted to data type D (double word) and stored in D0210 and D0211.
Logical XOR (exclusive OR) is performed on each bit of D0200 and D0210 (data type D (double word)) and the result is stored in
D0300 and D0301.
The value of D0301, which is the low word of D0300 (data type D (double word)), is stored in D0400.
In the above example script, F (float) is selected as the data type in Script Editor, and From Upper Word is selected in Device
Settings.
The method to store 32-bit data in devices conforms to the data storage method specified in the function area settings.
For details, see "32-bit Data Storage" on page 3-9.
0000
D0020
0008
+8
1234
0000
D0020
0003
+3
1234
FC6A S
MICROS
ERIES
MART
L
P
M
ADDER
ROGRAMMING
ANUAL
FC9Y-B1726
26: S
CRIPT
26-41

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents