From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of Network Shared Variables

Solved!
Go to solution

I've used LabVIEW for years, but am relatively new to the Realtime and cRIO flavors. I'm working on a project with a cRIO that needs to run multiple modules/instruments. Assuming the instruments are OK for tag-style data, Network Shared Variables look like a good solution.

 

But if I make a class or library for an instrument, and include a Network Shared Variable for its tag data, how can I spawn 2 or more copies of the shared variable (for multiple identical instruments)? Maybe this is just something simple that I'm missing... otherwise I'll need to replicate the functionality of the Shared Variable Engine if I want to dynamically spawn variables?

 

Or is my whole approach off-base for a realtime app?

0 Kudos
Message 1 of 4
(1,232 Views)

Thank you, and sorry for my delay. We don't have DSC and probably won't introduce it for this project.

 

And wow, that really isn't pretty!! That looks like VI scripting, in that a template gets physically saved to disk as a new instance. I'm using the Actor Framework, so I hoped the variables could spin up/down more easily.

 

Unfortunately, this makes Shared Variables essentially useless to me. I decided to build a custom library to handle my tag data. One nice benefit to the custom approach is that I can extend it with custom events too (to update UI refs OnChange, for example).

 

Thanks again for your answers!

0 Kudos
Message 3 of 4
(1,181 Views)

Yes, like you, 90% of us probably start out with shared variables but then quickly find some limitation and then quickly switch to something else.

0 Kudos
Message 4 of 4
(1,177 Views)