Cicode Programming Reference > Cicode Function Categories > Error Functions Introduction > ErrDrv

ErrDrv

Gets a protocol-specific error message and native error code.

Syntax

ErrDrv(sProtocol, sField, nError)

sProtocol:

The CitectSCADA protocol.

sField:

The field in the PROTERR.DBF database:

nError:

The protocol specific error code. This field needs to be a variable as it also the place where the returned error code is stored.

Since the first 34 specific error codes are standard for all protocols, CitectSCADA may add 'masking' to make the error code unique. For example, if an I/O device returns errors 1 to 10 (which are already used), the driver may add 0x100000 to its error codes. When this function is called, the mask will be removed before the result is returned to this variable.

Return Value

The error message (as a string), or an empty string ("") if the error is not found. The error code is returned into the nError variable.

Related Functions

ErrInfo, ErrHelp

Example

// Get the error message and number associated with error 108
nError = 108;
sError = ErrDrv("TIWAY", "MESSAGE", nError);

See Also

Error Functions