Selection Functions; Binary Selection - Mitsubishi MELSEC-q Programming Manual

Melsec q series; melsec l series
Hide thumbs Also See for MELSEC-q:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.8 Selection Functions

6.8.1 Binary selection

One data is selected from among the specified two data according to the selection condition.
Function definition
6 - 47
SEL
SEL_E
ANY SEL( BOOL S1, ANY S2, ANY S3 );
Argument
Argument Name
IN/OUT
S1
IN
S2
IN
S3
IN
Return value
Return Value
ANY
Selection result
When S1 is FALSE ....... Return value = S2
When S1 is TRUE ......... Return value = S3
Example of use
Argument Type
REAL
r_data1 := SEL( b_select,
r_data2, r_data3 );
INT
D1 :=
SEL( X1, D2, D3 );
DINT
K8X100 :=
SEL( X1, K8X10,
K2147483647 );
BOOL
b_result := SEL( b_select,
b_data1, b_data2 );
STRING
s_result := SEL( b_select,
s_ary1, s_ary2 );
Selection condition
Data to be selected when S1 is FALSE
Data to be selected when S1 is TRUE
ST Program
Conversion Result
LDI
EMOV
LD
EMOV
LDI
MOV
LD
MOV
LDI
DMOV
LD
DMOV
LDI
MPS
AND
SET
MPP
ANI
RST
LD
MPS
AND
SET
MPP
ANI
RST
LDI
$MOV
LD
$MOV
Description
Description
Used Instruction
b_select
LDI, EMOV, LD,
r_data2
r_data1
b_select
r_data3
r_data1
X1
LDI, MOV, LD
D2 D1
X1
D3 D1
X1
LDI, DMOV, LD
K8X10 K8X100
X1
K2147483647
K8X100
b_select
LDI, MPS,AND, SET, MPP,
ANI, RST,LD
b_data1
b_result
b_data1
b_result
b_select
b_data2
b_result
b_data2
b_result
b_select
LDI, $MOV,LD
s_ary1
s_result
b_select
s_ary2
s_result
6 - 47

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-l

Table of Contents