5.6 Standard Selection Functions
170
FXCPU Structured Programming Manual
(Application Functions)
5.6.5
MUX(_E)
Outline
This function selects data, and outputs the selected data.
1. Format
*1.
Output variable
2. Set data
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
1) This function outputs either one among values stored in devices specified in
…
to a device specified
in
in accordance with the value specified in
using the data type of data stored in devices
specified in
…
.
a) When the value specified in
is "1", this function outputs the value stored in a device specified in
to a device specified in
.
b) When the value specified in
is "n", this function outputs the value stored in a device specified in
to a device specified in
.
Example: When the data type is word [signed]
2) When a value input to
is outside the pin number range for
…
, this function outputs an indefinite
value to a device specified in
.
(An operation error does not occur. "MUX_E" outputs "FALSE" from ENO.)
3) The number of pins in
can be changed.
FX
3U(C)
FX
3G
FX
2N(C)
FX
1N(C)
FX
1S
FX
U
/FX
2C
FX
0N
FX
0(S)
Function name
Expression in each language
Structured ladder
ST
MUX
MUX(_K,_IN,_IN);
Example:
D30:=
MUX(D0,D10,D20);
MUX_E
MUX_E(EN,_K,_IN,_IN,Output
label);
Example:
MUX_E(X000,D0,D10,D20,D30);
Variable
Description
Data type
Input
variable
EN
Execution condition
Bit
_K (
)
Selection data, or word device which stores such data
Word [signed]
_IN (
…
)
Selectable data, or word device which stores such data
ANY
Output
variable
ENO
Execution status
Bit
*1
Word device which will store the selected data
ANY
MUX
*1
D30
D0
_K
_IN
D10
_IN
D20
MUX_E
EN
ENO
*1
D30
X000
D0
_K
_IN
D10
_IN
D20
n
s1
s1
d
n
s1
n
s1
d
n
sn
d
MUX
K
_IN
_IN
1234
Word [signed] data
Word [signed] data
1234
Word [signed] data
1
Word [signed] data
5678
n
s1
d
s