LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call chain from error cluster

Hello dear readers,

 

I have stumbeld into a problem where I need to extract call chain from error clusters that are generated by labview VIs and native functions.

 

Untitled.png

 

Here is example of 2 completely different results:

Untitled.png

Source by definition should mean origin of error, why sometimes I see error description added into it if it can be extracted by error code??

If other strings are added how can one separate call chain from other informations ?

I could not find documentation how this string is generated and how to format source string back to call chain that will work in all cases.

0 Kudos
Message 1 of 10
(5,960 Views)

I agree with you that the error information should be consistent.

 

Now, I'm not apologizing for NI but, the error guts have been changed a few times over the history of LabVIEW.  For instance the Error Ring disappeared in Version 8.0 and reappeared with enhanced functionality in 2012.  The older sources and functions just could not make use of the features found today.  The ini configuration API was reworked for 2009 I don't know why the Developer of that chose such a poor error number and description.  (Since He worked on the Error Chain feature too!)

 

NXG has had exactly the same concerns and should be quite a bit better about that. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 10
(5,946 Views)

Hi Pawhan11,

 

I don't believe you can guarantee that every error cluster has the call chain on it, but if you are the one defining the errors, you can use the function "Error Cluster from Error Code VI". This has a boolean input for show call chain which you will want to set to true. In this case, source does not refer to a place of origin, but the thing which caused the error; both are valid definitions.

Message 3 of 10
(5,943 Views)

The reason I am asking for this is that I want to have EH that will better fit to my needs, since many error coses appear in other external drivers and then it is a mess with error cluster. I have defined simple Error class on top of error cluster that allows me to add custom errors without necessity to pay attention to error codes since errors are device/module specific. When I add error myself I know for sure what was the call chain. When LV creates error it is unclear how this call chain is inserted into source... and that is the only thing that I am missing to convert error from labview error cluster into my error class.

 

I am trying with random NI vis and I can not see clear pattern of what content is to be expected (in this case no call chain only vi name inside vilib):

Untitled.png 

 

0 Kudos
Message 4 of 10
(5,934 Views)

That one will have a description in <LabVIEW>\resource\errors\English\Analytics and Machine Learning-errors.txt or within <Program Files>\National Instruments\Shared\Errors\

 

Those are the two locations that are used to hold xxx-errors.txt files when you use tools>>Advanced>>Edit Error Codes...

 

A shame that they cannot hold format specifiers like the Error Ring can (today)

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(5,926 Views)

I have made simple VI that gets all NI errors divided into groups and descriptions based on error code (assuming it is unique). The problem is with call chain. Why this vi gives only name to itself when error appeared in Vi that is in Subvi, in the same subvi like screenshots from first post?

0 Kudos
Message 6 of 10
(5,921 Views)

@pawhan11 wrote:

I have made simple VI that gets all NI errors divided into groups and descriptions based on error code (assuming it is unique). The problem is with call chain. Why this vi gives only name to itself when error appeared in Vi that is in Subvi, in the same subvi like screenshots from first post?


Bad assumption.  The error codes within a family name must be unique (more that one file can contain errors for the same family name but, that's bad practice).  1 error file can also contain errors for more than 1 family name but, that is bad practice too (installers install them with the installed build so its better to go with 1 family name per product and one product per error file)

 

So, duplicate what the innards of the error ring dialog do (or just use THAT it's open) and store them as variants of class data Family Name, Display name, Code, and description.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 10
(5,914 Views)

Interesting, in general error handling we have ErrorCodaDatabase vi that calls dll that gets error code description based on error code. If NI decided to have the same error codes in for example say 2 groups how this function determines which one to get based only on error code?

 

Untitled.png

 

For example this error code from LV exists within 2 families: 

Untitled.png

They mean more or less the same so that is not a big problem

 

0 Kudos
Message 8 of 10
(5,886 Views)

@pawhan11 wrote:

Interesting, in general error handling we have ErrorCodaDatabase vi that calls dll that gets error code description based on error code. If NI decided to have the same error codes in for example say 2 groups how this function determines which one to get based only on error code?

 

 

 

For example this error code from LV exists within 2 families: 

 

They mean more or less the same so that is not a big problem

 


Explain errors shows both


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 10
(5,865 Views)

Thanks, by explain error You mean right click on error cluster?

I must admit I have never known about this after 5 years of LV programming 🙂

 

How Can I use this feature programatically? The only reference I could find was:

https://forums.ni.com/t5/LabVIEW/Possible-to-return-the-quot-Explain-Error-quot-string/td-p/2227456

It refferences to general error handler which is based on getting error description based on error code.

 

0 Kudos
Message 10 of 10
(5,845 Views)