Find sub-string (find), C.7.11 find sub-string (find) – Nematron Pointe Controller User Manual

Page 425

Advertising
background image

Pointe Controller User Guide

Appendix C: Ladder Diagram Block Reference

423

C.7.11 Find sub-string (FIND)

When used in a Ladder Diagram, the FIND block finds the first occurance, if any,
of a sub-string within a given string. The position of the sub-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: the Input String 1 (IN1) is
searched for the first occurance, if any, of the Input String 2 (IN2). If IN2 is found
within IN1, then the starting position is placed in the Output Value (OUT). If IN2
is not found, then 0 is placed in OUT.

For example:

IN1: ‘This is OpenControl.’

IN2: ‘is’

OUT: 3

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.

Advertising