Insertion Of Character String Into Specified Position - 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.10.6 Insertion of character string into specified position

The character string data is inserted into the specified position and later of the specified character string data.
Function definition
Function definition
6 - 74
STRING INSERT( STRING S1, STRING S2, INT POS );
Argument
Argument Name
IN/OUT
S1
IN
S2
IN
POS
IN
Return value
Return Value
STRING
Insertion result (character string data)
Remarks: This function cannot be used with the Basic model QCPU.
Secure the area of the number of characters after insertion + 1 character as
the data area that will store the character string data after insertion.
Example of use
Argument Type
STRING
w_Str3 :=
INSERT(w_Str1,w_Str2,w_Word1 );
BOOL INSERT_E( BOOL EN, STRING S1, STRING S2, INT POS, STRING D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
S2
IN
POS
IN
D1
OUT
Return value
Return Value
BOOL
Execution condition
Example of use
(*
When execution condition X0 turns ON, the character string data in sData2 is
(*
inserted into the iData position from the head of the character string data in
(*
sData1, and the result is stored into Result.
M0 := INSERT_E( X0, sData1, sData2, iData, Result ) ;
INSERT
INSERT_E
Data to be inserted (character string data)
Data into which above data will be inserted (character string data)
Insertion position (BIN 16-bit data)
Description
ST Program
LD
$+
AND<>
MOV
-
MIDW
D10238
MOV
LEN
MIDW
Execution condition (Function is executed only when the result is TRUE)
Data to be inserted (character string data)
Data into which above data will be inserted (character string data)
Insertion position (BIN 16-bit data)
Insertion result (character string data)
Description
Description
Conversion Result
Used Instruction
SM400
LD,$+,AND<>,MOV
w_Str2
w_Str1
,-,MIDW,LEN
w_Str3
w_Word1 K1
K1 D10238
w_Word1 K1
D10239
w_Str1
w_Str3
w_Word1
D10238
w_Str2
D10239
w_Str2
w_Str3
D10238
Description
*)
*)
*)
6 - 74

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents