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

AVEVA™ Plant SCADA

DevWrite

  • Last UpdatedJul 18, 2023
  • 1 minute read

Writes a string to a device. If the device is free-format, the data is written to the device as specified. If the device is record-based, the data is written to the current field, and the field pointer is moved to the next field.

Writing to a DBF device appends the data to the device.

Writing to a SQL device appends the data to the device only when all fields of the row have been written.

Syntax

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

sData:

The data to write, as a string.

Return Value

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

DevOpen, DevWriteLn

Example

! Write PV123 to the device.
DevWrite(hDev,"PV123="+PV123:###.#);

For SQL devices: The DevWrite 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.)

See Also

Device Functions

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