Mitsubishi Electric MELSEC Q Series Programming Manual page 191

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6 IEC FUNCTIONS
6.1.2 Boolean type (BOOL)
Boolean type (BOOL) data is converted into integer type (INT) data.
Function definition
Function definition
6 - 4
integer type (INT) conversion
INT BOOL_TO_INT ( BOOL S1 );
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
INT
Conversion result (BIN 16-bit data)
Remarks: The data to be converted (bit data) is stored into the least significant bit of
the return value.
Example of use
Argument Type
INT
D50 := BOOL_TO_INT( M100
);
BOOL BOOL_TO_INT_E( BOOL EN, BOOL S1, INT D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
D1
OUT
Return value
Return Value
BOOL
Execution condition
Example of use
(*
When execution condition X0 turns ON, the Boolean type (BOOL) in bData is
(*
converted into the integer type (INT), and the result is stored into Result.
M0 := BOOL_TO _INT_E ( X0, bData, Result ) ;
Data to be converted (bit data)
ST Program
Conversion Result
LD
MOV
LDI
MOV
Execution condition (Function is executed only when the result is TRUE)
Data to be converted (bit data)
Conversion result (BIN 16-bit data)
BOOL_TO_INT
BOOL_TO_INT_E
Description
Description
Used Instruction
M100
LD, MOV, LDI
K1
D50
M100
K0
D50
Description
Description
*)
*)
6 - 4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents