Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variables between cRIO Host and FPGA in different projects

Up until now we have directly read or write the FPGA controls from the cRIO host.

However we have become time constrained.  It seems we have about 10-30 us per read variable.  Even if we make read many controls with one read_controls method call, the CPU usage goes up for each control we read.

 

I read in the white paper:

 

https://zone.ni.com/reference/en-XX/help/371599F-01/lvfpgaconcepts/pfi_data_transfer/#UDIOV

that lower CPU usage for transferring data with User-Define IO variables.

 

I also read elsewhere a LabVIEW guru suggesting never to use shared variables as they are a pain to deploy.  However there is deploy shared variable library method so I hope to use that to avoid deployment issues over the several cRIO installations we have.

 

To make things more complex and this is my main questions, our development has separated the FPGA coding and the cRIO coding into separate projects, to help manage different developers and source control.

However would is the best way to shared variables between cRIO Host and FPGA  developed in different projects.  

 

Can the shared library be shared by two different projects?

This implies it would reside outside the file structure of each project and in a 'Common' folder tree.

 

Any help or comments welcome

 

thanks

Michael

0 Kudos
Message 1 of 3
(2,354 Views)

Hi Michael,

 

As far as I know, there is nothing wrong with multiple projects using one shared variable library. Below I have linked a tutorial that talks more about shared variable applications

 

Developing Portable Shared Variable Applications

http://www.ni.com/tutorial/9900/en/This tutorial walks the developer through creating portable applications that communicate with Shared Variables

Applications Engineering
National Instruments
Message 2 of 3
(2,317 Views)

Thanks.

I will try out the suggestions in the tutorial and report back how well it works.

 

My extra problem is trying to keep the shared variable library concurrent between two projects and also source control tracking.

I might need to make a new source control project just for the share variable library.

 

Michael

0 Kudos
Message 3 of 3
(2,306 Views)