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

AVEVA™ Plant SCADA

DevGetField

  • Last UpdatedJul 18, 2023
  • 1 minute read

Gets field data from the current record in a device.

Syntax

DevGetField(hDev, 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.

sField:

The field name, as a string of up to 10 characters. (The dBASE file format limits all field names to a maximum of 10 characters.)

Return Value

The field data (as a string). If the field is not found an empty string is returned.

DevOpen, DevSetField

Example

INT

FUNCTION

GetRecipe(STRING sName)

INT hDev;

hDev = DevOpen("Recipe", 0);

IF hDev >= 0 THEN

DevSeek(hDev, 1);

IF DevFind(hDev, sName, "NAME") = 0 THEN

PLC_FLOUR = DevGetField(hDev, "FLOUR");

PLC_WATER = DevGetField(hDev, "WATER");

PLC_SALT = DevGetField(hDev, "SALT");

PLC_MILK = DevGetField(hDev, "MILK");

ELSE

DspError("Cannot Find Recipe " + sName);

END

DevClose(hDev);

ELSE

DspError("Cannot open recipe database");

END

END

See Also

Device Functions

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