10-16-2015 04:55 PM
Hello ni forums
I have a question
Lets say that I have a real time application, on the top level vi I have 2 loops
1st loop is a high priority subvi that has open fpga reference vi, this initializes the fpga to run with the proper parameters and after initialization, the actions are reading data from dma fifo, doing digital io and etc., if something is wrong on either the fpga side or host side then it closes that fpga connection. This loop has data acquisition in it and therefore is the producer loop.
2nd loop is a normal priority subvi that anaylzes and processes data from the 1st loop and if something is wrong then it just waits and does not do anything. This loop consumes the data by the producer so this is the consumer.
My question is that,
Will this create any conflicts or problems if it is implemented with the method I suggested ?
Solved! Go to Solution.
10-16-2015 05:28 PM
Nope. This is how a producer consumer architecture works. The producer usually needs specific timing (acquisition) and the consumer just hangs out and handles the data when it comes in.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-17-2015 12:25 PM
I completely agree with Jim that this is the idea behind the Producer/Consumer Design Pattern. However, your description of what you are doing has a number of puzzling aspects (high-priority subvi, dma fifo, what happens on error conditions, how data are passed between loops) that I'd like to see the actual code before rendering an opinion. Can you attach the relevant VI (or VIs)?
Bob Schor
10-18-2015 07:59 PM
Umm I meant it to be a hypothetical situation and was wondering if there was any problems to it. Thanks for answering
regards mzamanstl
10-19-2015 01:59 AM
You can even go one step further, and place the producer in a vi of it's own with high priority and the consumer in a vi with normal priority. Not that i see when this would be necessary, but still. 🙂
/Y