LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ring buffer

Solved!
Go to solution

Hello,

 

I am new to LabVIEW (and programming in general).  I am working on an old LabVIEW project at work that I have to improve.  The project is using a camera to take a video, processing the frames, and showing the procesed image on the front pannel.  So I need to create a buffer (I believe it should be a ring buffer) so taking the images and processing work in parallel (as close as possible to parallel).  I am kinda lost as to how to do this, so I was wondering if someone could explain it to me.

 

Thanks!

0 Kudos
Message 1 of 8
(3,735 Views)
I believe you should have to While loops running in parallel. One Loop will take the image the other one will process it. For more help you need to give us some more details and ask more specific questions. Even better if you can post some of your code or an image of your block diagram. If the work is confidetial then you need to modify it so the things that are included are not confidential.
Message 2 of 8
(3,705 Views)
Sorry i meant 2 While loops.
0 Kudos
Message 3 of 8
(3,703 Views)
Solution
Accepted by mkhalil4
I would suggest reading over the material in the NI KnowledgeBase on Application Design Patterns, such as the Master Slave pattern or the Producer-Consumer pattern. Those will give you a solid foundation for what you are trying to do.
Message 4 of 8
(3,694 Views)
Currently, I have two while loops that should be running in parallel, one is taking the image the other should be processing. However, when I use highlight execution, the loop which is taking the image does not allow the image to leave the loop, so it does not get processed.  I'm not sure why that is happening..... I've attached what I have done so far.
0 Kudos
Message 5 of 8
(3,648 Views)

They are doing anything but running in parallel. You have a data connection from loop1 to loop2. Loop2 will not even start until loop1 finishes and the only data you'll get in in loop2 is the very last iteration from loop1.

 

You've already been told to look at producer/consumer architecture. Just go to File>New... and look at VI>From Template>Frameworks>Design Patterns.

Message Edited by Dennis Knutson on 06-11-2010 01:46 PM
0 Kudos
Message 6 of 8
(3,640 Views)
If you want them to run in parallel you need to delete the wire going to the 2nd while loop. But the best way is as suggested producer-consumer.
0 Kudos
Message 7 of 8
(3,610 Views)

I got it to work using the producer consumer pattern.

 

Thanks for all the help

0 Kudos
Message 8 of 8
(3,567 Views)