Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Consumer producer - Acquisiton image but only producer loop run

Solved!
Go to solution

Dear all

 

I try acquire and save image from Basler camera L301kc and NI PCe 1427 framegrabber. I create a producer/ consumer loop because the save take more time that the acquisition and if I do both in the same loop I lose frames. But I have problem: only producer loop run.

I have read all the threads but I didn't manage to solve my problem.

I have attached a VI code of how I was trying to do it. I am using LabView 2011.

Please any comments or help is deeply appreciated.

Thank in advance

 

XuanThuy

 

0 Kudos
Message 1 of 11
(3,957 Views)

You have the stop button wired from one loop to the other.  This means the second loop will not start until the first loop stops, due to data flow.  That means your consumer loop doesn't start until the producer loop ends.  Also, you have the error wire from the consumer loop wired to the destroy queue vi.  This means the queue won't be destroyed until after the second loop finishes.  There could be other data flow issues, but I only took a quick look.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 11
(3,953 Views)

Dear Bruce,

 

Thanks for your help. I try edit vi code.  The consumer loop has run .But I don't find error from the consumer loop wired to the destroy queue vi.Can you help me ?

0 Kudos
Message 3 of 11
(3,941 Views)

Hi XuanThuy,

 

Can you provide more information about what doesn't work in this VI? Do both the producer and consumer loops run no the way that you expect them to? Are you still noticing any data flow issues? Please let us know what you are still having problems with and post your updated code so that we can help you to troubleshoot better. Thank you!

 

Regards,

Kira T

0 Kudos
Message 4 of 11
(3,925 Views)

Dear Kira T,

 

The producer and consumer loop has run but the Image Out in consumer loop is empty. Bruce attention to the error wire from the consumer loop wired to the destroy queue vi. But I don't find error.

I have attached a new VI code.

Can you help me ?


Thanks and regards

XuanThuy



0 Kudos
Message 5 of 11
(3,913 Views)

Hi XuanThuy,

 

When you run the program, do all 10 images appear in the image display on the front panel? Are you probing the image out wire when you run the program to make sure that the issue is that there is no image in the Image Out and not that there is no File Name?

 

This may also be caused by a data flow issue. If you place an image display right before the Bundle By Name function is there an image that you can display? Because images in LabVIEW are pointers to memory locations, it seems like you are actually erasing the image before you are processing and saving it.

 

Regards, 

Kira T

0 Kudos
Message 6 of 11
(3,897 Views)

Dear Kira T,

 

Thanks for your help. I has tried correct program by remove an image display right before the Bundle By Name function.The probe of Image wire when I run program show Image with File Name for 10 frame. But the error out 1 have status code ERR (-1074396120) - "IMAQ Set Image size". In the consumer loop, the probe of Image after Unbundle1 By Name function show only File Name. Image out is empty and error out 2 have status code ERR (-1074396120) - "Write JPEG file".I don't find the error in program.

 

I have attached a new VI code.

 

I appreciate for your kind help.

 

Best Regards,

 

XuanThuy

0 Kudos
Message 7 of 11
(3,886 Views)

Hi XuanThuy,

 

I think that you are still seeing a data flow issue here. It seems as if you are destroying the image memory location before you are actually taking the image out of the queue. Have you tried to move the dispose image to the consumer loop? This way you will not delete the image memory location until after you have processed them in the consumer loop.

 

Regards,

Kira T

0 Kudos
Message 8 of 11
(3,872 Views)

Dear Kira T,

 

I don't understand. What are move the dispose image to consumer loop ?. Can you correct direct to my vi code ?

Pls. hepl me

 

Regards,

 

XuanThuy

0 Kudos
Message 9 of 11
(3,862 Views)
Solution
Accepted by topic author XuanThuy

Hi XuanThuy,

 

Attached is the location of the Dispose VI in your program.  It is currently located in the producer loop.  I think that it would help for you to move this to the consumer loop, so that you do not remove the image from memory before you save it to jpeg.  Please let me know if this helps with your program.  Thanks.

 

Regards,

Kira T

0 Kudos
Message 10 of 11
(3,852 Views)