LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn off equipment if error -50808

Hi everyone - I am new to Labview, so please forgive me for stupid questions.

 

I continue to get error -50808 (example screenshot below) at each of the DAQ assistants located outside of my while loop (indicated with arrows in the attached code). I have followed the instructions provided by NI for preventing this error, i.e., regularly disconnecting and reconnecting USB cords to my NI DAQ 6001, disabling "USB selective suspend", and using a USB 3.0 port. Unfortunately this error still occurs unpredictably, and when it happens, the pumps and MFCs that should turn off upon exiting the while loop remain on until I acknowledge the error message in Labview. 

 

How do I change my code such that if an error occurs, and/or I hit the stop button, the pumps and MFCs controlled by the indicated DAQ assistants will turn off? 

 

Thanks! 

 

kbrigit_0-1656702752818.png

 

 

0 Kudos
Message 1 of 3
(739 Views)

Wow, that code is a mess. You have over a dozen places where that error could be coming from. Every "Simple Error Handler" in your loop is a point where this error could be coming from. It would be very difficult to say exactly which one of those was throwing the error. You also have some very bad code constructs. Why are you using a double, then converting it to a Boolean via the "Convert From Dynamic Data" when all you need is a basic True/False constant. There are wires running every which direction, under case statements and under basic nodes. There are coercion dots all over the place. I have no idea why you are using the big formula node when you could simply use a case structure. I would also get rid of all the express VIs and use the basic DAQmx nodes.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 3
(714 Views)

First READ THIS!  

Next, there are no stupid questions here.  OK, your question show ignorance but not stupidity! we can fix ignorance "you can't fix stupid"

Now, if you still have problems with the device throwing the error you really need to look farther into your code.

 

Capture.png

From the Hierarchy View I can ascertain that  you have used 21 individual calls to the General Error Handler from your main vi.  Each copy of that vi will display a Prompt to the User if Error In contains an error.  You do NOT want that to happen!  What you need is for Cleanup code to execute without user interaction if an error occurs and THEN tell the User why the code shut down safely because of an error.

 

You do exit the various loops on error but, you should make sure your shutdown code executes without user interaction and then inform the user what error interrupted the program.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 3
(711 Views)