Instruction Manual

Pointe Controller User Guide Appendix C: Ladder Diagram Block Reference
421
C.7.10 Replace sub-string (REPL)
When used in a Ladder Diagram, the REPL block replaces part of an input string
with a specified number of characters from another input string, starting at a
specified position. The resulting string is sent to output.
Select the
tool (from the String Blocks toolbar) and click on a ladder rung to
insert the following block:
Once the block is inserted, you can double-click on it to configure it.
Functional Description
This block always passes the Enable input state (EN) through to the Enable Out
output state (ENO) without change; when EN becomes on, ENO is turned on, and
when EN becomes off, ENO is turned off.
When EN becomes on, the block function is executed: a sub-string in Input String
1 (IN1), starting at the specified Position (POS) and of specified Length (LEN), is
replaced with Input String 2 (IN2). The resulting string is placed in the Output
String (OUT).
For example:
IN1: ‘Hello world.’
IN2: ‘GOODBYE’
POS: 4
LEN: 5
OUT: ‘HelGOODBYErld.’
NOTE: If there are fewer than POS characters in IN1, then IN1 and IN2 are simply
concatenated.
The block function is executed every time the ladder is scanned, so long as EN
remains on. If EN becomes off, then OUT remains at its last calculated value until
EN becomes on and the block function is executed again.