Inserting String Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

32.5

Inserting String Data

INSERT(_E)
RnPCPU
RnPCPU
RnCPU RnENCPU
(Process)
(Redundant)
These functions insert a character string into another string, and output the operation result.
Ladder, FBD/LD
[Without EN/ENO]
s1
d
s2
n
Setting data
■Description, type, data type
Argument
Description
EN
Execution condition (TRUE: Executed, FALSE: Not executed)
s1 (IN1), s2 (IN2)
Input
n (P)
Insertion target character start position
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d
Output
Processing details
■Operation processing
• These functions insert the string input to (s2) into the insertion start position, i.e. the 'n'th character position from the
beginning of the string input to (s1), and output the operation result from (d).
• After the (s2) string is inserted into the (s1) string, 00H, which indicates the end of the (s2) string, is ignored.
• If the string after insertion exceeds 255 bytes, the substring up to the 255th byte will be output.
Ex.
When (n)=4
(s1)
ABCDE
Upper byte
+0
42H(B)
+1
44H(D)
+2
00H
(s2)
123456
Upper byte
+0
32H(2)
+1
34H(4)
+2
36H(6)
+3
00H
RnSFCPU RnSFCPU
(Standard)
(Safety)
[With EN/ENO]
EN
ENO
s1
d
s2
n
Lower byte
41H(A)
43H(C)
Starting position specified
by (n): 4th character
45H(E)
Lower byte
31H(1)
33H(3)
35H(5)
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
ABC123456DE
Upper byte
42H(B)
31H(1)
33H(3)
35H(5)
44H(D)
00H
Data type
BOOL
ANYSTRING_SINGLE
INT
BOOL
ANYSTRING_SINGLE
(d)
Lower byte
+0
41H(A)
+1
43H(C)
+2
32H(2)
+3
34H(4)
36H(6)
+4
45H(E)
+5
32 STRING FUNCTIONS
1953
32.5 Inserting String Data
32

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents