09-27-2013 06:55 PM
How can a single-process shared variable be both FIFO and single element at the same time?
I'm reading the NI recommended practices for communicating between a deterministic loop and a non-deterministic loop. It says to use a Single-Process Shared Variable that is both FIFO and single element. Ok I must not be getting something... because in my mind these two things should be mutually exclusive. How do you have the 1st of only one element?
Solved! Go to Solution.
09-28-2013 11:02 AM
What "RT FIFO Enabled" means is that when you use the shared variables in a Timed Loop it actually is writing to an automatically created RT FIFO.
The key here is that typically shared variables are shared resources and can add jitter to deterministic tasks if another loop is using the variable at the same time as your deterministic loop.
So here's the takeaways, when using Shared Variables with RT FIFO Enabled:
RT FIFOs exist because their architecture designates them as non blocking so that when the timed loop tries to access them it is guaranteed immediate access to a memory space.
Does this answer your question?
10-01-2013 11:59 AM
Ah, Ok this is starting to make sense now.
If I use global variables, to communicate between two loops, I can create jitter because both can not access the same variable at the same time. But the RT FIFO will create sort of a "micro queue" that exist just long enough to prevent that. Did I get that right?
10-01-2013 12:16 PM
The micro queue is not dynamically created and destroyed, it exists the whole time, otherwise yes you got it exactly!