Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IEEE1394 IMAQ , how to manage buffer in LL 'ring'

Solved!
Go to solution
When modifying the example code for IMAQ LL Ring, there does not appear to be a IEEE1394 version of the "IMAQ configure buffer VI" . The existing VI will not connect with "IMAQ1394 Configure acquisition VI" . Can you please advise on how to manage buffers to allow high speed image acquisition with IEEE1394 camera ( Basler A602fc). Alternatively could you point me to an example which demonstrates LL RING image acquisition with IMAQ1394 VI's. We have already purchased the NI-IMAQ for IEEE1394 cameras 1.5.2.

Cheers
Greg
0 Kudos
Message 1 of 7
(4,265 Views)
Greg,

If you are trying to do a continuous ring acquisition with 1394, it depends which operating system you are using.

If you are using RT, everything is pretty easy. You can retrieve the most recent buffer and you can retrieve multiple images relative to that buffer. You should just need to make minor modifications to the sequence acquisition vi to make it continuous.

If you are using Windows, you are going to have a tough time. The acquisition itself works fine, but the drivers do not provide the tools to track the most recent buffer acquired, and you can't retrieve more than one buffer for each buffer acquired. Also, if you stop the acquisition all the buffers go away, so you can't read them post-acquisition. This has all frustrated me many times, since many of my projects use continuous video.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 7
(4,255 Views)
Bruce,

Since you are doing continuous acquistion, I am curious how you have set your buffers up. Like you, I also want the most recently acquired imnage for processing and have configured my 1394 acquistion to use only 2 buffers and then take the most recent one (the -1 option for the 1394 grab vi).

As I am novice, I wonder what the significance of using larger buffer sizes is. The NI example snap/acquire vi uses 10 buffers and I have also seen some examples use buffers of 50 and then use the number of loop iterations to select a particular buffer (e.g. in the example 1394 to AVI software at graftek (http://www.graftek.com/exsoftware.htm)). Curiously, I have noticed that more buffers seems to slow down my vi in XP (which is why I use 2).

In short, what is the logic behind buffer allocation?

Thanks,

rb
0 Kudos
Message 3 of 7
(4,214 Views)
Ideally, more buffers gives you more "lag time" for processing images. If you get a little behind in your processing, you can catch up without losing any images.

Also, my application processes the last 256 images, and it is nice to be able to pull them from a larger buffer. With regular IMAQ, it is a piece of cake. Currently with IMAQ 1394 it isn't possible.

I am patiently awaiting the next version of IMAQ 1394, which I expect to handle the buffer problems.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 7
(4,185 Views)
I hear version 2.0 of the 1394 drivers have just entered beta. Might want to ask for them if you are not already included in the test list.

rb
0 Kudos
Message 5 of 7
(4,128 Views)
Solution
Accepted by topic author al capern
With NI-IMAQ for IEEE 1394 Cameras 2.0, the ring buffer concept is supported. During configuration you specify the number of buffers that you wish to loop on. By default the high level acquisition allocates a ring of 3 buffers for a continuous acquisition. Using the low level Get Image VI, you can request any buffer number during acquisition. The driver tracks a 0-based running buffer number (0, 1, 2, ....) for the images transferred.

Assuming we have a ring of n buffers and the last transferred buffer number is i and the user requests buffer number x, we can have one of the following scenarios:

1) Buffer must still be acquired (x > i)
The driver will wait and return buffer number x

2) Buffer is availble (i >= x > i - n)
The driver will return buffer number x

3) Buffer is overwritten (x <= i - n)
The driver will return one of the following based on the requested overwrite policy:
a) newest buffer - The driver will return buffer number i
b) oldest buffer - The driver will return buffer number i - (n - 1)
c) fail - The driver will return an error

This is supported on both Windows and LabVIEW RT.

Hope this information helps.

JohannS
Message 6 of 7
(4,102 Views)
Hi Johann, hi Bruce,

thanks for your very helpful comment on the low level buffer access. However, I still have serious trouble with the buffer management in the IMAQ-1394 2.0 (beta) driver. Would you, pleace, have a look on

http://forums.ni.com/ni/board/message?board.id=170&message.id=114473

?

It seems as if the actual number of buffers allocated by IMAQ1394 configure acquisition.vi was exactly half of the number which has been wired to the vi -- for whatever (stupid?) reason I don't know.

I am forced to go into detail that much because it appears that in my application the driver is mixing up images, losing some or acquiring the same image twice under conditions which I was not able to clarify yet.

Thankful for any further hint,
Peter
0 Kudos
Message 7 of 7
(3,978 Views)