LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to define instrument error codes

Hi,

 

I am writing an instrument driver and am following the steps onlined here. I am confused about error handling within a distributable instrument driver. Drivers I have downloaded in the past have errors in these ranges

 

-1073999873
to -1074001919
BFFC0801 to
BFFC0FFF
ERROR: Developer defined errors

 

How do I define error codes in this range for an instrument driver so the "General Error Handler.vi" can recognize the error and display the approriate message?

 

For example, if you open the "General Error Handler.vi" and input any error code defined here and enable error status into the error in cluster then run the VI it will automatically display the proper error message defined in the previous link. Is this how a instrument driver should operate as well?

 

Thanks!

 

 

0 Kudos
Message 1 of 8
(3,337 Views)
If you want to be sure that your error codes do not step on existing ones, you need to create your error codes in the ranges that NI has set aside for user-defined errors. One range is from 5000 to 5999, and there are others.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(3,316 Views)

Thanks for the feedback, Mike. But if you release an instrument driver with user defined codes they would interfere with the instrument driver's user software if they also defined codes within that range. Am I missing something here?

0 Kudos
Message 3 of 8
(3,313 Views)
No, that is basically the situation. Stinks, but that is the situation. The basic problem is that there are only so many error codes possible and Microsoft and NI were in line ahead of you.

But maybe you don't need your own codes, does an existing code express what you need to say?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 8
(3,303 Views)

I will say yes, yes they will interfere, So when you run you app 1 of 3 things can happen. either will 1) display a random error code not the one you defined.  or 2) won't display anything and 3) and this is the option we all can agree to hate, which is a broken VI.

 

Iwould have to agree with Mr. MikePorter

 

"The basic problem is that there are only so many error codes possible and Microsoft and NI were in line ahead of you."

 

You can double check this:


"But maybe you don't need your own codes, does an existing code express what you need to say? "


Mayb e some codes that are already in LabView will can work for your application.?

 

I you want further information on this topic, please refer to the following documentation.

 

http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/def_custom_error_text/

http://www.ni.com/white-paper/3209/en/

http://zone.ni.com/reference/en-XX/help/lv/71/lvhelp/Def_Custom_Error_Text/

https://decibel.ni.com/content/docs/DOC-13543

 

I hope this reply finds you well.

Please let us know if you need further information.

 

 

Warm Regards,

Sigi D.

Application Engineer.

"everything is achieveable through technology'
0 Kudos
Message 5 of 8
(3,265 Views)

@abeaver wrote:

Thanks for the feedback, Mike. But if you release an instrument driver with user defined codes they would interfere with the instrument driver's user software if they also defined codes within that range. Am I missing something here?


At least NI will report all defined errors for the error number so you can narrow it down.  I guess the real problem is more subtle than just "what happens if the error number is thrown?"  I guess it would be more like, "What if the software is set up to swallow that error number?"  That would be the real concern.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 8
(3,247 Views)

Thanks for all the replies! Now I understand the situation. Here is my workaround solution 🙂

 

errors.png

 

 

0 Kudos
Message 7 of 8
(3,234 Views)

Awesome!!!!!

 

keep us posted if anything else comes up!

(hopefully it won't happen anything unexpected because you are an awesome programmer ) Smiley Very Happy

Have a good day man!

 

Sigi D.

Application Engineer

National Instruments

 

"everything is achieveable through technology'
0 Kudos
Message 8 of 8
(3,226 Views)