Character String Type (String) Integer Type (Int) 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.17 Character string type (STRING)
Character string type (STRING) data is converted into integer type (INT) data.
Function definition
Function definition
6 - 19
INT STR_TO_INT ( STRING(6) S1 );
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
INT
Conversion result (BIN 16-bit data)
Remarks: This function cannot be used with the Basic model QCPU.
Example of use
Argument Type
STRING
w_Word1:=
STR_TO_INT(w_Str1);
BOOL STR_TO_INT _E( BOOL EN, STRING(6) S1, INT 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 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 ) ;
integer type (INT) conversion
Data to be converted (character string data)
ST Program
Conversion Result
LD
DABIN
Execution condition (Function is executed only when the result is TRUE)
Data to be converted (character string data)
Conversion result (BIN 16-bit data)
STR_TO_INT
STR_TO_INT_E
Description
Description
Used Instruction
SM400
LD,DABIN
w_Str1 w_Word1
Description
Description
*)
*)
*)
6 - 19

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents