10-13-2009 12:17 AM
I currently have a server / multi-client application that I am implementing with VI Server in LabVIEW 8.6.1. Clients call into the server to execute various VIs to store/retrieve/process data, and the VIs store the data within files as well as function globals, i.e. an uninitialized shift registers within a while loop. I have a couple questions about this implementation:
1. Are the calls made via VI Server synchronized by VI Server; in other words, without making the VI reentrant myself will VI server ever launch more than one instance of the VI on the server system (I don't want this for obvious reasons)?
2. I currently use some of the VIs within my server application as static VIs, and also allow others to call into some of them from remote hosts via VI server, and I am concerned about the integrity of the data within my function globals (I've taken the precaution of opening handles to ALL VIs I share with VI Server so they never go out of scope, whether used statically or not). Is this bad? If I used only VI server calls within my server app, would this be better (instead of using the "shared" VIs statically)?
3. When a remote client is calling into the server via VI Server, what will happen when the VI is busy? Does my remote call via a call-by-reference node error out, or does it happily wait its turn until the VI can be accessed (assuming the question to #1 is that only one instance can ever be run). I don't yet have multiple systems to test race conditions.
4. I am using this VI server implementation between both Mac and Windows systems, is there anything I need to watch out for (besides the obvious pathing issues)?
Thanks!
-Danny
Solved! Go to Solution.
10-13-2009 12:25 PM
TarantulaDiaz wrote:
without making the VI reentrant myself will VI server ever launch more than one instance of the VI on the server system?
Only if it's a VIT.
Also, even if it is reentrant, the VI server will not open multiple copies unless you set the reentrant flag in the OVR options (you can see the exact value in the help for the primitive).
If I used only VI server calls within my server app, would this be better?
I prefer the static approach for three reasons -
When a remote client is calling into the server via VI Server, what will happen when the VI is busy?...I don't yet have multiple systems to test race conditions.
It waits until it stops running, just like in a normal VI call. Also, you don't need multiple systems for testing. You can simply set different VI server ports for two projects on the same PC and use that for testing.
I am using this VI server implementation between both Mac and Windows systems, is there anything I need to watch out for (besides the obvious pathing issues)?
I don't have any experience with that, but you would obviously want to avoid running any VIs which include platform specific code on the other machine (e.g. if you have a VI which uses .NET, you can presumably run it on the Windows machine using VI server with no issues, but don't try running it directly on the Mac).