Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Common RT application on 4 RT Controllers with Shared Variables

I have 4 identical PXI RT systems that the customer would like to have an identical application running on all 4. This way, when changes are needed, they only have to make the change once and redeploy. I have the basic RT application built using shared variables.
 
From these systems, Windows applications will be built to connect to one or more of the systems. They want to use shared variables to keep the Windows applications simple since they will be building more Win Apps as needed.
 
The problems I see is that each RT controller will need its own set of shared variables to differentiate it from the other controllers on the network. Thus a common application can't be built.
 
BUT.....
 
I found this thread that looks promising. I don't have my RT targets right now so I can't try it. If I'm reading this correct, I should be able to build a single RT application with a single set of shared variables and have the Windows applications programmatically bind to a specific controllers variables.
 
Does that sound feasible? I don't want to start coding this in unless it has a chance of working.
 
Thanks
Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 1 of 4
(3,932 Views)

Hello Ed,
       Where are you planning on hosting the shared variables?  From what I understand about your application, I would recommend that you use the Windows machine to host the shared variables.  This link shows an example of the shared variables being hosted on the PC.  This will save you the trouble of hosting shared variables on each RT target and having to programmatically bind them, as was discussed the thread that you referenced.

One important thing to know is that the Shared Variable Engine cannot be programmtically deployed from an RT target, only on a non-RT host, which is described in KB 3UCBHM8T: How Do I Deploy Network Shared Variables from a Compiled Executable?


Cheers,

NathanT

 
0 Kudos
Message 2 of 4
(3,916 Views)
 
Ed,
 
I'd say that architecture is sound and has some advantages for certain use-cases such as a Windows host monitoring and controlling several identical RT targets. You'll need some way for the Windows host to know what RT targets to talk to, for example IP addresses in a config file or a dynamic network protocol to query for devices running your application. But this architecture makes it easy to add additional RT targets to the system. I'm not sure the thread you linked to is really applicable, but on the Windows host you would need to programmatically read the variable hosted on the RT targets. Since the shared variable node (which looks like a local variable) is statically bound, you would need to read the variable using the datasocket api VIs using a "psp:\\" URL. You can find more info on that in the LabVIEW Help here. For an RT target's specific data it makes sense to host those variable on the RT target. You may also have some data that needs to be shared between all of the RT targets and may want to host those common variables on the host so you don't have to write them to each target. So I'd it will likely make sense to host variable on the host and RT targets depending on the data.
 
The LabVIEW Project will probably come in handy during development since you can actually create multiple RT targets in the project and add the same source to all. That way you can easily test and run the same code on your multiple targets.
 
-JRA
 
0 Kudos
Message 3 of 4
(3,907 Views)

Thanks,

I'll finally have two of the four RT systems up and running tomorrow so I'll be able to try a few things.

I'll let you know what I come up with.

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 4
(3,897 Views)