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

AVEVA™ Plant SCADA

DevClose

  • Last UpdatedJul 18, 2023
  • 1 minute read

Closes a device. Any data in the buffer is flushed to the device before it is closed. After a device is closed, its device handle becomes invalid and cannot be used.

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

Syntax

DevClose(hDev, Mode)

hDev:

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

Mode:

The mode of the close:

0 - Close the device in user mode - the default mode if none is specified. A device opened by Cicode function DevOpen need to be closed in this mode.

1 - Close the device in remove logging mode - under this mode, the current device will be rolled over to history files immediately. You should only use this mode in a report.

2 - Close the device in keep logging mode - under this mode, the current device will not be rolled over to history files. This allows subsequent messages to be written to the same file. This mode is used internally in a report written in rich text format (rtf).

Note: Do not call DevClose to the current device in an rtf report. This may make the output file unreadable.

Return Value

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

DevOpen

Example

DevClose(hDev);

See Also

Device Functions

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