06-22-2022 04:08 PM
Hello,
Help is much appreciated. I am trying to operate a FLIR Grasshopper3 USB camera (GS3-U3-23S6M) using LabView and it seems to max out at acquiring images at 20 Hz. However, I will need this camera to work at 40-50 Hz regularly. I think it is not a problem with the camera (which has a max FPS of 163) or cables because I can operate the camera with the FlyCap2 software at 163 FPS with the trigger disabled, and at 40 FPS with the trigger enabled (note, I am supplying a 40 Hz trigger signal with a pulse generator). But once I swap drivers and try to operate the camera with LabView, it can't seem to acquire any faster than 20 Hz. I can slow down the trigger to below 20 Hz and then LabView/the camera can keep up. Any thoughts on what the source of this issue may be? I am rather new to LabView, so I'm sure it is something in my code that is slowing the whole process down. I have attached the code to view.
Sorry if this is not the right forum location for this question. I'm new to NI forums.
Thank you!
06-23-2022 01:31 AM
You do a lot of thinks in the while loop. Try this please. You can also play with image formats. I have changed to png. If programm is still to slow, disable saving and try again.
06-23-2022 01:44 PM
Hi, unfortunately I can't open your file because it is in a newer version of LabView than I have. Could you save it to the 2017 version and send again please?
06-27-2022 09:01 AM
Sorry, I did'nt have access to an LV PC during last days. Please try this.
06-28-2022 03:28 PM - edited 06-28-2022 03:37 PM
Thank you, your code has helped a lot, but I have one issue/question. The 'buffer number out' seems to match the rate of my triggers (i.e., if my external trigger is 40 Hz, I'll get ~40 buffers out per second). However, when I stop the program from running and check the folder where the images are being stored, there are fewer images saved than the buffer number out (by a lot, for example, buffer number out was 184 but only 43 png images were saved). Do you have any thoughts on why that is? I inserted my time measurement flat sequence again and it still seems to be taking >100 ms to grab and save each image...
I can also seem to only run the program once and upon trying to run it a second time I get a time out error (Error -1074360293). Is there a way to fix that?
Thank you for your time!
06-28-2022 04:13 PM
Hello, posting again because my reply was removed for some reason. Thank you for your code, it was very helpful. However, I still seem to have the same issue. With your code, the 'buffer number out' seems to match the rate of the trigger, but it doesn't save the same number of images as the buffer number out -- in fact, significantly less, still at ~10 Hz or so. Wondering if you have any other ideas?
I have tried removing the saving functionality and then it does grab the images at the expected rate. But that's not helpful -- I need to be able to save the images for data analysis.
Also, I seem to only be able to run the code once and when I try to run it a second time I get a timeout error (-1074360293). Is there any way to fix this?
Thank you again.
06-30-2022 02:13 AM
It sounds what you hardware is too slow to store the images. Test your hard disk write rate.
Try using an SSD or several HDDs in RAID0 configuration. Maybe the producer-consumer pattern will help You.