Jump to content

Error Handling Everywhere there is a problem

Recommended Posts

I have a very large application not written very carefully but I could see all subvis are linked using error clusters. There are 12 loops on the block diagram and all of them are merged together in the end and all queues are released properly. This vi calls FPGA, and TTL power supply and also communicates with few other third party instruments.

At the moment I have no FPGA connected, I run the vi and obviously it wont go anywhere as the CompactRIO is not wired to the PC. The application however doesn't stall either. It is hard for me to find all the faults ( if there are any) in the application. I am only interested in running it, design few state machines, make sure they all work and be able to close the application by pressing the stop button.

Now because of the fact the hardware is not connected to my pc, I would like the application to at least return the errors. I added the Simple error handler vi where all the queues are released and clicked the stop button but this does not return any error. I added few booleans to see which loop stops and which doesn't. I noticed that only the producer and consumer loops were stopped. Rest of them did not even go to the Stop case.

In order to finish my work I could just cover all the cases where the instruments are called in the diagram disable structure and finish the state machines. But I may consequently miss some errors which are not there due to the hardware but for someother reason.

I am just downloading Structured error handler library and I hope that by putting the express vi in each case of each loop and setting it to notify, it will keep telling me where the errors are. And then I can see if this is the pure hardware problem and just set the diagram disable structure to disable for that part of the case structure, run the main vi again and find the next error? Can I achieve this?

My biggest worry is certain UDP vis in one of the loop in the project. These are certain pre-built vis I received from my colleague before he left us. I remember he telling me once that these vis when incorporated in a project sometime initialize/shutdown with no problem, but sometimes when you start the application and you send the query to the instrument, it wont work. The other times it will work fine. During shutdown, sometimes they shutdown smoothly, but sometimes they stop the application and the only way to get out of it is by using CTRL+ALT+Delete.

This really makes the whole application unreliable to the end-user. I just did some research and found this UDP error are due to the communication timeout problem and could be eliminated by using Structured Error Handler VI. We could just set it to retry (infinite) and it will make sure that the application starts fine.

I believe the application must stop in all conditions when the 'Stop' button is clicked. Is this achievable?

it might be a valid reason to give to the end-user that 'this occurs due to the timeout problem, Please click the stop button and then double click the icon on the desktop'

Sorry about the big essay. Hope I am on the right track? Thanks for reading.


Link to comment

Have you turned on Automatic Error Handling both in Tools >> Options and on all VIs in your project? You can quickly write a "get all VIs in memory, turn on automatic error handling" VI to do that rather than doing it by hand. That will make an error go off if there is some place where the errors are being dropped.

If you have access to the Desktop Trace Toolkit, that will add an entry to the log file every time an error is generated at the point of original error generation, assuming you have debugging enabled on the VIs.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.