Type Conversion Functions; Boolean Type (Bool) Double Precision Integer Type (Dint) Conversion - Mitsubishi Electric MELSEC Q Series Programming Manual

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

Advertisement

6 IEC FUNCTIONS

6.1 Type Conversion Functions

6.1.1 Boolean type (BOOL) double precision integer type (DINT) conversion BOOL_TO_DINT
The specified Boolean type (BOOL) data is converted into double precision integer type (DINT) data.
Function definition
Function definition
6 - 3
DINT BOOL_TO_DINT( BOOL S1 );
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
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
BOOL
di_data1 :=
BOOL_TO_DINT(b_data1);
BOOL BOOL_TO_DINT_E( BOOL EN, BOOL S1, DINT 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 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 ) ;
Data to be converted (bit data)
ST Program
Conversion Result
LD
DMOV
LDI
DMOV
Execution condition (Function is executed only when the result is TRUE)
Data to be converted (bit data)
Conversion result (BIN 32-bit data)
BOOL_TO_DINT_E
Description
Description
Used Instruction
b_data1
LD, DMOV, LDI
K1
di_data1
b_data1
K0
di_data1
Description
Description
*)
*)
*)
6 - 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents