6 - 55 6 - 55
6 IEC FUNCTIONS
6.8.5 Multiplexer MUX
MUX_E
One data is selected from among the specified data according to the specified selection condition.
Function definition
ANY MUX ( INT n, ANY S1, ANY S2,….,ANY Sn );
Argument
Argument Name
IN/OUT
Description
n IN
Selection
condition
S1 to Sn
IN
Selection target data
Return value
Return Value
Description
ANY Selection
result
When n = 1, return value = S1
When n = 2, return value = S2
: :
When n = n, return value = Sn
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
REAL Real4
:=
MUX(Int1, Real1,Real2,
Real3);
LD= Int1
K1
EMOV Real1
Real4
LD= Int1
K2
EMOV Real2
Real4
LD= Int1
K3
EMOV Real3
Real4
LD=,EMOV
INT Int4:=
MUX( wCon1 , Int1 , Int2,
Int3 );
LD= wCon1
K1
MOV Int1
Int4
LD= wCon1
K2
MOV Int2
Int4
LD= wCon1
K3
MOV Int3
Int4
LD=,MOV
DINT Dint4:=
MUX(D0, Dint1,Dint2,Dint3 );
LD= D0
K1
DMOV Dint1
Dint4
LD= D0
K2
DMOV Dint2
Dint4
LD= D0
K3
DMOV Dint3
Dint4
LD=,DMOV
BOOL bBit4:=
MUX(3,bBit1,bBit2,bBit3);
LD= K3
K1
MPS
AND bBit1
SET bBit4
MPP
ANI bBit1
RST bBit4
LD= K3
K2
MPS
AND bBit2
SET bBit4
MPP
ANI bBit2
RST bBit4
LD= K3
K3
MPS
AND bBit3
SET bBit4
MPP
ANI bBit3
RST bBit4
LD=,MPS,AND,SET,
MPP,ANI,RST
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......