How to share data between applications. 
Author Message
 How to share data between applications.

I'm trying to share data between labview v6.0 and another program (16
bit), both running on Windows95. At first DLL's seemed to be the
answer but I would need to call 16 bit DLL's which I understand can be
a problem. With my limited knowledge of C++ I've written a program
(Borland C++4.2) which can access the data I need and save it to a
file, this is then repeatedly read by LabVIEW, crude but it works.
When I add code to do the same the other way I get occasional file
sharing errors. I can't get either LabVIEW or C++ to trap these
errors. As an alternative I thought I could write and read to a
reserved portion of memory  (less than 1K should be enough) using in
port and out port. Is this viable, and if so how do I reserve the
memory in Windows 95 so that LabVIEW & my C++  program can access it?

Any suggestions?



Mon, 06 Oct 2003 21:27:46 GMT  
 How to share data between applications.

Quote:

> I'm trying to share data between LabVIEW v6.0 and another program (16
> bit), both running on Windows95. At first DLL's seemed to be the
> answer but I would need to call 16 bit DLL's which I understand can be
> a problem. With my limited knowledge of C++ I've written a program
> (Borland C++4.2) which can access the data I need and save it to a
> file, this is then repeatedly read by LabVIEW, crude but it works.
> When I add code to do the same the other way I get occasional file
> sharing errors. I can't get either LabVIEW or C++ to trap these
> errors. As an alternative I thought I could write and read to a
> reserved portion of memory  (less than 1K should be enough) using in
> port and out port. Is this viable, and if so how do I reserve the
> memory in Windows 95 so that LabVIEW & my C++  program can access it?

> Any suggestions?

May be TCP/IP or UDP interprocess communication will do? It shouldn't be
a problem via localhost. You can try separate VI server to handle
communication task from your vi with C++ socket.

--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia

http://acs.levsha.ru



Tue, 07 Oct 2003 03:25:51 GMT  
 How to share data between applications.
I have done something similar.  My LabView app communicates with another
running app (written in c++) via a space in memory called a File Mapping
Object.  This is basically a section of memory that both processes can
read/write from/to.  I used the CIN feature of LabView to call some C
code that opens (or creates) this File Mapping Object by using Windows
SDK calls such as CreateFileMapping and MapViewOfFile and reads from it
and writes to it via calls to memcpy.  The other c++ app uses these same
functions to accomplish its reads and writes.

Let me know if you need further help.

-Stephen

Quote:

> I'm trying to share data between LabVIEW v6.0 and another program (16
> bit), both running on Windows95. At first DLL's seemed to be the
> answer but I would need to call 16 bit DLL's which I understand can be
> a problem. With my limited knowledge of C++ I've written a program
> (Borland C++4.2) which can access the data I need and save it to a
> file, this is then repeatedly read by LabVIEW, crude but it works.
> When I add code to do the same the other way I get occasional file
> sharing errors. I can't get either LabVIEW or C++ to trap these
> errors. As an alternative I thought I could write and read to a
> reserved portion of memory  (less than 1K should be enough) using in
> port and out port. Is this viable, and if so how do I reserve the
> memory in Windows 95 so that LabVIEW & my C++  program can access it?

> Any suggestions?



Tue, 07 Oct 2003 03:35:04 GMT  
 How to share data between applications.
Thanks for the reply.
I should have said that both applications are on the same computer.


Tue, 07 Oct 2003 18:23:40 GMT  
 How to share data between applications.

Quote:

> Thanks for the reply.
> I should have said that both applications are on the same computer.

I've meant the same :). Localhost or 127.0.0.1 means the same machine.
My experience using TCP/IP at the same machine brings good benchmarks.

Cheers,
--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia

http://acs.levsha.ru



Tue, 07 Oct 2003 20:55:22 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. multi-process shared data and thread private data

2. Tk 8.2 send of binary data to Tk 7.6 application corrupts data

3. running clipper application in directory shared on W2k Server

4. Shared DOS Applications?

5. : Sample Small Eiffel Applications to share??

6. Anyone have Eiffel 2.3 applications to share

7. Shared memory for inter-application communications?

8. sharing resources labview <-> other applications

9. writing LabVIEW application on Solaris that invokes a function in a shared library

10. Sharing VISA Resources With Multiple Application Instances

11. Calling scheme/lisp from C shared object - commercial application

12. Shared variables in multitasks applications ?

 

 
Powered by phpBB® Forum Software