Just a general question...
At times, I've noticed that our file server on our company's netowrk is extremely slow at times. How do you guys go about programming for slow network speeds on your internal network and occasional use over the WAN?
Solved! Go to Solution.
You need to be a bit more specfic. How is the network latency affecting you? If you are having issues writing to file impacting your data collection or processing then it is generally advised to separate your file I/O task from the data collection. Do each in a separate loop and pass the data via a queue, notifier or user event.
I will be writing data to a comma delimited text file that the user specifies via a Express File Dialog. As a workaround, the file is saved to a location on the hard drive (usually the desktop), data written there, then exported to the file server when the user is done with their testing.
The latency is causing slow saves on the network when pointed to save there, which gobbles up time the user could be doing some other action instead of waiting for the program to respond.
First, the express VIs are generally very inefficient. I would use the file primatives directly. Secondly, it sounds like you are writing to the file in the same task (part of your code) that you are doing your other work. As I mentioned above you should separate the file processing into it's own task. In LabVIEW this will be a parallel loop to the main loop. Pass the data to be logged to the logging task via a queue. You can find examples for how to work with files and how to use queues in the shipping examples. You may also want to look at the examples for the producer/consumer architecture. What I am proposing is essentially a producer/consumer construct. It would also be helpful in the future if you include the code you are having difficulty with. It is much easier to give advice when we can comment directly on your code rather than just giving you generic answers.