I am trying to setup a communication between a
RT PXI system and a windows computer using network shared variables
(shortened to "shared variables" in the further text). Both of the
computers shall run compiled executables. The documentation concerning
this topic has been spread over several places and this is what I ended
up with.
There are three different possible setups.
1.
I am using shared variable nodes both on the RT PXI and on the windows
computer. The shared variables on the RT PXI are defined as "target
absolute" and are residing in a library on the RT PXI. The shared
variables on the windows computer will be set to "target relative" and
are residing in a library on the windows computer. The variables used
on the windows computer will be bound to the corresponding variables on
the RT PXI. If I run the applications on computers different from the
ones I used during development, I have only to change the .aliases file
for the windows computer and set there the correct IP for the RT PXI.
Additionally,
I have to deploy the library both on the RT PXI and on the windows
computer. This can be done from the windows computer, as the RT PXI
target does not support the invoke node that has to be used for this
purpose. Running the invoke node twice, once for localhost with the
client library and once for the IP of the RT PXI system and the host
library, I can deploy the libraries containing the shared variables
programmatically. At this point, the magic of the .aliases file will
fail and I have to find the IP of the RT PXI either by user input or
maybe by running the RT ping controllers.vi. The "Target IPAddress"
property of the "Deploy Library" invoke node makes sense in this
combination as we can deploy libraries also to other computers or
platforms.
See attached Shared Setup 1.png.
2. I am
using shared variable nodes both on the RT PXI and on the
windows computer. The shared variables on the RT PXI are defined as
"target absolute" and are residing in a library on the RT PXI. The
shared variables on the windows computer will also be set to "target
absolute" and will be taken from the library that resides on the RT
PXI. If I run the applications on
computers different from the ones I used during development, I have
only to change the .aliases file for the windows computer and set there
the correct IP for the RT PXI.
Additionally, I have to deploy
the library only on the RT PXI. Again, this can done by a helper
application on windows when the IP of the RT PXI is known or found by
using RT ping controllers.vi.
See attached Shared Setup 2.png.
3. I am using
shared variable nodes only on the RT PXI. The shared variables on the
RT PXI are defined as
"target absolute" and are residing in a library on the RT PXI. On the
windows side, I use direct access to the PSP by using DataSocket
functions. I can address a variable by using a DataSocket Open function
and inputting psp://IP_or_Hostname_of_RT_PXI/LibraryName/VariableName.
The magic of the .aliases files will fail already at this step. So I
have to find the correct IP or hostname by user input, setting a DNS
server to point to the correct IP or using the RT ping controllers.vi.
As
always, I have to deploy the library containing the shared variables to
the RT PXI. Again, this can done by a helper application on windows
when the IP of
the RT PXI is known or found by using RT ping controllers.vi.
As
I can use this approach to setup an array of valid variable names and
process the array by one single DataSocket read function inside of a
for loop more conveniently than using a case selector inside of a
for-loop and reading from different shared variable nodes, I prefer
this approach over the others.
See attached Shared Setup 3.png.
For approaches 2 and 3, at least the deploy process can be run by an
installer application independently of the main application as the
library will remain on the PXI until I manually undeploy it, even if I
reboot the PXI controller.
My questions are:
1. Did I describe the possible setups regarding the use of the shared variables correctly?
2.
Is there any means to get the IP address mapping from the .aliases
file, needed for deploying and for approach 3, other than opening and
reading the file itself?
Download All
Virus scan in progress. Please wait to download attachments.