LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about when to use SharedVariables vs FIFO's on myRIO

Hello all,

 

I had a couple of questions about when to use Shared Variables vs. FIFOs in LabVIEW myRIO.

 

Now, there are certainly multiple ways to read / write data between parts of a project. For example, Queuing is a way to read / write data between different loops. Am I correct that "Shared Variables" are a traditional medium to read / write between the PC (the blue region on the attached picture) and the myRIO CPU (the red region on the picture)? Likewise, am I correct that "FIFO's" are a traditional way to read / write between the FPGA (the green region on the picture) and PC / myRIO CPU (RT target)?

 

I noticed that Shared Variables cannot be used on an FPGA VI, so I'm just trying to build the intuition for when to use the FIFO instead.

 

Picture of project:

 

 

- Thank you, OP

0 Kudos
Message 1 of 3
(1,210 Views)

Hi 441,

 

network shared variables can be used for data exchange between PC and RT target.

Shared variables available by using the ScanEngine of the RT target can be used to read/write data to (mostly) hardware IO in your RT target.

RT FIFOs can be used to echange data between VIs running on the RT target.

FPGA DMA FIFOs can be used to transfer data between RT target and its embedded FPGA…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,202 Views)

I have not used myRIO but have done some of this with cRIO. In my experience, network published shared variables work somewhat OK, but they're kind of a pain to use as they're very slow and do not guarantee that you will received each value. Network streams, on the other hand, are very fast and work basically like a network queue. I have been able to reliably transmit very high data rates using streams.

 

See this article for more info on which protocol to use, as they each have their own strengths and weaknesses:

 

https://www.ni.com/en-us/innovations/white-papers/10/using-the-right-networking-protocol.html

 

0 Kudos
Message 3 of 3
(1,193 Views)