Chapter 8 Logic Instructions
8.14.6 REPLACE
FB/FC
Explanation
FC
The REPLACE instruction replaces the specified-length string starting from the
specified position with another string.
DVP15MC11T
Parameters
Meaning
Description Valid range
In1 Original string Input Original string
Depends on the data type of the
variable that the input parameter is
In2 Insert string Input String to insert
Depends on the data type of the
variable that the input parameter is
L
Input
Number of
characters to delete
0~ maximum number of characters
P
Replacement start
position
Input
Replacement start
position
1~ maximum number of characters
Out Replacement result
Output Replacement result
Depends on the data type of the
variable that the output parameter is
Boolean
Bit string Integer
Real
number
Time, date
String
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In1
●
In2
●
L
●
P
●
Out
●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data type.
REPLACE
EN ENO
In1 Out
In2
L
P
8-197