Gets a protocol-specific error message and native error code.
ErrDrv(sProtocol, sField, nError)
The CitectSCADA protocol.
The field in the PROTERR.DBF database:
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.
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.
// Get the error message and number associated with error 108
nError = 108;
sError = ErrDrv("TIWAY", "MESSAGE", nError);