LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Ring changing code number?

Solved!
Go to solution
Solution
Accepted by topic author AMP12

Defined Error Codes such as seen here:

Capture.PNG

Are defined in the *_errors.txt files

This specific code is found in BOTH the LabVIEW WSN error text file and the UTF Error text file so it has two possible explainations.  If The UTF Was not installed the second error code explaination would not be found.  If Neither addon existed the explaination would be "An Undefined error"  occured at......

 

Nicely with the error ring it contains the information of what Tool Kit the error belongs too.

 

 DO NOT throw errors from toolkits the vi does not belong too!  Just because you find a cool error code that makes sense does not mean your vi is a member of the module that owns the error.txt file!  An analogy is using your friends credit card number.  You are not your friend and soon, he may not be friendly towards you either, leaving you at the checkout counter with no valid credit and egg on your face.  This is likely what you did.

 

At the bottom of the error ring range selector is "Custom Error"

!0.png

 

!00.png

This is a custom error it is saved in the vi not in an *_error.txt file Nifty: It can contain format specifiers! Errors in the error.txt files cannot.  

 

So, what do you want to do?

A)Create a MyModule_error range

B)Use a "Custom error"

C)Abuse another module's error code

 

 

For A  You create the error.txt file, and check this box:

Capture.PNG

 

For B You only need to have the vi installed

 

For C (Not Recommended) You need to track which module's errors you are using and include those modules in "Additional Installers" since those modules installers install their custom error code files

 

 


"Should be" isn't "Is" -Jay
Message 11 of 18
(1,146 Views)

Thanks for all the extra time Jeff!

 

Your option B was the one I wasn't sure on some of the details.  I suspected that is was simply saved in the VI, but couldn't find any verification to that fact elsewhere.  Some of the specifiers are pretty cool too!  I won't make the mistake of abusing someone else's errors in the future.

0 Kudos
Message 12 of 18
(1,105 Views)

@JÞB wrote:

 

!00.png

This is a custom error it is saved in the vi not in an *_error.txt file Nifty: It can contain format specifiers! Errors in the error.txt files cannot. 


Oh come on, how have I never known this was a feature.  I'd say this covers so many custom error code use cases.  And you can choose to use an existing error code like 7 but then specify your own text.

 

A few things I did notice that I don't like is that %s doesn't accept a path like format into string does, you need to use the path to string first.  And I noticed your custom text needs to be on a single line.  Pressing return closes the dialog.

0 Kudos
Message 13 of 18
(1,085 Views)

Okay one of the limitations I just mentioned was the multi line input issue.  Where in the dialog you can't press enter or else it will close the dialog.  But looking at the source of the XNode it looks like it should support a multi line input.  So if you choose to copy text which has multiple lines, and then paste it into the dialog, it appears to work as expected.  

 

I'm guessing this is a bug and should be brought to NI's attention.

 

And as for the other limitation, this too could be a bug.  NI should be using the adaptive terminal inputs on the XNode, then the inputs will change based on the possible options going into the format into string where %s can mean a string, or path.

 

Error Ring Multi Line.png

0 Kudos
Message 14 of 18
(1,074 Views)

Hooovahh wrote:
And I noticed your custom text needs to be on a single line.  Pressing return closes the dialog.

Use Ctrl+Enter and you will get a new line.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 15 of 18
(1,067 Views)

@crossrulz wrote:

Use Ctrl+Enter and you will get a new line.


Thanks, that certainly is easier than pasteing text, or editing XNodes.

0 Kudos
Message 16 of 18
(1,062 Views)

@Hooovahh wrote:

@JÞB wrote:

 

!00.png

This is a custom error it is saved in the vi not in an *_error.txt file Nifty: It can contain format specifiers! Errors in the error.txt files cannot. 


Oh come on, how have I never known this was a feature.  I'd say this covers so many custom error code use cases.  And you can choose to use an existing error code like 7 but then specify your own text.

 

A few things I did notice that I don't like is that %s doesn't accept a path like format into string does, you need to use the path to string first.  And I noticed your custom text needs to be on a single line.  Pressing return closes the dialog.


Path to String..... Relative or Absolute path to string or array of strings?  Yes, the predominant would be Absolute to String (And make it cross platform) Perhaps you have an "Idea" there......

 

How you didn't know I can't speak to.  It was covered well in the release notes for 2012 and nuggetized on these forums.

 

BONUS: "Right Click Explain Error" picks up the text on either the FP or the BD.  Although Sadly, Menu>>Help>> Explain Error (My Custom Short-cut Ctrl+!) Doesn't pick up the BD text before 2014 I had asked for it as a Christmas present just after the 2012 release.


"Should be" isn't "Is" -Jay
0 Kudos
Message 17 of 18
(1,043 Views)

@JÞB wrote:

BONUS: "Right Click Explain Error" picks up the text on either the FP or the BD.


Now that one I use daily, only wish it worked on arrays of references, so I wouldn't have to copy out the error element so I could right click it.

 

I think I didn't notice the feature because I had (have) my own way of making custom error ring constants that find error codes in LabVIEW already.  Guess I didn't think the error ring did much else other than that.

0 Kudos
Message 18 of 18
(1,017 Views)