
22 CHARACTER STRING FUNCTIONS
22.5 Inserting Character String
821
22
22.5
Inserting Character String
INSERT(_E)
These functions insert a character string into another character string and output the result.
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• These functions insert the character string input to (s2) at the (n)th character from the start of the character string input to
(s1) (head position of the insertion) and output from (d).
• After the character string specified by (s2) is inserted to the one specified by (s1), 00H indicating an end of the character
string specified by (s2) is ignored.
• When the inserted character string exceeds 255 bytes, these functions output a character string within 255 bytes.
Ex.
When the value input to (n) is 4
• A value input to (s1) and (s2) is the STRING type data value and within the range from 0 to 255 byte(s).
• A value input to (n) is the INT type data value and within the range from 1 to 255. (However, the value must be within the
number of characters of the character string to be input to (s1).)
Ladder diagram
Structured text
[Without EN/ENO]
[With EN/ENO]
[Without EN/ENO]
d:=INSERT(s1,s2,n);
[With EN/ENO]
d:=INSERT_E(EN,ENO,s1,s2,n);
Argument
Description
Type
Data type
EN
Execution condition (TRUE: Execution, FALSE: Stop)
Input variable
BOOL
s1, s2
Input
Input variable
STRING(255)
n
Specification of head character position of a character string to be
inserted
Input variable
INT
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d
Output
Output variable
STRING(255)
s1
d
s2
n
EN
ENO
d
s1
s2
n
"ABCDE"
42H (B)
41H (A)
31H (1)
43H (C)
33H (3)
32H (2)
35H (5)
34H (4)
44H (D)
36H (6)
00H
45H (E)
2nd word
3rd word
4th word
5th word
6th word
1st word
32H (2)
31H (1)
34H (4)
33H (3)
36H (6)
00H
35H (5)
High-order byte Low-order byte
"123456"
2nd word
3rd word
4th word
1st word
42H (B)
41H (A)
44H (D)
43H (C)
00H
45H (E)
High-order byte Low-order byte
2nd word
3rd word
1st word
High-order byte Low-order byte
"ABC123456DE"
Value input to (s2)
Value input to (s1)
Output value
(d)
Head character
position of a character
string to be inserted
n
:
4th character
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......