LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

high priority producer normal priority consumer

Solved!
Go to solution

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 ?

 

 

0 Kudos
Message 1 of 5
(3,064 Views)
Solution
Accepted by topic author mzamstl

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>   ---'


0 Kudos
Message 2 of 5
(3,049 Views)

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

0 Kudos
Message 3 of 5
(3,007 Views)

Umm I meant it to be a hypothetical situation and was wondering if there was any problems to it. Thanks for answering 

 

regards mzamanstl

0 Kudos
Message 4 of 5
(2,975 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 5
(2,946 Views)