LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interprocess Communication Pass-by-Reference

Hello folks,

 

I would like to fire off an out-of-process automation server for data acquisition, and have my main program retrieve the acquired data through references.  I think that retrieving the data "by-reference" (i.e. through pointers) will improve performance by preventing the creation of copies of large data structures containing the acquired information.

 

1. Is "by-reference" retrieval of information from out-of-process servers possible in Labview?

 

The attached files contain an out-of-process server and a client.  The server just gets the current date-time info and outputs it as a string and it also outputs a reference to the string.  The client successfully gets the string, but the reference fails for "invalid reference".

 

Any help is greatly appreciated!

Thanks,

Chris

0 Kudos
Message 1 of 12
(3,940 Views)

Hi Chris,

i think you get the reference, but this reference is not valid in this application, because both applications run in different memory areas. You can use tcp/ip or "SendMessage" commands to send data between different applications.

 

Mike

0 Kudos
Message 2 of 12
(3,915 Views)

Hi MikeS81,

 

Thanks for the information.  Does this mean that in order to pass information between processes it is necessary for copies of the information to be created in memory?  In other words, do interprocess communications have to be "pass-by-value"?

 

Best Regards,

Chris

0 Kudos
Message 3 of 12
(3,906 Views)

chassan wrote:

...

In other words, do interprocess communications have to be "pass-by-value"?

 

Best Regards,

Chris


Hi Chris,

yes i think so, because your applications run in different threads.

See this link for more information about IPC:

http://en.wikipedia.org/wiki/Inter-process_communication

 

Mike

0 Kudos
Message 4 of 12
(3,897 Views)

Hi chassan,

 

If you are looking to pass data between process, take a look at using Shared Variables. Here is a great Developer Zone article that talks about using LabVIEW Shared Variables:

 

http://zone.ni.com/devzone/cda/tut/p/id/4679

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 5 of 12
(3,862 Views)

Hi Aaron,

 

Thanks for the information.  I did read a bit about Shared Variables, however, it appears that they are only available in Labview versions >= 8.0.  I'm using Labview 7.1, and I don't think I'll be able to upgrade anytime soon.

 

Best Regards,

Chris

0 Kudos
Message 6 of 12
(3,847 Views)

Hi chassan,

 

By interprocess communication, do you mean passing data between two VIs on the same machine? If so, you can use Global Variables to do this. Check out this Help article for more information.

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 7 of 12
(3,819 Views)

Hi Aaron Pena,

 

Sorry for the confusion; please let me explain what I mean by "interprocess".  I want to create multiple executables (i.e. programs that show up in the Task Manager in Windows), but I need to be able to pass information among the executables.  I would like to avoid using files because they would likely be too slow.

 

Is there a way to do this?

 

Best Regards,

Chris

0 Kudos
Message 8 of 12
(3,710 Views)
I recommend using VI server to do this.  You can create a VI that acts as a functional global variable to store your data in one executable, then obtain a reference to it through VI server in another application and call that VI to retrieve the data.  I'm not sure you can avoid copying your data in memory but it's easy to set up and doesn't require passing data through files.  If you're really, really concerned about memory you could look into using Windows shared memory but that looks to me like it involves a lot of pain.
Message 9 of 12
(3,699 Views)

nathand wrote:
I recommend using VI server to do this.  You can create a VI that acts as a functional global variable to store your data in one executable, then obtain a reference to it through VI server in another application and call that VI to retrieve the data.  I'm not sure you can avoid copying your data in memory but it's easy to set up and doesn't require passing data through files.  If you're really, really concerned about memory you could look into using Windows shared memory but that looks to me like it involves a lot of pain.

nathand's above described method is my favorite.

 

TCP/IP is also available if you are more comforatable with that.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 12
(3,685 Views)