Download Print this page

Inserting Character String - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

25.5

Inserting Character String

INSERT(_E)
These functions insert a character string into another character string and output the result.
Ladder diagram, FBD/LD
[Without EN/ENO]
s1
d
s2
n
Setting data
■Descriptions, types, and data types
Argument
Description
EN
Execution condition (TRUE: Execution, FALSE: Stop)
s1(IN1), s2(IN2)
Input
n(P)
Specification of head character position of a character string to be
inserted
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d(INSERT(_E))
Output
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
(s1)
"ABCDE"
High-order byte Low-order byte
+0
42H (B)
41H (A)
+1
44H (D)
43H (C)
+2
00H
45H (E)
(s2)
"123456"
High-order byte Low-order byte
+0
32H (2)
31H (1)
+1
34H (4)
33H (3)
+2
36H (6)
35H (5)
+3
00H
(1): Head character position of a character string to be inserted n: 4th character
• 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).)
[With EN/ENO]
EN
ENO
s1
d
s2
n
"ABC123456DE"
High-order byte Low-order byte
42H (B)
31H (1)
(1)
33H (3)
35H (5)
44H (D)
00H
Structured text
[Without EN/ENO]
d:=INSERT(s1,s2,n);
[With EN/ENO]
d:=INSERT_E(EN,ENO,s1,s2,n);
Type
Input variable
Input variable
Input variable
Output variable
Output variable
(d)
41H (A)
+0
43H (C)
+1
32H (2)
+2
34H (4)
+3
36H (6)
+4
45H (E)
+5
25 CHARACTER STRING FUNCTIONS
25.5 Inserting Character String
25
Data type
BOOL
STRING(255)
INT
BOOL
STRING(255)
1031

Hide quick links:

Advertisement

loading