
06/20/2024

Hello,
I have a legacy c++ application that uses a WinTech dll to communicate with a PI OPC HDA server. I happen to have the WinTech code and I can see that the insert functionality just wraps the following opc com function
virtual HRESULT STDMETHODCALLTYPE InsertReplace(
/* [in] */ DWORD dwNumItems,
/* [size_is][in] */ OPCHANDLE __RPC_FAR *phServer,
/* [size_is][in] */ FILETIME __RPC_FAR *ftTimeStamps,
/* [size_is][in] */ VARIANT __RPC_FAR *vDataValues,
/* [size_is][in] */ DWORD __RPC_FAR *pdwQualities,
/* [size_is][out] */ HRESULT __RPC_FAR *__RPC_FAR *ppErrors) = 0;
Â
In certain instances when inserting multple values, InsertReplace returns S_FALSE.
When I look at the contents of ppErrors, I’m seeing that most of the values are set to S_OK, but for one of the points the ppErrors vector contained the value: 0x509A6B0
But the value at the point was successfully written to the PI database.
Another tag contained the following values in the ppErrors array:
0x80004005
0x4FFB0C0
I tried using IOPCCommon : public IUnknown
virtual HRESULT STDMETHODCALLTYPE GetErrorString(
/* [in] */ HRESULT dwError,
/* [string][out] */ LPWSTR __RPC_FAR *ppString) = 0;
but the string return was unknown error
Does anyone know what these error codes are? TIA
1 Guest(s)