Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 1306

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

■Input data
Operand: (s1)
Device
Symbol
+0
n
+1
E1
+2
+3
E2
+4
+2n-1
En
+2n
■Block memory
Operand: (d1)
Device
Symbol
+0
BW
+1
+2
BB
BB1
to
BB1
6
Processing details
This instruction outputs an intermediate value between the maximum and minimum values among input values E1 to En.
■Middle value selector processing
An intermediate value among input values E1 to En is stored in the output value (BW).
In addition, the BB output selection (BB1 to BB16) corresponding to the intermediate value is set to 1.
The correspondence between input values 1 (E1) to 16 (E16) and BB output selections (BB1 to BB16) is shown below.
Input value
Bit to be set to 1 at an intermediate value
• When the number of inputs is an even number, the smaller value among the intermediate values is stored.
• When two or more intermediate values exist, the bits corresponding to the intermediate values are all set to 1.
■Remarks
Intermediate values are selected as follows:
• Input values 1 (E1) to n (En) are sorted in ascending order. (When there are same input values, they are sorted in
ascending order of their input numbers.)
• The intermediate value in the sorted values is selected.
Ex.
When the input data are 2, 5, 1, 4, and 3, operations are performed as shown below.
In this example, 3 is the intermediate value and accordingly the output select (BB5) is set to 1.
(1)
E1
E2
E3
E4
2
5
1
4
(1) Input data
(2) Rearrangement
(3) Rearranged data
11 PROCESS CONTROL INSTRUCTIONS
1304
11.3 Control Operation Instructions
Name
Recommended range
Number of
1 to 16
inputs
Input value 1
-999999 to 999999
Input value 2
Input value n
Name
Recommended range
Output value
Intermediate value between maximum and minimum values
Output selection
b15
b14
b13
b12
0: Corresponding input value is not the intermediate value.
1: Corresponding input value is the intermediate value.
E16
BB16
(2)
E5
E3
3
1
b11
b10
b9
b8
b7
b6
b5
b4
b3
b2
b1 b0
E15
E14
BB15
BB14
(3)
E1
E5
E4
E2
2
3
4
5
Data type
16-bit unsigned
binary
Single-precision
real number
Data type
Single-precision
real number
16-bit unsigned
binary
to
to
Standard
Set by
value
User
User
Standard
Set by
value
System
System
E2
E1
BB2
BB1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents