Mitsubishi MELSEC-Q series Programming Manual page 164

Process control instructions
Hide thumbs Also See for MELSEC-Q series:
Table of Contents

Advertisement

S.MID
Set Data
Set Data
(1) Data specified in S.MID instruction
Specified position
Symbol
n
+0
S1
+1
E1
+2
Input
+3
E2
data
+4
+2
n-1
E
n
+2n
+0
D1
BW
+1
BB
Block
memory
BB1
+2
to
BB16
*1
The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the
system. Users cannot set the data.
Set Data
Processing contents
(1) Middle value selector processing
The middle value of the input values 1 (E1) to n (En) is stored into BW.
Also, any of BB1 to BB16 of BB corresponding to the middle value is turned to 1.
Input value
Bit turned to 1 at middle value
(a) If there are an even number of inputs, the smaller value of the middle values is stored.
(b)
If there are two or more middle values, the bits corresponding to the middle values are all turned to 1.
Remark
The middle value is selected as described below.
(1)
The input value 1 (E1) to input value n (En) are rearranged in order of increasing value.
(If there are the same input values, they are arranged in order of increasing input number.)
(2)
The middle value among the rearranged values is selected.
Example) When the input data are 2, 5, 1, 4 and 3, the middle value is selected as described below.
E1
E2
2
In the above case, the middle value is "3" and BB5 turns to 1.
162
Name
Recommended range
Input count
1 to 16
Input value 1
Input value 2
-999999 to 999999
Input value n
(Middle value between maximum value and
Output value
minimum value)
b15
b12
B
B
B
B
B
B
B
B
B
B
16
15
14
13
12
Output
selection
(0: The corresponding input value is not the
intermediate value)
(1: The corresponding input value is the
intermediate value)
E16
E15
BB16
BB15
Input data
E3
E4
E5
Rearrangement
5
1
4
3
*1
––
b8
b4
b0
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
11
10
9
8
7
6
5
4
3
2
1
E14
to
BB14
to
Rearranged data
E3
E1
E5
E4
E2
1
2
3
4
Standard
Unit Data format
value
BIN
––
––
16bit
Real
––
––
number
Real
––
––
number
BIN
––
––
16bit
E2
E1
BB2
BB1
5
Set
by
U
U
S
S

Advertisement

Table of Contents
loading

Table of Contents