06-28-2011 01:49 AM
06-28-2011 02:05 AM
I think your code changes the value of the stop variable to "true" when some errors occur in the tcp/ip publisher loop. Another possibility is that the error in the publisher makes something in the server loop (or listener) which modifies the value of the STOP global variable to true.
Because of not all code is visible I can't tell you exactly where you have to look at so, first of all you have to search where your code write the value of the Stop global variable and then you have to check what happen when an error occur.
06-28-2011 02:18 AM
06-28-2011 02:24 AM
What I have seen in your code is: the Stop viariable stops the above loop, and the Stand by variable, set in stand-by mode the tcp loop. Isn't it?
06-28-2011 02:33 AM
You really don't provide enough information for us to troubleshoot the problem. A picture is not enough, attach your VIs.
@Himmet wrote:
thanks ricky but stop gloable variable causes to stand by first while loop.Because first while loop sometimes works, sometimes does not work.
What is the meaning of "works" here?
06-28-2011 02:43 AM
06-28-2011 03:12 AM
@Himmet wrote:
But first while loop stops when second while loop stops...
What is your meaning of "stops"? Does the entire VI complete?
Could it be that loop 1 is hanging in a subVI?
06-28-2011 03:13 AM - edited 06-28-2011 03:14 AM
Ok, if you want the first while loop is stoped when the tcp/ip while loop stops it is right to use a stop global variable if that kind of variable will stop some other parallel threads in the software, if the stop variable stops only those two loops it will be better to use a local boolean variable, but you have to implement a logic that set to true the variable when the tcp/ip have to stop the second loop. So, first you have to wonder when do I want the second loop has to be stopped?