6 - 4 6 - 4
6 IEC FUNCTIONS
6.1.2 Boolean type (BOOL) integer type (INT) conversion BOOL_TO_INT
BOOL_TO_INT_E
Boolean type (BOOL) data is converted into integer type (INT) data.
Function definition
INT BOOL_TO_INT ( BOOL S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (bit data)
Return value
Return Value
Description
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
ST Program
Conversion Result
Used Instruction
INT
D50 := BOOL_TO_INT( M100
);
LD M100
MOV K1 D50
LDI M100
MOV K0 D50
LD, MOV, LDI
Function definition
BOOL BOOL_TO_INT_E( BOOL EN, BOOL S1, INT D1 );
Argument
Argument Name
IN/OUT
Description
EN
IN
Execution condition (Function is executed only when the result is TRUE)
S1
IN
Data to be converted (bit data)
D1
OUT
Conversion result (BIN 16-bit data)
Return value
Return Value
Description
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 ) ;
*)
*)
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......