to the same file on another machine, However, there is the problem of the 2 vi's trying to access the same file? I believe i can use semaphores to doe this. I do not know much, besides a bit of the theory tehreof, Please advise how to go about this? ThanksI assume the file is on a shared network volume, otherwise it wouldn't be an issue, because it's not really the same file.
The semaphore you want is already built into the file system. When you create the file, or open it for writing, you have the option of specifying the OPEN MODE and the DENY MODE. The OPEN MODE determines how THIS FUNCTION will access the file, the DENY MODE determines how ANOTHER PROCESS will be allowed to access the same file during this operation.
Depending on what you want to do, you could write to it from VI #1 using WRITE ONLY and DENY READ AND WRITE.
VI #1 has to check errors when opening the file, because it won't necessarily be available.
Then VI #2 would open it using READ ONLY and DENY READ AND WRITE, and check
errors, because it won't necessarily be readable.
If a permissions error occurs on either VI #1 or #2, wait a while and try again, or noify the user, whatever. But you MUST check errors.
This gives exclusive access to one VI or the other.
If you need to, you can relax the DENY parameter and have simultaneous access. Read the HELP for the OPEN FILE function.
PAY ATTENTION TO ERROR RESULTS from the file functions. Don't assume there will be no errors just because 99.9999% of the time there aren't any.
Make your operations as quick as possible, to reduce the chances of a collision.