Jump to content

Recommended Posts

Hi all,

I almost never ask for help in LabVIEW... but for this one, I have no idea where to find a solution to my problem. I'm trying to exchange data between two executable. The way I was using in the past was VI server. But it seems that there is something in LabVIEW 2011 that is not working the same way than it was working with LabVIEW 8.6. I created in my project 3 VI. One publisher, one suscriber and one GET-SET variable that will be used to exchange data between my 2 .exe.


What ever I'm trying to do, I cannot figure it ou how to read the data from the Get-Set. Even having the list of VI available in memory is not working. How can I access this VI by VI Server with an address at the input of the application reference?


I'm preaty sure it has something to do with security... but what....


Thanks for your help.

Link to post

There is no shame in asking for help, it's only if you never ask questions that you'll remain ignorant all your life ;)


It's probably all about settings in the INI files next to your EXEs.


Have a look at this discussion.


First your 2 EXEs have to use different ports ; to set the port, use "server.tcp.port=3385" in the INI file next to your EXE

Then the VIs in EXE A that need to be accessed from EXE B needs to be declared in the b.INI with something like "server.vi.access = "+vi_name.vi;+other_vi_name.vi;...etc..."


Hope this helps

Edited by Antoine Chalons
Link to post

I'm not sure I understand.

The EXE1 execute a sub VI that is in memory

The EXE2 access the subVI in EXE1. only the EXE2 need to specify the port when openning the application reference. the EXE1 have the port configuration in the .ini file.

Link to post

When you try to open the reference to the VI, are you passing in the path to the VI, or a string with only the VI name? If you are passing in the VI path, it may have changed between LabVIEW 8.6 and 2011. Try passing in a string containing only the VI name instead (the connector defaults to a path, but will accept a string).


It would be helpful if you post your code, or at the very least the error that occurs when you try to open the remote VI reference.

Link to post

If I remember correctly, NI deliberately disabled this when you built into exe after LabVIEW 2009(?).

Not true. NI did change the internal format of executables, which changes the way you refer to the path of a VI within an executable, but it's still possible to call a VI in another running executable through VI server.

Link to post

Shared variable offer the possibility to transfer data, but doesn't allow the usage of a remote functionality...

Completely different.


Can you please clarify your goals? What you want to achieve by using remote functionality?


In your original post you said "I'm trying to exchange data between two executable. The way I was using in the past was VI server.However, you don't necessarily need VI Server to exchange data.


Also, you can design your programs to use shared variables for remote control. Let EXE1 can send a command to EXE2 through a shared variable. EXE2 just needs to read the command variable, and perform the action that you want.

Link to post

Yes I know about shared variables. But the example explained at first is an example. The final goal is to execute a vi in a remote EXe that might run in a distant computer.


So how Can I use VI server. it's seems that the project/target/library has to do in the name of the remote VI to execute. There is a bunch of cunfiguration that need to be applyied as well in Labview and as well in the .ini of the .EXE.


If someone has an example that work please share. :)



Link to post

Does this example help? It demonstrates calling a VI that's part of one application from another application using VI Server. In this case the remote VI contains a user event reference that's used to generate an event in the remote application, but the exact mechanism isn't important. The attached project is saved in LabVIEW 2014 with build specifications that have configuration files set appropriately to enable VI server; there's a version without the build specifications in LabVIEW 2012 (with snippet images) at http://forums.ni.com/t5/LabVIEW/sync-method-between-two-applications/m-p/3217891#M934603.


  • Like 1
Link to post
  • 2 weeks later...
  • 4 weeks later...

OK I tried your project. It works fine till I include the remote method in a library. How can I refer to this VI if it's included in a library??? it's ssems that it's not working anymore.

Thanks for any help.

Link to post

I had no problems with libraries. Maybe this helps:

If you open the VI by name instead of path you need the fully qualified VI name and the VI must be in memory.

The VI you want to call remotely has to be in the public scope.


Here is the modified example project.



Link to post

OK I found a super easy way... drop the VI in a text constant and magically the good VI name with the library included will appear. use this constant as VI name for the VI server. this can be done for the type specifier as well.

Candidus, your example is good. it's represent exactly what I did.

That solved my issue. :)

Thanks everyones for your help.



Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Benoit
      Hello all,
      Is there any of you ever be able to push more than 30 VI in the exported VI list of VI server?
      I think I found a bug that is there since at least LabVIEW 2011.
      WAIT... don't answer the easy one... "export all VI"... if you were about to answer that, that means you are not developing a safe application.
      Thanks for any help.
    • By ensegre
      I thought there was an easy, built in, VI server way of doing the following, but I haven't found one. Am I missing something trivial?
      So I have one application instance, spawning clones of a certain VI. I would like to get an array of the VI refs of all of these clones. I thought I could via some property like  Application:All VIs in memory, but I haven't found any suitable. All VIs in memory gets only the base VI names.
      Missing that, I resort to register all my clones in a FGV as they startup, , and consult the FGV at will. Is there a more linear way?
      I also note that I have to associate each VI ref with its clone name in the FGV, otherwise plain refs to different clones match as equal in lookups.
    • By John Lokanis
      I am running into an issue where my VI Server connection goes stale after a few hours.  Looking for a fast way to detect this and recover.
      Currently here is what I am doing:
      On first call, open the application reference and then open the VI reference.  Cache both of these.  Use the VI reference to call the remote VI. On subsequent calls, test the cached references to verify they are still valid and then call the remote VI. What appears to be happening is the references still appear to be valid in the caller but the connection is broken so the remote call fails.  Then I detect this and reopen the app and VI refs and can again call the remote VI.
      The issues are:
      The failing remote call takes a long time to timeout and I do not see how to control this timeout. The test of the refs does not actually test to see of the network connection is still good. The result is it takes a long time to recover and this is upsetting the user since it appears the system is locked up.
      What I need is a way to control the timeout of the 'call by reference' node or a way to quickly test the references to verify the network connection is still good before I attempt the remote call.
      Any ideas?
    • By John Lokanis
      I have run into a bit of a problem with how I am trying to do networked messaging between a client and a server application.  I am considering trying Network Streams as a solution but wanted to see if anyone has had success (or failure) with this solution or has a better idea.
      First, a little background on the application:
      In my system, there are N servers running on the network.  Each of these is running on it's own VM with a static IP and unique machine name.
      There are also N clients.  These are running on physical machines, VMs and a Windows RDS (Remote Desktop Server).
      The messages are all abstract class objects.  Both client and server have a copy of the abstract classes so they can send/receive any of the messages.
      My current solution is to use VI Server to push messages from one application to the other.  There is no polling.
      Clients and servers can go offline at anytime without warning and the application at the other end of the connection must deal with the disconnect gracefully.
      In normal operation, the client will establish connection to a group of servers (controlled by the user).  The client provides it's machine name and VI Server port.  Each server then connects back to the client.  All messages then pass via these connections.
      Therefore, a client is uniquely identified to the server by its network machine name.
      Now the problem.  A Windows RDS session does not have a unique machine name.  Instead it uses the machine name of the RDS.  So, if two users run the client application in two separate RDS sessions at the same time, when they connect to the servers, they will look like the same machine.  There is no way to uniquely identify them and route messages to the correct one.
      So, I have started looking at network streams as a possible solution.  They looked interesting because you could add a unique identifier to the URL so you could have more than one endpoint on a single machine.  This looked like it would solve my problem because I could combine the machine name and user name to make my client endpoint unique.  But here is the process I would need to follow:
      Server creates an endpoint to listen for client connections. Client gets the list of server names (from a central DB) and then tries to connect to each server's endpoint. If successful, the client creates a unique reader endpoint for that server and then passes the server the information about how to connect to this endpoint. When the server connects to this endpoint, it also creates a unique reader for the client and sends that info. The client connects to the server using this unique endpoint and we now have two unique network streams setup between client and server, one in each direction. The client then disconnects from the first server endpoint since it now has its own unique connection. Both ends will need to have some sort of loop that waits for messages (flattened class objects) and then puts them into the proper local queue for execution within their application. Both will also need to be able to send a shutdown message to each of these loops when exiting to close the connection. My concerns are how to have the server listen for connections with its generic endpoint to multiple clients at once.  There is no guarantee that only one client will try to connect at a time.  And once the client is fully connected and releases the generic connection, will the server be able to listen for more connections or will that endpoint be broken?  How do I reinitialize it?
      This is all so much easier with VI Server that I might have to just give up on the RDS solution altogether.  But I want to give this my best shot before I do that.
      Thanks for any tips or ideas or pointing out any pitfalls I missed.
    • By John Lokanis
      I need to find a transport for message objects that allows two way communication without polling but is limited to server side connections only.  So, the client can connect to the server but the server cannot connect to the client.
      First some context:  My application communicates over the network using VI Server.  My client app (the UI) opens a ref to a VI in my server app (the engine) and sends a message object containing the client app’s machine name and VI server port.  The server app then opens a ref to a VI in my client and sends a message object with the reply data.  I now have a two way communication channel via VI server and can pass any message object back and forth without polling.
      I learned today that our IT department plans to block all incoming connections to all non-server machines in the future.  So, my client would still be able to connect to the server app within the network, but the server would not be able to connect to the client app because of this rule.  This will completely break my networked messaging system.  I do not know a way for LabVIEW to setup VI Server so only one end can connect to the other but allow two way communication without polling.
      Does anyone use a message system that would work in my situation?  I would prefer to continue to use VI Server but I am willing to look at other solutions, as long as they were very robust and had low latency.
      thanks in advance for you help.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.