06-15-2009 10:48 AM
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
06-16-2009 02:19 AM
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
06-16-2009 06:40 AM
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
06-16-2009 06:55 AM
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
06-18-2009 11:53 AM
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
06-19-2009 06:38 AM
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
06-22-2009 01:22 PM
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
08-03-2009 07:00 AM
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
08-03-2009 08:06 AM
08-03-2009 11:28 AM
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