From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Client Server VI hanged due to event structure

I am doing a project.  The project is send files over tcp/connection to backup the files in a network hard drive. So I have created a program that has a client server system where as you know the server will send the files using tcpip connection and the client will accept the files and store it in the network hard drive. I have four conditions. The conditions are copy all data, copy data older than a date or younger than a given date (which Iam attempting to do now) and later on defined data, which is u will be able to select which folder you want to copy. I have done copy all data and it works. I am doing now copy data younger than ( which will be same as data older than just difference of older and younger ). I have created the program. But I have to make some changes to the server part without affecting the copy all data program. So I put an event structure across the server program, where 2 events are copy all data and data younger than which responds to two boolean buttons All data and data younger than, so I can make appropriate changes to the copy data younger than withóut affecting copy all data program. But the problem is when I put the event structure and I run the program and clicked either of the 2 buttons, the complete vi gets hanged and is not responding. Can you please help me find a solution for this. I have attached the code with this. Thanking You. 

 

Vindsan

0 Kudos
Message 1 of 2
(2,575 Views)

There are so many things wrong with your VI....

 

- The way you have structured your VI, the event structure will only happen once and then your application will exit. Almost 100% of the time you will want a while loop around the event structure so it will execute multiple times.

- Look at some LabVIEW examples about how to use the event structure properly.

- LabVIEW will lock the front panel while the event structure is executing - you shouldn't put long-running tasks inside an event structure for this reason.

- I think there are some caveats/issues around registering for the same static event in multiple event cases (only one of them will receive the event).

- Tidy up your VI - you have wire bends everywhere, hidden wires, wires going backwards. 

- Your VI is probably prone to lots of race conditions. Learn about DATAFLOW!


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 2
(2,550 Views)