Jump to content
ChrisStrykesAgain

An end to error 5000

Recommended Posts

NI has established "user" error code ranges:

  • -8999 through -8000
  • 5000 through 9999
  • 500,000 through 599,999.

Unfortunately, I can't count the number of "error 5xxx" constants that I've seen. We should stop that; it leads to confusion at best.

In an ideal world every developer or organization would have their own reserved error code ranges, but I accept that's not reasonable.  That said, has anyone considered creating an informal list that organizations/individuals can publish their preferred error code ranges in? I think it might be useful. For example, if I'm at Company X and I see Company Y likes to use the range 501,000 to 501,999 then I'd probably choose not to use that range to avoid potential confusion to some extent. 

It wouldn't be fail-safe or enforceable, but I think it would be valuable; is anyone else on board with the idea? If so, we'd need to decide on where to publish them, but the LabVIEW Wiki would be one obvious choice in my opinion.

Share this post


Link to post
Share on other sites

We use 5000-5999 for project/application specific Error codes, and then different ranges for other common components.
But for an instrument drivers, we might use one of the existing LV-error codes, and for that we use a small tool to find a good error code.
 

ErrorCodes.vi

Share this post


Link to post
Share on other sites

Note: if you have a Tools Network package, you can request assigned ranges of error codes for just your library.  For example, "SQLite Library" errors start at 402860

  • Like 1

Share this post


Link to post
Share on other sites
On 11/28/2019 at 5:13 AM, drjdpowell said:

Note: if you have a Tools Network package, you can request assigned ranges of error codes for just your library.  For example, "SQLite Library" errors start at 402860

Are these ranges published, per chance? If not, I think this proposed wiki page might be a good repo for those as well (if the authors are willing to divulge).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.