Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

address different rt targets by changing ip in host program

Solved!
Go to solution

Hi

I have two RT targets running on desktop PCs. I would like programatically to change the target IP address in a single host program so that I can control one or other of the targets. I was thinking the Invoke Node "Library.Deploy Library" has an input for the target IP address, but my libraries are already on the targets so perhaps this is not the right way to go.

 

I look forward to any reply..

 

Tim.

0 Kudos
Message 1 of 8
(4,920 Views)
Did you try wiring a String to the input where IP is usually wired?
0 Kudos
Message 2 of 8
(4,909 Views)

Hi Tim,

 

I would be glad to help with your question. To clarify, it would be helpful to know how you would like to communicate with your real-time targets from the host PC. One option is to simply use TCP/IP to communicate between machines, or use DataSocket to abstract some of the communication details. 

 

Another option is to programatically interface with different shared variables depending on the target that you would like to control. Please let me know how your application is set up, and we can further discuss your options.

 

Regards,

 

Casey Weltzin | LabVIEW Real-Time Product Manager | National Instruments

0 Kudos
Message 3 of 8
(4,895 Views)

Paperduck: I have not tried the Invoke Node "Library.Deploy Library" as I'm not sure it's the right way to do what I want.

 

Caseyw: I am communicating using shared variables on the target. I'm just setting parameters this way, then setting a shared variable to flag that the target program should start acquisition.

It would be neat to set both target PCs running from the same program (although it's not necessary to start both at the same time). My only alternative seems to be to compile seperate versions of the host program, each targeting a different fixed target IP.

 

0 Kudos
Message 4 of 8
(4,887 Views)

Hi Tim,

 

You should definitely be able to communicate with both targets from a single host VI; I agree that this is a good solution. 

 

There are several ways to accomplish this. If you are hosting your shared variable libraries on the targets (and they are both running), then you can simply read or write to either set of shared variables (on target1 or target2) programatically in your host VI. If you want to be able to selectively interface with a single target, then you could use a case structure with variables on target1 in one case and variables on target2 in another case.

 

You could also use DataSocket to add some flexibility to your shared variable access by programatically forming the DataSocket URL (e.g. psp://computer/System/shared_variable). This will help you avoid adding multiple targets to your project (especially useful for a large number of targets).

 

Finally, you could set up TCP listeners on both targets and communicate with them from your host machine, but this would involve more programming on your part. Please let me know if you have any additional questions, and have a great day!

 

Regards,

 

Casey Weltzin | LabVIEW Real-Time Product Manager |National Instruments

 

Message 5 of 8
(4,865 Views)

I'm very grateful for your help, but I'm still struggling with this one.

I attach the project view in which I have network shared variables in the realtime target.

 

I seem to be getting timeouts on read, and writing doesn't affect the RT program.

 

I've tried datasocket URLs

psp://pc-realtime.mydomain/variables - LGA.lvlib/Version - network

then realised that you probably meant "System" as a literal process name

psp://pc-realtime.mydomain/System/Version - network

then tried escaping the spaces with %20

 

I don't think I need to bind anything as the variables should get deployed when the target program is run.

0 Kudos
Message 6 of 8
(4,840 Views)
Solution
Accepted by Tim_Crimson

Hi Tim,

 

I have tested this DataSocket method on my side and it appears to be working correcly. I am sure that we can work together to determine what is happening here. If a space is in the variable name, simply typing a space in the DataSocket URL should work. Looking at the "\ codes display" view, you can see the \s that is being added to the URL.

 

The URL format (to be more specific) should be psp://ComputerName/LibraryName/VariableName. 

 

Have you verified that your variables on your remote systems are deployed? The Distributed System Manager is a great tool for looking at this.

 

Regards,

 

Casey Weltzin | LabVIEW Real-Time Product Manager | National Instruments

Message 7 of 8
(4,811 Views)
Once I'd found Distributed System Manager I knew what I'd done. The library name in my case should have been "variables - LGA" not "variables - LGA.lvlib". Many thanks!
0 Kudos
Message 8 of 8
(4,798 Views)