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

AVEVA™ Plant SCADA

DevSetField

  • Last UpdatedJul 18, 2023
  • 1 minute read

Sets new field data in the current record in a device.

Syntax

DevSetField(hDev, sField, sData)

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.)

sData:

New field data, in string format. Plant SCADA converts any other data type into a string before setting the data.

Return Value

0 (zero) if the data is successfully set, otherwise an error code is returned.

DevOpen, DevAppend, DevGetField

Example

! Set the fields in the "Recipe" device.

hDev=DevOpen("Recipe", 0);

DevSeek(hDev, 1);

DevSetField(hDev,"Name", "WhiteBread");

DevSetField(hDev,"Flour", IntToStr(iFlour));

DevSetField(hDev,"Water", iWater:####);

DevSetField(hDev,"Salt", iSalt);

DevClose(hDev);

See Also

Device Functions

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