10-20-2022 03:37 PM
There are multiple things "not quite right" with this code, possibly due to a lack of understanding of some of the Fundamentals. Here are some comments:
Try making these changes and see how they work.
Bob Schor
10-20-2022 04:30 PM
hi bob, thank you for the suggestions i will do those changes.
Can you please tell me what can i do to solve this? because its working with notifier but not with QMH
thank you
10-20-2022 08:18 PM
Your Consumer Loop starts with a Dequeue. What if the Queue is empty (because you haven't put anything in it since it processed whatever was originally there, e.g. "Initialize")? It will wait (patiently, taking no CPU time, so you can be doing other things "in parallel") until there's something in the Queue or it "times out". Click on the Dequeue function and bring up the detailed Help for Dequeue -- notice the Time Out input (lower left)? If unwired, it has a default value of -1, meaning "Wait forever" until there's something on the Queue.
Your code does exactly what you told it to do. You should probably use the LabVIEW Help on the other functions in your code to make sure you understand how they work.
Bob Schor
10-21-2022 03:08 AM
hi bob,
Thank you.
found one example as you said and Added some data in Queue. but no improvements at all. can you tell me what is the exact problem beacuse im not that expert
thank you
10-21-2022 05:13 AM
@newmemeber123 wrote:
i converted it in LabVIEW 2018 i think now you can see my previous vi which i was trying. i tried your idea its showing error. can you please check the VI?
You're sending out the case "". In my example i have a default "idle". If you have no ""-case (or default) you'll get the error you see.
10-21-2022 05:45 AM
i made a changes as you said the while loop is running but now when i press the connect button from event structure of producer loop it's not working the state of the case is not chnaging. my idea is if i presss connect button from producer loop then the consumer loop should start running with in the connect case and if press the disconnect button then program in disconnect case should execute.
10-21-2022 07:43 AM
Your Producer Loop IS running. What makes you think it isn't?
Within the Block Diagram, turn on Highlight Execution and press Run. You'll see that everything is running in the Producer While Loop & the Consumer While Loop.