I'm updating/improving an old instrument driver. The instrument can create four instrument specific errors and warnings.
I know how to create custom errors, and which error codes to use. But I just wonder what it the preferred method of supplying the error message that comes with it.
Looking the N.I. instrument drivers I've been using, I can choose between:
1. Make an 'Error Message' vi, that the user calls after using the instrument. Then all custom error codes go in there.
2. Directly attach the error message to the error code, when calling the 'error cluster from error code' vi within the instrument driver. Then, you don't need to call a Err Msg vi, but it might take more programming within the driver.
I see the first method being used in most drivers that's I've downloaded. But the driver template from NI doesn't produce a Err Msg vi. In stead, the supplied Error Query vi seems to use the second method....
What would be the preferred way of doing things?