6 - 3 6 - 3
6 IEC FUNCTIONS
6.1 Type Conversion Functions
6.1.1 Boolean type (BOOL) double precision integer type (DINT) conversion BOOL_TO_DINT
BOOL_TO_DINT_E
The specified Boolean type (BOOL) data is converted into double precision integer type (DINT) data.
Function definition
DINT BOOL_TO_DINT( BOOL S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (bit data)
Return value
Return Value
Description
DINT
Conversion result (BIN 32-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
BOOL
di_data1 :=
BOOL_TO_DINT(b_data1);
LD b_data1
DMOV K1
di_data1
LDI b_data1
DMOV K0
di_data1
LD, DMOV, LDI
Function definition
BOOL BOOL_TO_DINT_E( BOOL EN, BOOL S1, DINT 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 32-bit data)
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
(*
When execution condition X0 turns ON, the Boolean type data in bData is
converted into double precision integer type (DINT) data, and the result is
stored into Result.
M0 := BOOL_TO _DINT_E ( X0, bData, Result ) ;
*)
*)
*)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......