![background image](http://html.mh-extra.com/html/mitsubishi-electric/melsec-iq-f-fx5/melsec-iq-f-fx5_programming-manual_2391141033.webp)
25 CHARACTER STRING FUNCTIONS
25.5 Inserting Character String
1031
25
25.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, FBD/LD
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(IN1), s2(IN2)
Input
Input variable
STRING(255)
n(P)
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(INSERT(_E))
Output
Output variable
STRING(255)
(1): Head character position of a character string to be inserted n: 4th character
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)
+1
+2
+3
+4
+5
+0
32H (2)
31H (1)
34H (4)
33H (3)
36H (6)
00H
35H (5)
High-order byte Low-order byte
"123456"
+1
+2
+3
+0
42H (B)
41H (A)
44H (D)
43H (C)
00H
45H (E)
High-order byte Low-order byte
+1
+2
+0
High-order byte Low-order byte
"ABC123456DE"
(s2)
(s1)
(1)
(d)
Summary of Contents for MELSEC iQ-F FX5
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......