07-07-2016 02:34 AM
Hello to everyone:
First of all thanks a lot for reading this post and being able to help.
I have an application where I have to process 4 images from a GigE camera in 0.5 seg.
What I do is: in one while I have a flat sequence where the steps are:
- Take first image
- 3 frame flat sequence to process the image.
In the next iteration while, take second image and proccess it... and until 4 image processed.
The problem is that the time is too short because I have to process 4 images in 0.5 seg.
So I have to reestructure my code.
Any idea how to do that?
Maybe put some wait until ms in the while loop.
Or maybe use a producer/consumer where the producer will be the while where I take just the 4 images and the consumer another while will process the images. And use a queue with the 4 images to send them from producer to consumer.
Because maybe is better to take first the 4 images and then process them so that no image is not lost on the way.
Any ideas?
Thanks a lot!
07-07-2016 02:56 AM
Sharing original code will be helpful
Instead of using Flat Sequence, normal state machine architeture should work fine for your requirement
07-07-2016 02:58 AM
Is it better a state machine or a producer/consumer for improving time?
07-07-2016 03:00 AM
If you want to parralley acquire and also process the you can use Producer consumer else you can use state machine
In producer consumer make sure you are synchronizing the data properly between aquisition and processing
07-07-2016 03:05 AM
I think it is better parallely because like this camera has not to wait until labview process the last image to take the next image.
Is it ppossible to do with queues?
07-07-2016 03:25 AM
07-07-2016 04:50 AM
Thanks a lot!
Do you know where can I find information about queus in labview?
07-07-2016 04:54 AM
Simple Queue Example you can find in NI Example itself
07-07-2016 07:51 AM
Please post your code. From your comments and questions, I'm guessing that your code is probably "mis-organized" and you are doing things in a very inefficient manner. However, without knowing what you are doing, it's very difficult to say "Don't do that, do this instead".
For example, you mention using a flat sequence. Flat sequences are almost never needed in modern LabVIEW (i.e. any version released in the last two decades) -- good Data Flow principles (including making proper use of the Error Line) can suffice.
There are a number of Design Patterns that can enhance parallelism, but we need to see what you are trying to do before making recommendations.
Attach your VI(s). If you have your work organized in a LabVIEW Project, then compress the folder containing the Project and attach the resulting .ZIP file, instead (so we'll have all of your sub-VIs, too -- you do use sub-VI's, don't you?).
Bob Schor