6 - 19 6 - 19
6 IEC FUNCTIONS
6.1.17 Character string type (STRING) integer type (INT) conversion STR_TO_INT
STR_TO_INT_E
Character string type (STRING) data is converted into integer type (INT) data.
Function definition
INT STR_TO_INT ( STRING(6) S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (character string data)
Return value
Return Value
Description
INT
Conversion result (BIN 16-bit data)
Remarks: This function cannot be used with the Basic model QCPU.
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
STRING w_Word1:=
STR_TO_INT(w_Str1);
LD SM400
DABIN w_Str1
w_Word1
LD,DABIN
Function definition
BOOL STR_TO_INT _E( BOOL EN, STRING(6) 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 (character string 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 character string type data in
sData is converted into integer type (INT) data, and the result is stored into
Result.
M0 := STR_TO_INT_E( X0, sData, 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: ......