11-27-2018 12:25 PM
I have two VIs that both access the same text file asynchronously, one continuously reading and one writing. Every so often one or the other process fails because the file is currently locked. Is there a way to:
1. Tell Labview to open for read in such a way that it does not prevent writing by another program?
2. Have LV wait for the lock to clear and then open (without me making some sort of while loop)?
3. Something else?
11-27-2018 01:13 PM
a QMH (Queued Message Handler) would be the way to fix your problem.
Writer sends requests to write and the data to write into the queue. Reader sends requests to receive file data and a ref to the Queue he is listening on.
Cakewalk
11-27-2018 02:11 PM
I think though, that this won't work because they are separate memory spaces (compiled VI into exe). Or is there a way to share a queue between them?
11-27-2018 02:53 PM
@AlexGSFC wrote:
I think though, that this won't work because they are separate memory spaces (compiled VI into exe). Or is there a way to share a queue between them?
You can wrap-up an Action Engine and use VI Server to call functions in one application with another application.
Allison claimed she posted an example in this thread.
Ben
11-27-2018 03:31 PM
I am assuming you have tried opening the file with the access level set to read only, and the problem still occurs?
11-27-2018 04:12 PM
@AlexGSFC wrote:
I think though, that this won't work because they are separate memory spaces (compiled VI into exe). Or is there a way to share a queue between them?
Here is a network queue. It acts just like a normal queue but transports data over a TCP connection so you can use the queue to communicate between two applications.
12-03-2018 08:43 AM
I am using the read/write from spreadsheet. Is there a way to make this read only when I read? Or, more generally if I am using these two together on the same file is there a way to make them not step on eachother's toes?
12-03-2018 08:44 AM
Thank's for this idea. I might try this this week and see where I get.
12-10-2018 10:18 AM
Hi, can you save this network queue as 2016? Our system is locked into that version until we have a lot of down time to regression test everything with a newer version. Thanks!
12-10-2018 10:47 AM
Here is a LV 2015 version. I happened to have a copy on my PC.