LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can shared variable affect RT determinism ?

Solved!
Go to solution

I keep reading again and again that "If you enable the real-time FIFO of a shared variable, you can deterministically share live data without affecting the determinism of VIs on an RT target".

Could anyone help me understand on how shared variable affects RT determisim and how FIFO shared variable does not.

Thanks !

0 Kudos
Message 1 of 3
(2,937 Views)
Solution
Accepted by topic author zigbee1

If you send something fro the RT to the Host, you're going to be using the network, which is inherently non-deterministic. 

 

In order to use a SV to maintain determinism, you want to remain on the RT target.  You'd use this to pass the most recent value from one loop to another.  If you enable the FIFO, you're creating seperate read and write points so that you don't have the same access point in both your deterministic and non-deterministic loops.  With that, you're able to maintain determinism while passing the most recent value of a variable to non-deterministic loops.

 

The idea is you don't break the determinism of your deterministic loop while accessing this data elsewhere.  If you don't enable the FIFO, you've got a shared resource that may end up blocking the deterministic loop and could potentially go beyond your jitter bound.

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

Thank you, I understood now that shared variable uses blocking calls (atomic operations). By enabling FIFO, that makes it non-blocking and therefore makes the code that uses it deterministic.

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