Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

DevFind

  • Last UpdatedJul 18, 2023
  • 1 minute read

Searches a device for a record that contains specified data in a specified field. The search starts at the current record and continues forward until the matched data is found or the end of the database is reached. If the file has a keyed index, an indexed search is used.

For SQL devices, this function is a blocking Cicode function.

Syntax

DevFind(hDev, sFind, sField)

hDev:

The device handle, returned from the DevOpen() function. The device handle identifies the table where all data on the associated device is stored.

sFind:

The data to find in sField, as a string.

For SQL devices: The DevFind() function can distinguish between numbers, strings, and dates, so you do not need to enclose the data in quote marks. Dates and times need to be in the correct format:

• Date: YYYY-MM-DD

• Time: HH:MM:SS

• DateTime: YYYY-MM-DD HH:MM:SS[.F...] (The fraction .F... is optional.)

sField:

The field name to match.

Return Value

0 (zero) if successful, otherwise an error code is returned.

DevOpen, DevSeek

Example

! Find the Ice cream recipe.

DevNotFound=DevFind(hDev,"Ice cream","Recipe");

IF DevNotFound=0 THEN

! Get the recipe values.

..

ELSE

Prompt("Ice cream not found");

END

See Also

Device Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in