I am trying to implement error handling for a program that I will be distributing to other users. My end users are not very tech-savvy so I am trying to make things as simple as possible for them.
I am trying to handle the error of a phidget not being attached. In order to accomplish this, I clear the error coming out of the Phidget Open vi and instead create my own error code to display a message to the user that the Phidget is disconnected and to connect it and then restart the program or check the serial number. Since I am using multiple phidgets/hardware, this allows me to control which states in my state queue come after this error so that I can try to shut down everything else gracefully before closing the front panel.
However, what happens is that it appears to work the first time. I get the error message that I've written as I'm supposed to, and the program closes down as I think it should. However, it displays the same message even after I replug in the Phidget, so it doesn't seem to recognize that the phidget is now physically attached again. When I close LabView, I get the attached Access violation error message.
Has anyone else seen this? I've been looking at NI forums and this seems to occur sometimes with LV2011. Do I need to upgrade to LV2011 SP1? Is there a problem with using the Phidgets VIs if I upgrade to LV2011SP1?
I am using the following boards:
1062 Stepper Controller
1032 LED Controller
This only happens when the phidget is not found during the running of the VI. If the phidget is attached, everything runs as normal.
Is there something in all of the subvis that may have been left open, even though the high level Open VI failed?
Is there another way to handle the error other than clearing it so that all of the subvis are closed appropriately? It sounds like these errors also happen when .dlls are mishandled (opened but not closed).
The phidgets error that is occurring is 7013 for Given timeout Exceeded. I am stepping into the Stepper Open Vi, and it looks as if the error occurs within the Phidget Open SubVi at the Wait Attach subsubvi. Is there any way to find out what the .dll calls have been up to this point so that I can close them appropriately?