02-10-2012 02:34 AM
I am developing an application where all the sub VIs should use the error of the master vi where the master vi generates a custom error. The sub VIs sould base their action depending on which error it received. What is the best way to define custom errors so that the custom errors are automatically added when a user on any other computer is using my VIs? also How should i throw the custom errors based on a condition, say after 5 mins i want to generate a time out error ?
Solved! Go to Solution.
02-10-2012 02:59 AM
> You can create your own table (2D) with column 1 will have custom error code and other will have its meaning.
How should I throw the custom errors based on a condition, say after 5 mins I want to generate a time out error ?
Design one timer, after timeout send a "Timeout error code" from table.
What you can have is a "Functional global" which will store error code. It will be in Write mode in your "Master vi" where you will generate errors depending on whatever conditions
In your subVis, same "Functional Global" will be in read mode. So you ll have error code available in all subvis.
Then may be you can have case structures in subvis to handle those errors accordingly.
I guess I have made my point clear, and I hope this will help you a bit.
02-15-2012 03:19 AM
>
thank you...i have currently created a wrapper vi with general error hanldler with custom codes and their description... which is a better approach??
02-15-2012 06:09 AM
Even this is a good idea, you know your application very well, so if it sounds good to you then even we are happy.![]()
Only one thing I want to suggest, you can actually have a file (text, excel) to store these error codes and description.
Advantage of it is, later in future if you want to add/delete any codes, you don't have to change code, or build exe
02-15-2012 08:01 AM
LabVIEW comes with an Error Code File Editor. You can distribute these error code files to other installs. You can also include them when you build an application (although it sounds like you are not doing that). Please read the LabVIEW Help on custom error code files.
02-16-2012 12:10 AM
Gaurav : good idea.. I'll surely try it..
Smercurio_fc : I am not sure right now if It will be an application or a shared librry.. I looked into the help and it will be really helpful..thanks,,,