LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to restart the stopped loops

Hello,

Here I'm attaching a VI which is similar to my application with comments of each and every loop.

In consumer loop, if I get error code the loop will stop working and it will close the TCP connection. Similarly command & response loop also will stop working if error 66 occurs.

I want to start automatically closed TCP connection and closed loop.

Kindly help me to address the issue.

 

Regards,

S Nagaraju

0 Kudos
Message 1 of 7
(2,946 Views)

Hi Sonti,

 

if I get error code the loop will stop working

Why do you stop the loops when you don't want to stop them???

Create a small state machine in each consumer loop: on INIT and in case of TCP errors you can open/close the TCP reference. Only stop the loops when you receive a STOP command from your queue…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(2,933 Views)

Just don't exit on an error then.

 

LOL - I guess I'm half asleep, being that Gerd had responded nearly ten minutes before I did - and I hand't noticed.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 7
(2,921 Views)

Thank you for the replay.

 

If I initiate the TCP connection again in consumer loop, same reference (new connection ID) will not pass to command & response loop. Because initially I’m opening the TCP port outside of the loops.

 

How to pass the new TCP connection ID to other loop.

 

Regards,

S Nagaraju

0 Kudos
Message 4 of 7
(2,915 Views)

Hello Bill,

Suppose client closes the connection, Server side (Present VI) should re-initiate for next connection.

 

How to do it automatically.

 

Regards,

S Nagaraju

0 Kudos
Message 5 of 7
(2,913 Views)

Hi Sonti,

 

when both consumer loops run in the same app on the same computer: merge the loops.

When both run in different apps/different computers: no problem, use the statemachine approach above…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(2,910 Views)

Hello GerdW,

Sorry, I didn't get your point.

I have only one consumer loop in attached VI. Other loop is independent loop and the input is TCP connction for the command & response loop. If i move TCP listen VI into the consumer loop how to get the parallel connection ID for the other loop.

 

Regards,

S Nagaraju

0 Kudos
Message 7 of 7
(2,884 Views)