Mitsubishi Electric MELSEC-Q/L Programming Manual page 165

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Processing details
■Operation processing
• Replaces the specified number of characters from the specified position in the character string input to (s1) with the
character string input to (s2), and outputs the operation result from (d).
The number of characters to be replaced is specified by the value input to n1.
The start position to be replaced in the character string is specified by the value input to n2.
Ex.
Values input to n1 and n2 are 5
Input value to
'ABCDEFGH123'
High-order byte Low-order byte
1st word
42
(B)
41
H
2nd word
44
(D)
43
H
3rd word
46
(F)
45
H
4th word
48
(H)
47
H
5th word
32
(2)
31
H
6th word
00
33
H
Input value to
'123456'
High-order byte Low-order byte
1st word
32
(2)
31
H
2nd word
34
(4)
33
H
3rd word
36
(6)
35
H
4th word
00
H
• The values to be input to (s1) and (s2) are string type data within the range from 0 to 255 bytes.
• The value to be input to n1 is word (signed) type data within the range from 0 to 255.
(The input value must not exceed the number of characters of character string input to input variable (s1).)
• The value to be input to n2 is word (signed) type data within the range from 1 to 255.
(The input value must not exceed the number of characters of character string input to input variable (s1).)
■Operation result
• Function without EN/ENO
An operation is executed and the operation value is output from (d).
• Function with EN/ENO
The following table shows the executing conditions and operation results.
EN
TRUE (Operation execution)
FALSE (Operation stop)
*1 When FALSE is output from ENO, the data output from (d) is undefined. In this case, create a program so that the data output from (d) is
not used.
Operation error
• No operation error occurs.
s1
High-order byte Low-order byte
(A)
H
(C)
H
Start position to
(E)
H
be replaced n2:
(G)
H
5th character
(1)
H
(3)
H
Number of characters to be replaced n1: 5 characters
s2
(1)
H
(3)
H
(5)
H
ENO
TRUE
*1
FALSE
d
Output value
'ABCD1234523'
42
(B)
41
(A)
1st word
H
H
44
(D)
43
(C)
2nd word
H
H
32
(2)
31
(1)
3rd word
H
H
34
(4)
33
(3)
4th word
H
H
32
(2)
35
(5)
5th word
H
H
00
33
(3)
6th word
H
H
(d)
Operation output value
Undefined value
5.7 Standard Character String Functions
5 APPLICATION FUNCTIONS
5
163

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents