6 - 10 6 - 10
6 IEC FUNCTIONS
6.1.8 Integer type (INT) Boolean type (BOOL) conversion INT_TO_BOOL
INT_TO_BOOL_E
Integer type (INT) data is converted into Boolean type (BOOL) data.
Function definition
BOOL INT_TO_BOOL ( INT S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (BIN 16-bit data)
Return value
Return Value
Description
BOOL
Conversion result (bit data)
Remarks: When the data to be converted (BIN 16-bit data) is 0, the return value is "0".
When the data to be converted (BIN 16-bit data) is other than 0, the return
value is "1".
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
INT
b_data1 := INT_TO_BOOL( i_data1 ); LD<>
i_data K0
OUT b_data1
LD<>, OUT
Function definition
BOOL INT_TO_BOOL _E( BOOL EN, INT S1, BOOL 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 (BIN 16-bit data)
D1
OUT
Conversion result (bit data)
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
When execution condition X0 turns ON, the integer type (INT) data in iData is
converted into Boolean type (BOOL) data, and the result is stored into Result.
M0 := INT_TO_BOOL_E( X0, iData, Result ) ;
*)
*)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......