LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Handling in Application

Solved!
Go to solution

I have a program which uses user defined error codes (read from ...user.lib\myerrors-errors.txt). Problem is that I don't want to add these in my application as static error codes.

The application does not seem to read from the that file (see above) as the VI did. I don't really want to make my own error handling library, I don't have the time right now.

 

How does the application know which error codes are defined?

 

Regards

0 Kudos
Message 1 of 6
(3,547 Views)
Solution
Accepted by topic author Lind

Hi Lind,

 

The following two Knowledge Bases should provide you with some information regarding your problem:

LabVIEW Error Code File Locations

Defining Custom Error Codes

 

You probably have a problem with the application locating the right directory for the error .txt file.

 

Regards,

 

Peter S

0 Kudos
Message 2 of 6
(3,542 Views)
Thank's for your reply, I'll check them out.
0 Kudos
Message 3 of 6
(3,525 Views)

Have you check "Copy error code files" at the advanced page when creating an executable?

 

From the help:

 

Copy error code files—Adds copies of XML-based LabVIEW error code text files from the project\errors and user.lib\errors folders to the run-time engine. Note: You must manually create an errors folder in the labview\user.lib directory to organize your error code files.

 

EDIT

--- but that will cause the error file to be added as static ..... (i think)

Message Edited by Pnt on 11-20-2008 12:55 PM
Message Edited by Pnt on 11-20-2008 12:55 PM
0 Kudos
Message 4 of 6
(3,523 Views)

Found a solution in oine of the knowledge bases!

 

When runnning LabVIEW the error code files are in ...LabVIEW 8.2\user.lib\errors\

When running run-time the error code files are in ...Shared\LabVIEW Run-Time\8.2\errors\English (or another language).

 

This helps me ALOT...

 

thanks for your replies

0 Kudos
Message 5 of 6
(3,518 Views)

In my opinion there is a problem in the way LabVIEW handles custom error codes using the XML "database" file concept.

To recap, the concept is to save errors and their descriptions in files named XXX-errors.txt stored in

  • LabVIEW <version>\user.lib\errors directory.
  • National Instruments\Shared\LabVIEW Run-Time\<version>\Errors directory.
  • LabVIEW <version>\project\errors
  • see the complete list here: error file locations

The problem is that custom error codes are very often project specific and storing project specific data in the development platform makes project management difficult. Suppose for instance that more than one user (or development machine) want to edit the project, not at the same time of course. Unless you make an agreement to copy the error database from the project folder to the development PC before working on the project and back again to the project when done, you will break the code!

 

Suggestion: It would be practical if there was a way to have the General_error_handler.vi not only look for custom xxx-error.txt file on the development machine but also in the project construct.

After all, the project environment is the recommended structure for development. In there you can control all aspects of your application design and building - except such an important issue as error management!

Now this is a mystery to me why it is made this way. Proper error handling is one of the hall marks of good programming, and is difficult enough by itself. The least you want is awkward development system support.  I suggest NI to work on that issue. Or - have I overlooked an obvious way to work around the issue?

 

regards

Henning

Message Edited by henning larsen on 05-11-2009 11:23 AM
0 Kudos
Message 6 of 6
(3,344 Views)