LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Error Handle in an Event Structure?

ErrorHandlingQuestionNIforum.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hello,

 

I want to know what the best practice is for Error Handling in an While Loop - Event Structure combination.

In the above picture there is a start-event (not visible) that sets the timeout to >0, for starting executing the code in the timeout-event.

The problem I have is when an error occurs. This error will never be reset and forever flow through the while-loop.

 

Can you guys help me in the right direction, please? 

 

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 1 of 5
(6,500 Views)

1) You can put a state machine around the event structure to ask to go to a certain error state whenever an errror occurs

or

You can dynamically create an event that will handle all the errors and performs the required options.

 

Guru

Regards
Guru (CLA)
Message 2 of 5
(6,479 Views)

Hi heinen,

  You can create an Error(cluster) indicator and hide it..Now create an event for that error(cluster) and configure that event for value change...In this way you can do the error handling...

 

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


Message 3 of 5
(6,469 Views)

Well you have many possibilities to do it. I suggest this one see attached VI. With this solution you can logg the error in a text file if you want.

 

Message 4 of 5
(6,461 Views)

Here is a simple and easy way, but it is not very elegant.  It simply stops the loop and you have to look at the error out.  It does no clean up.  Ideally, a state machine is better.  Look for the status after each state or event.  If an error occurs, make the clean up state the next state.  In clean up, turn off power, reset whatever, close references, and send a true constant to the loop stop sign.

 

This example is just for simplicity in case you don't need clean up.

 

EventError.png

- tbob

Inventor of the WORM Global
Message 5 of 5
(6,430 Views)