Jump to content
Guest

Can Functional Globals be used to share data between VIs running on different targets?

Recommended Posts

Guest

The LabVIEW wiki page on Functional Global Variables (FGV) states that

The primary use of Functional Globals is to provide data sharing across an entire project, both horizontally and vertically.

In the past, I have successfully used FGVs to share data among VIs running on the same target. In my current project, which involves multiple targets (namely, a host PC and a cRIO), I now want to pass configuration data between a Host VI and an RT VI, and I thought an FGV would come in handy for that.

 

However, it doesn't seem to work: I write to the FGV on the Host VI alright; but when I read data from the FGV in the RT VI, I only get default values, as if nothing had ever been written to the shift registers. Before you suggest it: yes, I have checked the VI properties of my FGV; its execution is set, as it should be, to non-reentrant.

 

Can Functional Global Variables be used to share data between VIs running on different targets? Or is an FGV's scope limited to the target it runs on?

Unfortunately, I couldn't find any answers to those questions in the LabVIEW online help, or on any LabVIEW discussion board...

Share this post


Link to post
Share on other sites
The LabVIEW wiki page on Functional Global Variables (FGV) states that

In the past, I have successfully used FGVs to share data among VIs running on the same target. In my current project, which involves multiple targets (namely, a host PC and a cRIO), I now want to pass configuration data between a Host VI and an RT VI, and I thought an FGV would come in handy for that.

 

However, it doesn't seem to work: I write to the FGV on the Host VI alright; but when I read data from the FGV in the RT VI, I only get default values, as if nothing had ever been written to the shift registers. Before you suggest it: yes, I have checked the VI properties of my FGV; its execution is set, as it should be, to non-reentrant.

 

Can Functional Global Variables be used to share data between VIs running on different targets? Or is an FGV's scope limited to the target it runs on?

Unfortunately, I couldn't find any answers to those questions in the LabVIEW online help, or on any LabVIEW discussion board...

 

They of course can't do that out of the box. A VI in one application context does share absolutely no data with the same VI in another application context out of its own. That is even true if you run the FGV in two separate projects on the same computer and even more so if they run on different devices or different LabVIEW versions. As Jordan suggested you will need to implement some real interapplication communication here, either through network variables (most easy once you got the hang of it how to configure them and deploy them to the targets), or your own network communication interface (my personal preferences in most cases).

 

There are also reference design projects for cRIO applications such as the CVT (Current Value Table) and accompagning CCC (CVT Client Communication) that show a possible approach for implementing the second solution.

Share this post


Link to post
Share on other sites
Guest

Thanks for your replies, which have been really helpful.

 

Instead of using and FGV for this particular task, I will put my config data in the variant of a queue element on the host, then send that queue to the target via network streams. 

Share this post


Link to post
Share on other sites

I do suggest reading through my linked document. It will give you some help determining which implementation is best for your use case. At a very very rough guess if an FGV works for you, a Network Shared Variable (NSV) may be a better solution for you. There are some out-of-the-box solutions from NI and a few others that transition to a custom implementation. The important thing is to understand the options and choose what is best for your application. Good luck with your choice. More details and I think we'd be more than wiling to guide you to the appropriate transport mechanism.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.