User | Kudos |
---|---|
6 | |
5 | |
3 | |
3 | |
2 |
First the background: I'm writing a LabVIEW wrapper library for a dll that is used to control one of my company's products. The dll functions return an unsigned integer error code which I use to generate a LabVIEW error cluster. I can translate these codes into a range reserved for user error codes, but the problem with this is that other libraries could be using the same codes. After speaking with a LabVIEW AE it seems that NI has not included a scheme for dealing with this aspect of error handling in 3rd party driver development (Please let me know if I am wrong about this). I ended up creating a functional global that holds a base value to translate the returned dll codes by. This allows library users to move the codes from each library to a unique range (If they do set a base, a default value is returned).
What I'd like NI to do: It would be valuable if NI were to develop a documented scheme for coordinating library error codes in a calling application so that library developers have a model to follow. If what I've done is reasonable it would be good if NI includes VI's in the library template for setting the error base for a library. Also, in order to be able to right-click an error indicator and show error details it is necessary to create an XML file (I forget where this lives) containing error codes and the desired explanations of the errors. This works fine for fixed codes, but if a base is changed the values in the file will need to be changed. I can do this programmatically inside of my Set/Get Error Base functional global, but it would be much easier if LabVIEW had a VI for doing this. I think there is a wizard for creating the XML files, but I haven't found it yet and I don't know if it has an API.
For LabVIEW to be useful for robust applications there really must be a way of programmatically identifying errors uniquely, but this requires coordinated effort among library developers. If NI has not addressed this, hopefully they will.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.