08-06-2018 07:22 AM
@altenbach wrote:
I am surprised that nobody mentioned the shared variable (single process).
I usually only suggest those when a library is already being used. I just tend of avoid them do to my hatred for Network Published Shared Variables.
08-06-2018 07:53 AM
@crossrulz wrote:
@altenbach wrote:
I am surprised that nobody mentioned the shared variable (single process).
I usually only suggest those when a library is already being used. I just tend of avoid them do to my hatred for Network Published Shared Variables.
Yes a NI rep many years ago warned me about using them. If the need can handle missed updates, and being slow, ... and the application that I am being asked to help fix is "good enough" then I will stick with them. But if I need something reliable they are not an option.
Now back to a couple of points I can offer.
If the critical loop can spin much faster than the OTHER process can push messages, then Functional Globals can be used just fine. If the critical loop, however can be stalled and possibly miss and update, Queues are the way to go in most situations. I used to wrote round-robin buffers in the form of Action Engines before queues were made polymorphic. But now that they are polymorphic and data can e transferred "in-place" with the queue just passing a handle to the data, it is had to beat the performance.
In two recent project I need to process data vey fast and multiple queues let me implement a type of bucket brigade approach to process that data. I was able to sample 32 DIO lines coming in at 400MHz, demux the signal on a single data line into two channels of info and then decode from the binary stream to audio signals and then do live FFTs of the audio signal. Queues were used between each of those steps and it made use of all of the cores in the machine.
In my opinion Queues kick-butt and Stephen has really made a mark on what LV can do when he implemented the polymorphic queue.
Ben
08-06-2018 08:02 AM
@Ben wrote:
If the critical loop can spin much faster than the OTHER process can push messages, then Functional Globals can be used just fine. If the critical loop, however can be stalled and possibly miss and update, Queues are the way to go in most situations.
You might actually want to consider a RT FIFO when it comes to sending messages to a time critical loop in an RT system. Less jitter, otherwise almost identical to a fixed sized queue.
@Ben wrote:
In two recent project I need to process data vey fast and multiple queues let me implement a type of bucket brigade approach to process that data. I was able to sample 32 DIO lines coming in at 400MHz, demux the signal on a single data line into two channels of info and then decode from the binary stream to audio signals and then do live FFTs of the audio signal. Queues were used between each of those steps and it made use of all of the cores in the machine.
This situation meets the definition of Streamed Data and you used a Producer/Consumer, with one consumer also being a producer for another loop. Very common design pattern.