04-18-2012 07:41 AM
Hi,
I keep getting the following timeout error:
Error -1074397150 occurred at IMAQ GrabAcquire.vi:1
Possible reason(s): NI-IMAQ: A timeout error occurred while waiting ... etc.
I am triggering camera grab through the RTSI connection of my boards (PCIe-1427 and PCI-6731) - I've exported a counter output event from my implicit timing.vi to RTSI0. (My cards are connected by a RTSI cable, the cable is configured and all that jazz). I've highlighted this in the attached image.
I though maybe my frame size was too large so I reduced it (i.e.. reduced the acquisition time) but I'm still getting the error. However, I don't get an error if the action of the configure trigger.vi is set to 'disabled' (I want to trigger the acquisition to yield the same number of images as samples.).
Does anyone have any advice on this problem??
Kind regards,
Miika
04-20-2012 03:37 AM
Hi Miika,
My first thoughts would be that it sounds like the trigger isn't reaching the devices. From looking at your code, I don't think there's anything to suggest that the IMAQ grab task is initialised before the DAQmx trigger is asserted. My first suggestion would be to make sure that we sequentially initialise the grab task and then assert the trigger, because we could be firing the trigger before the IMAQ task is even ready to receive it!
I also have a couple of general questions about your application:
Q: Have you been able to successfully acquire images from the camera when not using triggering?
Q: What kind of camera is it that you're using?
Kind Regards,
04-20-2012 07:24 AM
Hi Alex T.,
Thansk so much for your reply!! It was rough going there for a while.
I'm using SU-LDH Digital Line Scan Camera from Goodrich. I have very recently verified with a scope that my camera is being triggered. I hardwired my counter output to my camera control lines instead of using RTSI. The scope traces show the camera acquisition being triggerered on the counter edge, which is good.
However, I want to save all of the triggered images for further processing. In the attached code, athough the code will run and complete, not all of the images are being saved to the folder (I'm using the i of the while loop to monitor the frames - I think?). Also I am unsure about how I terminate this while loop - I specify the number of images I want initially (dictated by the frequency of switching, image size, trigger delays etc) and have set the while loop to terminate when the acquired buffer number = number of desired frames.
What do you think is going on here? I tried to capture an .avi instead and split the frames aftewards but still no joy.
P.s. I'm not exactly sure what a frame buffer is to be honest .. I was thinking it was the frame number sent into memory? ..
04-20-2012 08:15 AM
Also I am going to be triggering at fast speeds (1000 Hz) so I'm thinking maybe saving teh images as png is a bad route to go .. ??
04-20-2012 10:04 AM
Hi Miika,
So just to check, are you successfully acquiring images at this point? (I'd just like to make sure of this before we discuss what we're going to do with the grabbed frames!)
I've made a few changes to your Block Diagram which will allow us to focus just on grabbing data from the camera. This should ensure that no other possible coding errors get in our way.
Would you also be able to try decreasing the triggering rate just for the time being?
If the images are being acquired successfully, try reducing the triggering rate for the time being to see if you can successfully grab an image at the intended intervals. Then try increasing the rate to find the limitations of the system; from there we may be able to improve the speed of acquisition, such as by reducing the sizes of the images that we intend to acquire.
04-20-2012 10:15 AM
Hi Alex,
Yes, I am acquiring images successfully and thank you so much for the vi - it is very helpful. Just for my own knowledge, why did you use a flat sequence structure? You see, I've been doing 'for loop' and setting N to be equal to the freqeuncy (i.e. number of Pulses in the counter output) - does you flat structure do exactly this but in a neater way??
It's definitely the way I'm saving the images that's slowing things down. I would like to save as much info about the images as possible (hence me trying to save the images as png's) - is it possible to save the incoming images as binary 2D files which I could process as usual later on??
Miika.
04-20-2012 10:40 AM
I just tried to run the code - should there be IMAQ Grab Acquire.vi after IMAQ Grab Set-up? I'm trying to output the images to see if it's working. Also how will the code stop after N samples are captured (i.e. no of frequency pulses)?
Many thanks.
04-23-2012 03:15 AM - edited 04-23-2012 03:16 AM
Hi Miika,
I used a Flat Sequence structure in order to explicitly order the sequence of first initialising the camera and then asserting the triggering task; there's nothing too clever going on in there! My code was just to make sure that we could trigger the task effectively; but it won't suit the needs of your application. Since we're now triggering the camera and receiving images as expected, you can ignore my test VI.
If you're having trouble saving images, then you should try taking advantage of LabVIEW's ability for concurrency. I'd recommend taking a look at the Producer/Consumer architecture as this will allow your acquisition task to run at the intended rate without forcing it to wait until we've finished saving images. The way this works is by decoupling the tasks into two independant while loops and using Queues to pass data between the two.
Kind Regards,
04-23-2012 08:54 AM
Hi Alex T.,
I've taken on board the producer/consumer architecture and have rewritten the file using queues. The good news is using this structure, images are being saved very quickly into png's. However, when I put the trigger and counter into the mix, nothing is being saved. I'm thinking its just my code, but I can't seem to find the problem.
Any thoughts? Please find it attached.
Kind regards,
Miika
04-23-2012 09:20 AM
Hi Miika,
That's great news. We're getting close!
Q: However, when I put the trigger and counter into the mix, nothing is being saved. I'm thinking its just my code, but I can't seem to find the problem.
A:
Hopefully this should give us a good starting point in order to troubleshoot the operation of the camera further.
Kind Regards,