LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time target - changing IP and network shared varables

Solved!
Go to solution

HI,

I have build an application for  real time system (Compact RIO).

All data between the GUI (running on a windows based PC) and the real time system - is transferred via network shared variables.

The shared variables are hosted on target.

I have assigned static IP address to the real time target.

Now for the question:

After deployment of the real time application on compact Rio target

If I change the target's IP address: How do the shared variables "know" to connect to the target?

There is no place in the GUI (running on windows based PC) that I define the IP address of the target.

So I I change the Target IP (and for the sake of argument if I change the PC IP, though they are still on the same subnet)  - how do the "know" how to connect?

It sounds like a basic question i am absolutely sure I am missing something in understand of shared variable...

 

Thnaks

 

0 Kudos
Message 1 of 7
(4,446 Views)
Solution
Accepted by topic author Hazkel

Hello Hazkel,

 

The IP address of your real-time target shared variable is located in the *.aliases file when you create an executable, so you need to change it there.  See below the example:

 

aliases.jpg

0 Kudos
Message 2 of 7
(4,425 Views)

You refer to the "GUI running on the Windows PC".  Is this also LabVIEW code in the same Project that you used to deploy the code to the cRIO?  If so, the Project knows the code of the RT Target, and thus knows the IP where the Shared Variables are hosted.

 

You do need to know where the Shared Variables are being hosted, so if you change the IP of the Target, you'll need to inform the Host PC about this.  As I noted, you normally do this from within Project, but I believe you can also do this "at run time" using the NI Distributed System Manager.  It should be able to find your cRIO and its hosted variables and make them available to you.

 

Bob Schor

0 Kudos
Message 3 of 7
(4,422 Views)

Thanks.

You are absolutely right when I work in development environment (i am working within a project) however after I compile my program and distribute it to other computer the only think I have is an "exe" file...

 

0 Kudos
Message 4 of 7
(4,392 Views)

WOW! so simple...

thanks a lot.

 

I have a following question:

If my RT target had a dynamic IP (i.e it is connected to my PC via network)

The IP is most likely to change every time the network router is turned off and  on.

 

Do I need to update the ".aliases" file manually?

How can I determine the target's IP via MAX?

Is MAX part of the labview run time?

I am asking this since my application is intended to run on a PC that does not have the Labview development environment,

0 Kudos
Message 5 of 7
(4,386 Views)

Is MAX part of the labview run time?

Yes you can install MAX anywhere you want and can be distributed with your application installer.

 

Do I need to update the ".aliases" file manually?

You may if you want, but this process can also be automated if the PC can be reach by the RT target with DNS name resolution or if the PC has a static IP address.  The RT target may publish it's IP address to a "static IP address" computer.  Other client like your application can then ask for the IP address of the RT target.  If your application runs through internet, do a google search for dynamic dns (DDNS).

 

How can I determine the target's IP via MAX?

If the target is located on a LAN on the same subnet, MAX will be able to find the device and hence the IP address.

 

May I ask where your RT target will be located? Is it in a LAN or WAN? Does it has access to the internet?

 

Michel

0 Kudos
Message 6 of 7
(4,365 Views)

Sorry I didn't see your question earlier.  If you are building a LabVIEW RT system, with a Host program running on a PC and an RT Target on a local network, you do not need to know the IP of the RT Target, but can "find" it at run time (even if it has a "dynamic IP".

 

The tools to do this are in the Real-Time Palette, under RT Utility.  The System Configuration function "Find Systems" will search your local network for systems that are on-line.  You can get it to look for "families" -- cRIO, PXI, possibly others (I use it to find my PXI).  The results are returned as an array of strings in several formats -- by default, the format is "Hostname (IP)".

 

Here's how you can use this --

  1. Invoke this function (it takes a few seconds to execute) to return an array of possible RT Targets.
  2. Find your (unique?) target string (see below).
  3. Parse the string to get the IP as a string.
  4. Use the IP string as you need.

Since the Find Systems function returns an array of Targets, you need to consider (in Step 2) what you want to do.  If you have only one entry returned, just use it.  If more than one, you might want to show the users the Machine Names and let them select the Target they want.

 

Bob Schor

0 Kudos
Message 7 of 7
(4,346 Views)