LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to add one Continuous function in Producer consumer event??

Hello,

producer consumer event vi is base example for me ,I have design my system according to it.

Now I am dealing with photo sensor in that its measure continuous data according to intensity of light,for continuous function I have make while structure for photo sensor but the problem is that I don't know how to add this while loop in producer consumer event ,if I add then its run continuously and then my operation is stuck there.

Will you please guide me that how can I add this continuous function in this structure so simultaneously I can do other function like pause reset..Etc...

Here in attachment I have attaché one example regarding to this in that I have add simply increment function in case structure and when I execute my vi then execution is stuck at while loop until it manually stop.

 

Thank you very much...

0 Kudos
Message 1 of 5
(2,674 Views)

What you want is Producer/Consumer (data). Perhaps a combination of both.  If you have user events so that you need the event structure, add a third loop to be the data acquisition producer.

 

You would have three loops: Producer (Events) for the User Interface, Producer (Data) for data acquisition, and Consumer.  Two different queues are require, one for each Producer.  You might be able to make it work with one but it is so much easier with two. Also plan how you will shut down the loops.  The "kill the queue" technique used by the Design Pattern does not work because the DAQ queue is not in the Event Producer. Also you need to close the data acquisition before stopping the Data Producer.  A notifier is one way of letting all loops know of the shutdown command.

 

Lynn

0 Kudos
Message 2 of 5
(2,659 Views)
0 Kudos
Message 3 of 5
(2,646 Views)

Thank you for your reply...

i tried with given example but Still I am facing same problem.

I have put while loop after 2nd state but when i Run then my excecution is start it seem first two message then its stuck in while loop its not go forward for 3rd state and even i am not able to do reset and pause and stope operation in that,..

here in attachment i have attached that vi in which i have made changes...

will you please guide me that how can i solve this query..

Thank you very much for help.

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

Hi AnkitRamani,

 

I made a simple example with a UI queue and a second producer which is pushing data into its own consumer, displaying the signal and its spectrum.

 

Maybe this is what u need.

 

 

 

 

Marco Brauner NIG

0 Kudos
Message 5 of 5
(2,586 Views)