06-12-2009 06:33 AM
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.
Solved! Go to Solution.
06-12-2009 05:46 PM
06-14-2009 06:48 PM
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
06-15-2009 04:49 AM
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.
06-16-2009 01:00 PM
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
06-18-2009 12:17 PM
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.
06-23-2009 10:07 AM
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
06-24-2009 10:03 AM