11-19-2012 07:36 AM
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...
11-19-2012 08:46 AM
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
11-19-2012 09:58 AM - edited 11-19-2012 10:03 AM
this might help you....
11-20-2012 01:28 AM
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.
11-21-2012 08:13 AM
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