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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

 

Can you use shared variable instead?

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I know it's possible, but How!!!

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

Completely different.

 

Benoit

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. :)

 

Benoit

Share this post


Link to post
Share on other sites

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.

VIServerFGVwithEvent.zip

  • Like 1

Share this post


Link to post
Share on other sites

Hummm... OK When i'll have some time at home I'll try this VI. At work i have only 2011... :S

As soon as I try it, I'll let you know.

Thanks for your answer.

Benoit

Share this post


Link to post
Share on other sites

Here is an example how to call a VI in a remote Executable. Note that I couldn't get it work without a custom INI file so this might be the most interesting part for you.

Remote.zip

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

 

RemoteLib.zip

Share this post


Link to post
Share on other sites

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.

 

Benoit

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.


×
×
  • Create New...

Important Information

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