LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating Between Built LV App.s

Hi,

Here is an example. Test Mapping.vi and Test Mapping.exe communicate with
each other. Test Mapping.exe can run multiple instances.

Please let me know how it works for you.

Regards,

Wiebe.


"Neal" wrote in message news:40449905@newsgroups....
> I'm now using UDP and it is working well. However, I am interested in the
> memory mapped file method you mentioned because I may have problems with
UDP
> if there is no network card installed. Could you please send an example
of
> the method you mentioned?
>
> "Wiebe@CARYA" wrote in message
> news:40431acb@newsgroups....
> > Hi,
> >
> > After doing some test with this method, I think it might be a good
> solution.
> > There are some disadvantages, but also some advantages.
> >
> > Disadvantages:
> > Windows only.
> > One PC only.
> > Uses API's.
> > Low level (unless wrapped).
> > Memory errors when changing control type (during development).
> >
> > Advantages:
> > Fast, little overhead.
> > Full control over synchronisation etc.
> > Can also be used from other languages.
> > All applications can read or write to the "global" at will.
> > Use as many applications as you like.
> >
> > If you're interrested, let me know.
> >
> > Regards,
> >
> > Wiebe.
> >
> > "Wiebe@CARYA" wrote in message
> > news:403f0d05@newsgroups....
> > > HI,
> > >
> > > You could use the windows (MS only) way; by using memory mapped
files...
> > >
> > > Regards,
> > >
> > > Wiebe.
> > >
> > > "Neal" wrote in message
news:403b6c93@newsgroups....
> > > > I have several built LabVIEW applications that I need to exchange
data
> > > > between when they are running simultaneously on the same PC. Data
> > Socket
> > > is
> > > > probably one of the best ways to accomplish this task but it
requires
> > some
> > > > extra installation and file handling that could complicate things
for
> > the
> > > > end user.
> > > >
> > > > Does anyone have a better suggestion for communicating between built
> > > LabVIEW
> > > > App.s?
> > > >
> > > >
> > >
> > >
> >
> >
>
>



[Attachment Test Mapping.zip, see below]
0 Kudos
Message 11 of 19
(2,236 Views)
To get access to TCP/IP, UDP etc. on a PC without a network card you can install a virtual network card / loopback card. As far as I remember you can find it as an option if you try to add a network card in the add device panel...

We've used this on some occasions to be able to use our tcp/ip based client/server solutions on PCs without a network card.

To comment on the que thread: The OpenG Toolkit includes a remote que solution. I highly recommend it, you can find it on www.openg.org
0 Kudos
Message 12 of 19
(2,038 Views)
It will work fine but still requires TCP for VI Server operation...


LabVIEW, C'est LabVIEW

0 Kudos
Message 13 of 19
(2,038 Views)
Which he will have available if he installs a loop-back card driver (comes standard from Microsoft)...
0 Kudos
Message 14 of 19
(2,038 Views)
Thanks for your example code. I tested it against the UDP code that I wrote
and the UDP was about ten times faster than the memory mapped file method.
For speed reasons I think I'll stick with UDP. If I ever need a simple
Windows method on a computer that has no networking support I will use the
memory mapped method. Thanks again for your help.

"Wiebe@CARYA" wrote in message
news:4044b740@newsgroups....
> Hi,
>
> Here is an example. Test Mapping.vi and Test Mapping.exe communicate with
> each other. Test Mapping.exe can run multiple instances.
>
> Please let me know how it works for you.
>
> Regards,
>
> Wiebe.
>
>
> "Neal" wrote in message news:40449905@newsgroups....
> > I'm now using UDP and it is working well. However, I am interested in
the
> > memory mapped file method you mentioned because I may have problems with
> UDP
> > if there is no network card installed. Could you please send an example
> of
> > the method you mentioned?
> >
> > "Wiebe@CARYA" wrote in message
> > news:40431acb@newsgroups....
> > > Hi,
> > >
> > > After doing some test with this method, I think it might be a good
> > solution.
> > > There are some disadvantages, but also some advantages.
> > >
> > > Disadvantages:
> > > Windows only.
> > > One PC only.
> > > Uses API's.
> > > Low level (unless wrapped).
> > > Memory errors when changing control type (during development).
> > >
> > > Advantages:
> > > Fast, little overhead.
> > > Full control over synchronisation etc.
> > > Can also be used from other languages.
> > > All applications can read or write to the "global" at will.
> > > Use as many applications as you like.
> > >
> > > If you're interrested, let me know.
> > >
> > > Regards,
> > >
> > > Wiebe.
> > >
> > > "Wiebe@CARYA" wrote in message
> > > news:403f0d05@newsgroups....
> > > > HI,
> > > >
> > > > You could use the windows (MS only) way; by using memory mapped
> files...
> > > >
> > > > Regards,
> > > >
> > > > Wiebe.
> > > >
> > > > "Neal" wrote in message
> news:403b6c93@newsgroups....
> > > > > I have several built LabVIEW applications that I need to exchange
> data
> > > > > between when they are running simultaneously on the same PC. Data
> > > Socket
> > > > is
> > > > > probably one of the best ways to accomplish this task but it
> requires
> > > some
> > > > > extra installation and file handling that could complicate things
> for
> > > the
> > > > > end user.
> > > > >
> > > > > Does anyone have a better suggestion for communicating between
built
> > > > LabVIEW
> > > > > App.s?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
>
0 Kudos
Message 15 of 19
(2,236 Views)
Hi,

That's a supprise to me. The memory mapping can only be used with lot's of
overhead, but I guessed UDP had even more overhead... It seems not to be the
case...

Thanks for letting me know.

Regards,

Wiebe.


"Neal" wrote in message news:404c9b95@newsgroups....
> Thanks for your example code. I tested it against the UDP code that I
wrote
> and the UDP was about ten times faster than the memory mapped file method.
> For speed reasons I think I'll stick with UDP. If I ever need a simple
> Windows method on a computer that has no networking support I will use the
> memory mapped method. Thanks again for your help.
>
> "Wiebe@CARYA" wrote in message
> news:4044b740@newsgroups....
> > Hi,
> >
> > Here is an example. Test Mapping.vi and Test Mapping.exe communicate
with
> > each other. Test Mapping.exe can run multiple instances.
> >
> > Please let me know how it works for you.
> >
> > Regards,
> >
> > Wiebe.
> >
> >
> > "Neal" wrote in message news:40449905@newsgroups....
> > > I'm now using UDP and it is working well. However, I am interested in
> the
> > > memory mapped file method you mentioned because I may have problems
with
> > UDP
> > > if there is no network card installed. Could you please send an
example
> > of
> > > the method you mentioned?
> > >
> > > "Wiebe@CARYA" wrote in message
> > > news:40431acb@newsgroups....
> > > > Hi,
> > > >
> > > > After doing some test with this method, I think it might be a good
> > > solution.
> > > > There are some disadvantages, but also some advantages.
> > > >
> > > > Disadvantages:
> > > > Windows only.
> > > > One PC only.
> > > > Uses API's.
> > > > Low level (unless wrapped).
> > > > Memory errors when changing control type (during development).
> > > >
> > > > Advantages:
> > > > Fast, little overhead.
> > > > Full control over synchronisation etc.
> > > > Can also be used from other languages.
> > > > All applications can read or write to the "global" at will.
> > > > Use as many applications as you like.
> > > >
> > > > If you're interrested, let me know.
> > > >
> > > > Regards,
> > > >
> > > > Wiebe.
> > > >
> > > > "Wiebe@CARYA" wrote in message
> > > > news:403f0d05@newsgroups....
> > > > > HI,
> > > > >
> > > > > You could use the windows (MS only) way; by using memory mapped
> > files...
> > > > >
> > > > > Regards,
> > > > >
> > > > > Wiebe.
> > > > >
> > > > > "Neal" wrote in message
> > news:403b6c93@newsgroups....
> > > > > > I have several built LabVIEW applications that I need to
exchange
> > data
> > > > > > between when they are running simultaneously on the same PC.
Data
> > > > Socket
> > > > > is
> > > > > > probably one of the best ways to accomplish this task but it
> > requires
> > > > some
> > > > > > extra installation and file handling that could complicate
things
> > for
> > > > the
> > > > > > end user.
> > > > > >
> > > > > > Does anyone have a better suggestion for communicating between
> built
> > > > > LabVIEW
> > > > > > App.s?
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>
0 Kudos
Message 16 of 19
(2,038 Views)
Neal,

There's a "wait 1 ms" in "Wait For Write.vi". It is there to prevent 100%
proccessor load, but it should not be executed the first iteration.

After adjusting the VI, I get a typical 10X speed up (16X for read, 9.1X for
write)!

Regards,

Wiebe.

"Wiebe@CARYA" wrote in message
news:404d91b3@newsgroups....
> Hi,
>
> That's a supprise to me. The memory mapping can only be used with lot's of
> overhead, but I guessed UDP had even more overhead... It seems not to be
the
> case...
>
> Thanks for letting me know.
>
> Regards,
>
> Wiebe.
>
>
> "Neal" wrote in message news:404c9b95@newsgroups....
> > Thanks for your example code. I tested it against the UDP code that I
> wrote
> > and the UDP was about ten times faster than the memory mapped file
method.
> > For speed reasons I think I'll stick with UDP. If I ever need a simple
> > Windows method on a computer that has no networking support I will use
the
> > memory mapped method. Thanks again for your help.
> >
> > "Wiebe@CARYA" wrote in message
> > news:4044b740@newsgroups....
> > > Hi,
> > >
> > > Here is an example. Test Mapping.vi and Test Mapping.exe communicate
> with
> > > each other. Test Mapping.exe can run multiple instances.
> > >
> > > Please let me know how it works for you.
> > >
> > > Regards,
> > >
> > > Wiebe.
> > >
> > >
> > > "Neal" wrote in message
news:40449905@newsgroups....
> > > > I'm now using UDP and it is working well. However, I am interested
in
> > the
> > > > memory mapped file method you mentioned because I may have problems
> with
> > > UDP
> > > > if there is no network card installed. Could you please send an
> example
> > > of
> > > > the method you mentioned?
> > > >
> > > > "Wiebe@CARYA" wrote in message
> > > > news:40431acb@newsgroups....
> > > > > Hi,
> > > > >
> > > > > After doing some test with this method, I think it might be a good
> > > > solution.
> > > > > There are some disadvantages, but also some advantages.
> > > > >
> > > > > Disadvantages:
> > > > > Windows only.
> > > > > One PC only.
> > > > > Uses API's.
> > > > > Low level (unless wrapped).
> > > > > Memory errors when changing control type (during development).
> > > > >
> > > > > Advantages:
> > > > > Fast, little overhead.
> > > > > Full control over synchronisation etc.
> > > > > Can also be used from other languages.
> > > > > All applications can read or write to the "global" at will.
> > > > > Use as many applications as you like.
> > > > >
> > > > > If you're interrested, let me know.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Wiebe.
> > > > >
> > > > > "Wiebe@CARYA" wrote in message
> > > > > news:403f0d05@newsgroups....
> > > > > > HI,
> > > > > >
> > > > > > You could use the windows (MS only) way; by using memory mapped
> > > files...
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Wiebe.
> > > > > >
> > > > > > "Neal" wrote in message
> > > news:403b6c93@newsgroups....
> > > > > > > I have several built LabVIEW applications that I need to
> exchange
> > > data
> > > > > > > between when they are running simultaneously on the same PC.
> Data
> > > > > Socket
> > > > > > is
> > > > > > > probably one of the best ways to accomplish this task but it
> > > requires
> > > > > some
> > > > > > > extra installation and file handling that could complicate
> things
> > > for
> > > > > the
> > > > > > > end user.
> > > > > > >
> > > > > > > Does anyone have a better suggestion for communicating between
> > built
> > > > > > LabVIEW
> > > > > > > App.s?
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>



[Attachment Wait For Write.vi, see below]
0 Kudos
Message 17 of 19
(2,038 Views)
I had already taken out the 1ms wait when I ran the tests. I attached the
VIs I used for testing both the UDP and memory mapped methods. I ran it
again today and although my UDP tests were a lot slower than the last time I
ran it, they were still 2x faster than the memory mapped tests. The only
reason for the UDP slow down that I can think of is the fact that the last
time I tested it I was in an airport and was not connected to a Network.

P.S. If you post another VI please zip it first. VI files get blocked on my
computer for security but zipped files still make it through.

"Wiebe@CARYA" wrote in message
news:404d951a@newsgroups....
> Neal,
>
> There's a "wait 1 ms" in "Wait For Write.vi". It is there to prevent 100%
> proccessor load, but it should not be executed the first iteration.
>
> After adjusting the VI, I get a typical 10X speed up (16X for read, 9.1X
for
> write)!
>
> Regards,
>
> Wiebe.
>
> "Wiebe@CARYA" wrote in message
> news:404d91b3@newsgroups....
> > Hi,
> >
> > That's a supprise to me. The memory mapping can only be used with lot's
of
> > overhead, but I guessed UDP had even more overhead... It seems not to be
> the
> > case...
> >
> > Thanks for letting me know.
> >
> > Regards,
> >
> > Wiebe.
> >
> >
> > "Neal" wrote in message news:404c9b95@newsgroups....
> > > Thanks for your example code. I tested it against the UDP code that I
> > wrote
> > > and the UDP was about ten times faster than the memory mapped file
> method.
> > > For speed reasons I think I'll stick with UDP. If I ever need a
simple
> > > Windows method on a computer that has no networking support I will use
> the
> > > memory mapped method. Thanks again for your help.
> > >
> > > "Wiebe@CARYA" wrote in message
> > > news:4044b740@newsgroups....
> > > > Hi,
> > > >
> > > > Here is an example. Test Mapping.vi and Test Mapping.exe communicate
> > with
> > > > each other. Test Mapping.exe can run multiple instances.
> > > >
> > > > Please let me know how it works for you.
> > > >
> > > > Regards,
> > > >
> > > > Wiebe.
> > > >
> > > >
> > > > "Neal" wrote in message
> news:40449905@newsgroups....
> > > > > I'm now using UDP and it is working well. However, I am
interested
> in
> > > the
> > > > > memory mapped file method you mentioned because I may have
problems
> > with
> > > > UDP
> > > > > if there is no network card installed. Could you please send an
> > example
> > > > of
> > > > > the method you mentioned?
> > > > >
> > > > > "Wiebe@CARYA" wrote in message
> > > > > news:40431acb@newsgroups....
> > > > > > Hi,
> > > > > >
> > > > > > After doing some test with this method, I think it might be a
good
> > > > > solution.
> > > > > > There are some disadvantages, but also some advantages.
> > > > > >
> > > > > > Disadvantages:
> > > > > > Windows only.
> > > > > > One PC only.
> > > > > > Uses API's.
> > > > > > Low level (unless wrapped).
> > > > > > Memory errors when changing control type (during development).
> > > > > >
> > > > > > Advantages:
> > > > > > Fast, little overhead.
> > > > > > Full control over synchronisation etc.
> > > > > > Can also be used from other languages.
> > > > > > All applications can read or write to the "global" at will.
> > > > > > Use as many applications as you like.
> > > > > >
> > > > > > If you're interrested, let me know.
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Wiebe.
> > > > > >
> > > > > > "Wiebe@CARYA" wrote in message
> > > > > > news:403f0d05@newsgroups....
> > > > > > > HI,
> > > > > > >
> > > > > > > You could use the windows (MS only) way; by using memory
mapped
> > > > files...
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Wiebe.
> > > > > > >
> > > > > > > "Neal" wrote in message
> > > > news:403b6c93@newsgroups....
> > > > > > > > I have several built LabVIEW applications that I need to
> > exchange
> > > > data
> > > > > > > > between when they are running simultaneously on the same PC.
> > Data
> > > > > > Socket
> > > > > > > is
> > > > > > > > probably one of the best ways to accomplish this task but it
> > > > requires
> > > > > > some
> > > > > > > > extra installation and file handling that could complicate
> > things
> > > > for
> > > > > > the
> > > > > > > > end user.
> > > > > > > >
> > > > > > > > Does anyone have a better suggestion for communicating
between
> > > built
> > > > > > > LabVIEW
> > > > > > > > App.s?
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
>



[Attachment UDPTests.zip, see below]
0 Kudos
Message 18 of 19
(2,038 Views)
Neal,

OK, I'll zip next time..

I'm sure you've noticed that if you only need to write strings, there is
room for optimalisation. Because data can have \00 in it, there is need for
interlocking (the "writing" tag, that "Wait For Write" is waiting for). If
you only need to write one string, windows will probably do this
interlocking for you, saving several ms per run.

Anyway, another thread (previously posted) is asking for memory mapped
files, so the code is probably getting used. (Nothing better that home made
code being put to use).

Regards,

Wiebe.

"Neal" wrote in message news:404ddb60@newsgroups....
> I had already taken out the 1ms wait when I ran the tests. I attached the
> VIs I used for testing both the UDP and memory mapped methods. I ran it
> again today and although my UDP tests were a lot slower than the last time
I
> ran it, they were still 2x faster than the memory mapped tests. The only
> reason for the UDP slow down that I can think of is the fact that the last
> time I tested it I was in an airport and was not connected to a Network.
>
> P.S. If you post another VI please zip it first. VI files get blocked on
my
> computer for security but zipped files still make it through.
>
> "Wiebe@CARYA" wrote in message
> news:404d951a@newsgroups....
> > Neal,
> >
> > There's a "wait 1 ms" in "Wait For Write.vi". It is there to prevent
100%
> > proccessor load, but it should not be executed the first iteration.
> >
> > After adjusting the VI, I get a typical 10X speed up (16X for read, 9.1X
> for
> > write)!
> >
> > Regards,
> >
> > Wiebe.
> >
> > "Wiebe@CARYA" wrote in message
> > news:404d91b3@newsgroups....
> > > Hi,
> > >
> > > That's a supprise to me. The memory mapping can only be used with
lot's
> of
> > > overhead, but I guessed UDP had even more overhead... It seems not to
be
> > the
> > > case...
> > >
> > > Thanks for letting me know.
> > >
> > > Regards,
> > >
> > > Wiebe.
> > >
> > >
> > > "Neal" wrote in message
news:404c9b95@newsgroups....
> > > > Thanks for your example code. I tested it against the UDP code that
I
> > > wrote
> > > > and the UDP was about ten times faster than the memory mapped file
> > method.
> > > > For speed reasons I think I'll stick with UDP. If I ever need a
> simple
> > > > Windows method on a computer that has no networking support I will
use
> > the
> > > > memory mapped method. Thanks again for your help.
> > > >
> > > > "Wiebe@CARYA" wrote in message
> > > > news:4044b740@newsgroups....
> > > > > Hi,
> > > > >
> > > > > Here is an example. Test Mapping.vi and Test Mapping.exe
communicate
> > > with
> > > > > each other. Test Mapping.exe can run multiple instances.
> > > > >
> > > > > Please let me know how it works for you.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Wiebe.
> > > > >
> > > > >
> > > > > "Neal" wrote in message
> > news:40449905@newsgroups....
> > > > > > I'm now using UDP and it is working well. However, I am
> interested
> > in
> > > > the
> > > > > > memory mapped file method you mentioned because I may have
> problems
> > > with
> > > > > UDP
> > > > > > if there is no network card installed. Could you please send an
> > > example
> > > > > of
> > > > > > the method you mentioned?
> > > > > >
> > > > > > "Wiebe@CARYA" wrote in message
> > > > > > news:40431acb@newsgroups....
> > > > > > > Hi,
> > > > > > >
> > > > > > > After doing some test with this method, I think it might be a
> good
> > > > > > solution.
> > > > > > > There are some disadvantages, but also some advantages.
> > > > > > >
> > > > > > > Disadvantages:
> > > > > > > Windows only.
> > > > > > > One PC only.
> > > > > > > Uses API's.
> > > > > > > Low level (unless wrapped).
> > > > > > > Memory errors when changing control type (during development).
> > > > > > >
> > > > > > > Advantages:
> > > > > > > Fast, little overhead.
> > > > > > > Full control over synchronisation etc.
> > > > > > > Can also be used from other languages.
> > > > > > > All applications can read or write to the "global" at will.
> > > > > > > Use as many applications as you like.
> > > > > > >
> > > > > > > If you're interrested, let me know.
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Wiebe.
> > > > > > >
> > > > > > > "Wiebe@CARYA" wrote in message
> > > > > > > news:403f0d05@newsgroups....
> > > > > > > > HI,
> > > > > > > >
> > > > > > > > You could use the windows (MS only) way; by using memory
> mapped
> > > > > files...
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > >
> > > > > > > > Wiebe.
> > > > > > > >
> > > > > > > > "Neal" wrote in message
> > > > > news:403b6c93@newsgroups....
> > > > > > > > > I have several built LabVIEW applications that I need to
> > > exchange
> > > > > data
> > > > > > > > > between when they are running simultaneously on the same
PC.
> > > Data
> > > > > > > Socket
> > > > > > > > is
> > > > > > > > > probably one of the best ways to accomplish this task but
it
> > > > > requires
> > > > > > > some
> > > > > > > > > extra installation and file handling that could complicate
> > > things
> > > > > for
> > > > > > > the
> > > > > > > > > end user.
> > > > > > > > >
> > > > > > > > > Does anyone have a better suggestion for communicating
> between
> > > > built
> > > > > > > > LabVIEW
> > > > > > > > > App.s?
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>
>
0 Kudos
Message 19 of 19
(2,038 Views)