Jump to content

An error is an error is an ...?


Recommended Posts

Search the LabVIEW Help is your friend. There is a fairly extensive explanation of errors and error codes there. And I have it in my head that user error codes start at 5000, and no, I don't think it makes a difference if they are positive or negative. I just start at 5000 because it's easy to remember. :)

Link to comment

QUOTE (simplemaan @ Aug 22 2008, 02:34 PM)

Is there any difference between a positive valued error and a negative valued error?

I have some odd inkling that a positive number is an error, whereas a negative number is a warning, but maybe that's how it used to be a long time ago - I can't find any references to back that up...

Link to comment

Error codes in an error code cluster may be positive or negative. There are old VIs still around that do not return an error code cluster, only an error code. Some but not all of these VIs have a convention that negative means warning, positive means error. Check the VI's documentation if you are dealing with one of those.

For the record, the range of error codes reserved for users includes both positive numbers and negative numbers. Check the LV documentation for the exact ranges that are reserved (my memory is that they are not symetrical because part of the negative range had already been used by shipping products, but the documentation is more authoritative than my memory).

Link to comment

QUOTE (simplemaan @ Aug 22 2008, 02:34 PM)

Is there any difference between a positive valued error and a negative valued error? i.e., if I am specifying a user error code, is it a best practice to use positive valued vs. negative valued errors in different situations?

Well, the only thing I was able to find was that the user error codes are in the range of -8999 to -8000 and 5000 to 9999.

I seem to remember somebody telling me that the negative error codes were for all things 'external' to LabVIEW, i.e. device drivers, DAQ, VISA, .NET, ActiveX

But then of course there are the GPIB error codes, which are positive, and the Mathematics error codes that are negative. And then there are the Waveform Error Codes that have the same meaning as positive and negative error codes.

You can look up the default error codes in the LabVIEW help under Contents -> Fundamentals -> Running and Debugging VIs -> How-To -> Error Codes and Messages -> Ranges of LabVIEW Error Codes

Link to comment

Various NI products have various sections of the int32 range reserved. LabVIEW's reserved range is all positive, so positive numbers are what you'll get from all the built-in primitives. It overlaps with GPIB's range unfortunately because those two products predate when we started reserving independent ranges. Last time I looked, LV used error codes went from 1 through about 1500. But there's no inherent meaning in the fact that they're all positive. That's just the section that is reserved for LV use. Math is a separate DLL, developed by a subteam of LV, and they decided to reserve their own range so they didn't worry about accidentally using the same code when they're off in their own parallel development branch.

Link to comment

QUOTE (Ton @ Aug 23 2008, 01:06 AM)

An error cluster represents an error if the boolean is True.

In other cases it is considered a Warning, though GPIB functions have some codes that mean 'Successfully applied'

Ton

Hence, it's a "warning" about something potentially not being 100% in alignment with the overall code or purpose of the code.

Link to comment

QUOTE (crelf @ Aug 23 2008, 09:14 AM)

thank you for not confirming my senility.

Actually in the old days it was the other way around, negative meant error, positive meant warning.

-10401 meant "DAQ Device not found", one of the most common questions we dealt with as an AE.

Another group of current VIs that return an "error code" which does not indicate an error or warning are the FTP VIs. On successful connection they return 220 which is the FTP status for successful connection.

Link to comment

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.