01-11-2012 02:03 AM
Hello there,
I have a labview application (exe) and a labview shared library (dll). both running in parallel and have some functions in common. they do not call/know each other. the exe is running stand alone and the dll is called from c++.
I need to share data between those 2 instances and usualy do this with networked shared variables. but for some reason i cannot create a networked shared variables of type "byte stream file reference". but i need to accomplish that when a file is opened with dll function then the labview exe can write to this file.
any ideas?
regards
Thomas
01-11-2012 06:10 AM
My instinctive response is: Dont. Let one set of functions handle file operations. I think it's hard to pass file ref, you'll have to pass filename and possibly file position.
/Y
01-12-2012 03:19 AM
I can only agree to what Yamaeda said: Dont try to do that!
When you need to access a File form two different Application Instances you will need to Open (and therefore create the File Reference) the File in both Instances.Since both Instances run in pararel we are dealing with a shared Resource. This may lead to Race Conditions. You wont be able to tell who is accessing or writing data. You may be able to overcome this with additional synchronisation but it aint elegant.
Why dont you try the following aproach:
One Instance does all the File I/O and you only transmit the Data that has to be written or read?
01-12-2012 03:36 AM
I understand your interventions, but my requirements are more simpler. I only need to open a file in both Exe or DLL. But only exe writes to file. None is reading. I need to be able to write to a file in exe which is opened in DLL. I will use the following ugly approach now: In exe i make a loop which checks some network shared string variable which represents a filename. From DLL i can change that string which the exe then will notice and open the new file.
01-12-2012 05:51 AM
If only exe is writing and none is reading, then the DLL only need the path. 🙂
Create or look for some "set path"-function. 🙂
/Y