I have a c# program that updates a txt file at random time intervals, and a labview program that continuously checks the data in the txt file and checks it.
Can you guide me to a way to avoid collisions between those apps?
I have a c# program that updates a txt file at random time intervals, and a labview program that continuously checks the data in the txt file and checks it.
Can you guide me to a way to avoid collisions between those apps?
LabVIEW has a deny access-vi. So you could block C# from writing while it reads. http://zone.ni.com/reference/en-XX/help/371361E-01/glang/lock_range/ (Deny access - Read - Allow access)
I'd do the writing in C# with a try-catch loop, or something like that - but I'm no C#-expert.
One simple way is to use a named/global mutex
http://msdn.microsoft.com/en-us/library/f55ddskf.aspx
Mutex's with the same name are seen as the same by all processes. You can use them to signal or lock.