OPC write interface to the DeltaV Continuous Historian

Return codes for C++ methods

A status summary message of any errors generated by a call to the CreateTags, GetItemHandles, or Insert method appears in the Windows Event Viewer under Windows LogsApplication.

Table: HRESULT and ppError return codes

Value
Name

Type Method Description

0x00000000
S_OK(1)

HRESULT
ppError

CreateTags
DeleteAtTime(1)
GetItemHandles(1)
Insert(1)

All history tag creations, data writes, or item deletions succeeded.

0x00000001
S_FALSE(1)

HRESULT

CreateTags
DeleteAtTime(1)
GetItemHandles(1)
Insert(1)

One or more of the history tag creations, data writes, or item deletions failed.

0x40041002
OPC_S_NODATA

ppError DeleteAtTime No values matching times given to delete.

0x80004003
E_POINTER

HRESULT CreateTags A null pointer was passed for either pszTag or pTagType.
Insert A null pointer was passed for either phServer, ftTimeStamps, vDataValues, or pdwQualities.

0x80004005
E_FAIL(1)

HRESULT
ppError

CreateTags
DeleteAtTime(1)
GetItemHandles(1)
Insert(1)

An unexpected error occurred during history tag creation, while writing a history sample, or deleting an item.

0x80040305
HDA_MSG_TAG_LIMIT_EXCEEDED

ppError CreateTags History tag creation failed because it would result in more than 2,000 tags in the current and active data sets.

0x80040307
DVCH_HDE_NOT_ENABLED

ppError

CreateTags
Insert

The Enable historical data entry option on the Advanced tab of the Continuous Historian Properties dialog is not enabled on the workstation where the DeltaV Continuous Historian is running.

0x80070057
E_INVALIDARG(1)

HRESULT CreateTags dwNumItems is either equal to 0 or greater than 2,000.

Insert
DeleteAtTime(1)

dwNumItems is equal to 0.
ppError Insert(1)
  • The time stamp of the history sample is outside the range of the current or active data set.
  • The handle of the history sample is not associated with a valid .HDE tag.

0xC0040001
OPC_E_INVALIDHANDLE(1)

ppError

Insert(1)
DeleteAtTime(1)

Invalid OPC HDA server item handle.

0xC0040006
OPC_E_BADRIGHTS(1)

ppError

CreateTags
DeleteAtTime(1)
Insert(1)

Invalid user security prevented history tag creation, inserting the history sample, or deleting an item.

0xC0040007
OPC_E_UNKNOWNITEMID(1)

ppError GetItemHandles(1) The item does not exist.

0xC0040008
OPC_E_INVALIDITEMID(1)

ppError GetItemHandles(1) The OPC item ID was specified incorrectly.

0xC004100B
OPC_E_DATAEXISTS(1)

ppError Insert(1) A history sample with the same time stamp has already been inserted.

0xE23E0017
HDA_MSG_NO_LICENSE_OR_OVER_MAX_CLIENTS

HRESULT

CreateTags
Insert

No licenses available or too many clients are currently connected.

0xE23E0453
HDA_MSG_TAG_ALREADY_EXISTS

ppError CreateTags History tag creation failed because the history tag already exists.

0xE23E0454
HDA_MSG_ILLEGAL_TAG

ppError CreateTags History tag creation failed because the history tag contains an illegal character, is missing the .HDE suffix, or is greater than 160 characters (excluding the .HDE suffix).

0xE23E0455
HDA_MSG_ILLEGAL_TAG_TYPE

ppError CreateTags History tag creation failed because the history tag type passed was something other than a DvCHFloat32 or DVCHUNCString.
(1) For more information about these return codes for the DeleteAtTime, GetItemHandles, and Insert methods, refer to OPC Historical Data Access Specification Version 1.20.