LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout error using grab

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 

0 Kudos
Message 1 of 20
(4,511 Views)

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,


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 20
(4,491 Views)

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? .. Smiley Embarassed

0 Kudos
Message 3 of 20
(4,484 Views)

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 .. ??

0 Kudos
Message 4 of 20
(4,475 Views)

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? 

 

CameraReduced.png

 

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.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 5 of 20
(4,459 Views)

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.

0 Kudos
Message 6 of 20
(4,456 Views)

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.

0 Kudos
Message 7 of 20
(4,455 Views)

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. Smiley Very Happy

 

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, 


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 8 of 20
(4,426 Views)

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

0 Kudos
Message 9 of 20
(4,417 Views)

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:

 

  • Are you receiving any errors?
  • Could you try increasing the Frame Timeout? At the moment, it's configured as 1ms but the triggering rate is set to be 1Hz; 1000x slower! Try setting the timeout to be 5000ms, just to test with to see whether the triggers are being picked up.
  • Have you tried manually applying a trigger rather than relying on the counter, just to make sure that the camera itself is able to be physically triggered by this kind of signal (5V TTL)?
  • The Counter Task is also being Cleared before it has had a chance to finish. Try using the 'Wait Until Done' NI-DAQmx VI in order to make sure the Counter task has finished before clearing the channel.
  • Try sequentially starting the Grab Setup VI before starting the Counter Task. This will avoid missing the first transmitted pulse from the Counter.

 

Hopefully this should give us a good starting point in order to troubleshoot the operation of the camera further.

 

Kind Regards,


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 10 of 20
(4,413 Views)