LF: Find Values in DTI Row

This Ladder function searches a range of rows for data that matches the current contents of a struct.

If the function finds a matching row, the row number is stored in parameter E, Result. If no row is found, E contains -1.

The structure of the DTI and the struct must match.

 

Parameter Name

Purpose

A

Data Table to Search

Select the Data Table to search.

B

Struct: Value to Find

Select the Struct.

The function searches the DTI for a row matching the value currently in this struct.

C

Start Row for Search

Assign a Data Tag or enter a number to provide the start row for the search.
This is the actual row index number, NOT an offset value.

D

Number of Rows to Search

Assign a Data Tag or enter a number.

Note that: supplying a value of '0" will cause the function to search the entire table.

E

Result: Number of Matching Row

If the function finds a matching row, the index number is stored here.

A value of -1 means no match was found.

 

If the value in Start Row + Number of Rows equals or exceeds the number of rows in the table,
Result =-1 and an ERRNO code will be given.

 

Related Topics

Data Tables

Creating a Data Table

Data Table: Indexed (DTI)

LF: Write Row to DTI

LF: Read Row from DTI to Struct

LF: Insert Row to DTI

LF: Remove Row from DTI

LF: Clear DTI Row

LF: Copy Array to Column in DTI

LF: Copy DTI Column into Array

LF: Write value to DTI Column

LF: Load DTI File to PLC Data Table (SD)

LF: Store DTI to File (SD)

LF: Clear DTI