Jump to content

How to get the reference to a control on front panel of executable labview


Recommended Posts

Hi,

I tried search many place but I still cannot find an answer for how to get the reference to a control on front panel of the LabVIEW executable file? This is installation distribution application written by LabVIEW. I am trying to use VI server to access this but the only thing I can find is access to the VI. Is there anyway I can do this?

Best regards,

Thang Nguyen

Link to comment

You cannot access a control reference in the executable. You have to do it in the source code then create the executable.

I think what he means is he wants to get references to the controls on VIs in his built application from another built app or the IDE. He already can get access to the VIs according to his statement, so he just needs to take it a step further.

Thang,

If you can get access to a VI in the app, then you need to open a reference to it. Then work down to get references to the Front Panel and then Controls[]. From there you'll be able to access the control you want.

Attached is an example of what you need to do.

Scott

Get Control refs in exe.vi

Link to comment

Thank,

I am sorry I cannot open your vi because I only have 8.6.1. Could you please save it down to one version for me? Thank you for that.

I am trying to work with a simple example.

I have a Sim project which includes Simulator.vi which is built become Simulator.exe. I have another Test project which includes Test.vi. I would like from Test.vi be able access to the controls on the front panel of the Simulator.exe. I attach here what I have done so far. Please rebuild the Sim source first.

I got an error message with my current Test.vi:

Error 7 occurred at Open VI Reference in Test.vi

Possible reason(s):

LabVIEW: File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux. Verify that the path is correct using the command prompt or file explorer.

=========================

NI-488: Nonexistent GPIB interface.

VI Path: C:\My Projects\My New Projects\AutomatedTest\Sim Build\Simulator.exe\Simulator.vi

Sim Source.zip

Test Source.zip

Link to comment

I did go one step further by put the Simulator.exe run on another computer in the network. I call this PC B. And from my computer, PC A, I try to access to the Simulator.exe on PC B. But I get this error:

Error 66 occurred at Open Application Reference in Get Control refs in exe.vi

Possible reason(s):

LabVIEW: The network connection was closed by the peer. If you are using the Open VI Reference function on a remote VI Server connection, verify that the machine is allowed access by selecting Tools>>Options>>VI Server:Machine Access on the server side.

=================

On PC A:

I changed the localhost string input in the open application vi by the domain name of the PC B.

On PC B:

What I have done so far is on PC B, I do these settings:

VI Server: Configuration

+ Check TCP/IP

+ Port: 3364

VI Server: Machine Access

+ Add my computer domain to the Machine access list. I also add * to this list.

VI Server: User Access

+ Leave blank. I expect this will allow the PC list in the machine access list to be able to access

VI Server: Exported VIs

+ Add the name of the vi: Simulator.vi. I also add * to the list.

Do you have any idea if I miss anything?

Best regards,

Thang Nguyen

Link to comment

I found the solution for the remote access. What I did is copy the server.tcp.acl token to the executable config file. This is the link to the article:

http://digital.ni.co...C3?OpenDocument

Best regards,

I was going to tell you that is exactly what you needed to do, so I'm glad you were able to find it and get it resolved.

As an additional note, you can do this all within the code of your app instead of putting it in the ini. It can help somewhat with security of your app if you're at all worried about that and it gives yiou the benefit of cahanging the settings on the fly.

Scott

post-415-125415655757_thumb.png

Link to comment

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.