03-22-2016 04:47 AM
Hello all,
I'm currently building an application which talks to some python via socket and am currently trying to impliment some error control.
I have a 'receive data' subVI which recieves data from python through the socket. However if there is a problem with the connection then this subvi will 'hang'. I wish to impliment a timeout whereby if the timer is elapsed then the code will ignore the fact that subvis outputs have not been met and the code will continue with an error message. Some sort of break/interrupt or try statement would suit this in text based. What would be the equivalent?
start timer
run receive data subvi
if timer > 1 second:
continue and return error (ignoring that subvis outputs have not executed)
Thanks,
Oliver
03-22-2016 05:46 AM
You need to find a way to do this inside your SubVI - what you're asking for goes against one of the main principles of data flow (a subvi will only complete once all of its outputs have been met). Typically, any LabVIEW functions that rely on an external communication (e.g. TCP, VISA/Serial) have a 'timeout' node which will cause the node to exit if no data is received within the timeout.
If you post your 'receive data' subVI, we might be able to find a way to help you do what you want.
03-22-2016 12:39 PM
http://forums.ni.com/t5/LabVIEW/Interrupt-a-an-unfinished-state-in-a-QSM/m-p/2820274#M825410