Download Print this page

Replacing 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.7

Replacing Character String

REPLACE(_E)
These functions replace an arbitrary range of a character string and output the result.
Ladder diagram, FBD/LD
[Without EN/ENO]
s1
d
s2
n1
n2
Setting data
■Descriptions, types, and data types
Argument
Description
EN
Execution condition (TRUE: Execution, FALSE: Stop)
s1(IN1), s2(IN2)
Input
n1(L)
Specification of number of characters to be replaced
n2(P)
Specification of head character position of a character string to be
replaced
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d(REPLACE(_E))
Output
Processing details
■Operation processing
• These functions replace the data for the specified number of characters from an arbitrary position of a character string input
to (s1) with a character string input to (s2) and output from (d).
• The value input to (n1) specifies the number of characters to be replaced.
[With EN/ENO]
EN
ENO
s1
d
s2
n1
n2
Structured text
[Without EN/ENO]
d:=REPLACE(s1,s2,n1,n2);
[With EN/ENO]
d:=REPLACE_E(EN,ENO,s1,s2,n1,n2);
Type
Input variable
Input variable
Input variable
Input variable
Output variable
Output variable
25 CHARACTER STRING FUNCTIONS
25.7 Replacing Character String
25
Data type
BOOL
STRING(255)
INT
INT
BOOL
STRING(255)
1035

Hide quick links:

Advertisement

loading