LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

retry making connection

Solved!
Go to solution

Hi all, I have to make a connection through TCP/IP to a device to read some values. But when the machine where the device is installed on has no power supply, my device also has no power suply and the connection will fail. Now i had the idea to retry to make a connection every couple of minutes when an error is detected. In this case the program does not stop running an will connect automaticly when there is a possibility to connect. How can i solve this or are there any other suggestions for the problem?

 

Best Regards

 

Stefvg

0 Kudos
Message 1 of 9
(4,003 Views)

Hi Stefvg,

i find the idea very well. You can use a statemachine for it. One case is for the connection and another for the wait. Make the wait time not to big, so that it is easy possible to exit the program after a short time. If you need a bigger wait time, then you can use a counter as multiplier.

 

Mike

Message Edited by MikeS81 on 02-09-2009 09:34 AM
0 Kudos
Message 2 of 9
(4,001 Views)

Hi, i don't realy understand what you mean. Do you mean a casestructure? Can you maybe give me a smal example of how to implement this because i am not that familiar with LV. Thanx

 

Best Regards

 

Stefvg

0 Kudos
Message 3 of 9
(3,996 Views)

Hi Stefvg,

yes i meant  a case structure. See the attached example.

 

Hope it helps.

Mike

0 Kudos
Message 4 of 9
(3,992 Views)

Hi, I think this is exactly what i need. But when i save your vi and use it as a subvi in my vi, there is something wrong. I connect my parameters ip, port, wait time and connection id to your vi. When i run my vi, your vi blocks at the type cast in case connected. Do you know why this is happening? When i just make connection whitout your vi it works properly.

 

Best Regards

 

Stefvg

0 Kudos
Message 5 of 9
(3,987 Views)

Hi Mike, I think i solved the problem. I just deleted the case connected en changed every name connected in exit. Now the subvi works like it should.

 

Thanks for your help.

 

Best Regards

 

Stefvg

0 Kudos
Message 6 of 9
(3,980 Views)
Solution
Accepted by topic author stefvg

Hi Stefvg,

yes this should work. I thought you insert your code into the provided structure.

 

Mike

0 Kudos
Message 7 of 9
(3,965 Views)

Hi, I've implemented the Subvi in my vi and everything works just fine. But i am using some while loops and sequence structures in my program. Is it possible to add a button (or buttons) to abort an action and stop the entire program. An example: when i am trying to make a connection i am in the subvi until a connection is made or i push the emergency stop button. Now i actually want to stop making a connection when pushed at a button whitout stopping the whole program (with the emergency button). Or i want a button that stops the program no matter in which loop the program is in. Is this possible or not? I've added my program in attatchment.

 

Best Regards

 

Stefvg

0 Kudos
Message 8 of 9
(3,953 Views)

Hi Stefvg,

you can use a button reference. Insert it into the connection vi and read the property "value" in every iteration.

 

Mike

0 Kudos
Message 9 of 9
(3,948 Views)