Quantcast
Channel: All LabVIEW posts
Viewing all articles
Browse latest Browse all 204132

Error Handling Using Connections

$
0
0

What is the recommended way to handle errors and successfully close connections such as TCP/IP communication or a connection to a database.

 

In a text based language I would typically do the following:

 

Connection myConnection.

Try

{

    myConnection.Open();

    myConnection.DoStuff();

}

Catch( someError)

{

}

Finally

{

    myConnection.Close();

}

 

It is not clear to me in LabVIEW if I pass the error to the close connection if that VI will run.

IE)

Error Passed Through.png

 

or

Error Not Passed Through.png

 

Ideally when dealing with the error I would like to return my program back into a known state which in many cases is a closed connection.


Viewing all articles
Browse latest Browse all 204132

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>