Mitsubishi Electric MELSEC Q Series Programming Manual page 197

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

Advertisement

6 IEC FUNCTIONS
6.1.8 Integer type (INT)
Integer type (INT) data is converted into Boolean type (BOOL) data.
Function definition
Function definition
6 - 10
Boolean type (BOOL) conversion
BOOL INT_TO_BOOL ( INT S1 );
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
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
INT
b_data1 := INT_TO_BOOL( i_data1 );
BOOL INT_TO_BOOL _E( BOOL EN, INT S1, BOOL 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 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 ) ;
Data to be converted (BIN 16-bit data)
Description
ST Program
LD<>
OUT
Execution condition (Function is executed only when the result is TRUE)
Data to be converted (BIN 16-bit data)
Conversion result (bit data)
Description
INT_TO_BOOL
INT_TO_BOOL_E
Description
Conversion Result
Used Instruction
i_data K0
LD<>, OUT
b_data1
Description
*)
*)
6 - 10

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents