Historian Error Codes

Historian functions will return a zero on success. On error, they will return either a numeric value or a STRUCT, where the structure is more common. The STRUCT will contain the following:

 

ErrorCode\ErrorCode - the numeric error code
ErrorCode\ErrorText - Optional text describing the error
ErrorCode\ErrorTime - UTC timestamp when the error was generated

 

The caller of the Historian function should wait for Valid(ErrorCode). The typical coding pattern is as follows:

HistorianSomeFunction(....., ErrorCode);
...
If Valid(ErrorCode);
[
IfElse(True(ErrorCode == 0),
... success
{ Else }
... fail - error number is PickValid(ErrorCode\ErrorCode, ErrorCode)
);
]

Defined error codes:

Constant Value Notes
HISTORIAN_SUCCESS 0  
HISTORIAN_ERROR_INVALID_PARAMETER 1  
HISTORIAN_ERROR_UNKNOWN_CONNECTION_TYPE 100001  
HISTORIAN_ERROR_ILLEGAL_GETDATA_QUERY 100002  
HISTORIAN_ERROR_STORAGE_LOCKED 100003

The account under which you are now running VTScada does not have the permissions granted to the account under which you were previously running VTScada.

Use Windows tools to change ownership of the locked files. This is most likely to happen when storage is located in a folder outside the VTScada installation.

HISTORIAN_ERROR_RECORDS_DO_NOT_EXIST 100004 the records requested do not exist in storage according to the sequence counters
HISTORIAN_ERROR_CONNECTION_FAILED 100005
HISTORIAN_ERROR_RECORD_READ_FAILURE 100006 the records requested should exist in storage, but there was an error retrieving them
HISTORIAN_ERROR_RECORD_WRITE_FAILURE 100007  
HISTORIAN_ERROR_STORAGE_INCONSISTENT_WITH_SEQUENCE_COUNTER 100008  
HISTORIAN_ERROR_FIELD_DOES_NOT_EXIST 100009  
HISTORIAN_ERROR_RECORD_DELETION_FAILURE 100010  
HISTORIAN_ERROR_INITIALIZATION_FAILURE 100011  
HISTORIAN_ERROR_SCHEMA_PERSIST_FAILURE 100012  
HISTORIAN_ERROR_FAILED_TO_LAUNCH_THREAD 100100