Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the PCI-1422 card byte-swap the data?

Highlighted
I'm using the PCI-1422 card to acquire 12 bit per pixel intenisty data from an area scan camera.

When I capture the images with LabVIEW & IMAQ 2.5, they look good.

If I use a sample "LLGRAB" program I downloaded from NI.COM, the images are byte-swapped.

I realize LabVIEW uses the "big-endian" format, and the C program is storing the data in "little-endian" format.

I would like to be able to byte-swap the data on the card if possible, when collecting the data with the "C" program, so that the data is always in "big-endian" format regardless of which program I use to collect it.

Any suggestions?
0 Kudos
Message 1 of 3
(2,710 Views)
Highlighted
I think it may be possible to reverse the bytes by modifying the ICD file for your camera.

Make a copy of the ICD file first!!!

I think if you modify the "taps" section, you can reverse the bytes, but I am not sure. NI doesn't like to share information for editing ICD files, so you are on your own. I would look at other ICD files to get an idea of what options are available.

Good luck!!

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(2,710 Views)
Highlighted
Thanks Bruce.

The ICD file was the answer. I copied my ICD file to a new name, and changed LUTTransform to (8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7) and now my data is ordered the way I need it.

Once I did that, I used MAX to create 2 "iid" files - one that uses the byte-swapped icd file, and the other that uses the normal icd file. Now I can select in software whether I want byte-swapped or normal data by selecting the appropriate interface.

I'm capturing 256x256 images, 16 bits per pixel, to disk at over 200 frames per second with the proper byte ordering now. I was only getting about 40 before since I was doing the byte-swap in software.

Thanks again,

Mike Gulley
0 Kudos
Message 3 of 3
(2,710 Views)