6 - 7 6 - 7
6 IEC FUNCTIONS
6.1.5 Double precision integer type (DINT) integer type (INT) conversion DINT_TO_INT
DINT_TO_INT_E
Double precision integer type (DINT) data is converted into integer type (INT) data.
Function definition
INT DINT_TO_INT ( DINT S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (BIN 32-bit data)
Return value
Return Value
Description
INT
Conversion result (BIN 16-bit data)
Remarks: The lower 16 bits of the data to be converted (BIN 32-bit data) is stored in
the return value.
The upper 16 bits are discarded.
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
DINT i_data1
:=
DINT_TO_INT(di_data1);
LD SM400
MOV di_data1
i_data1
LD,MOV
Function definition
BOOL DINT_TO_INT_E( BOOL EN, DINT 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 (BIN 32-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 double precision integer type
(DINT) data in dData is converted into integer type (INT) data, and the result
is stored into Result.
M0 := DINT_TO _INT_E ( X0, dData, 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: ......