Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Matlab can't see my NI-IMAQ PCI/PXI - 1428.

Hello all,
 
I am currently working on a project that requires the capture of a image from a wall and for it to be processed in matlab.  I have a IMAQ PCI - 1428 device installed on my pc with a Pulnix TM - 1400 CL camera.
 
When I use the following code in matlab:
 
winvideoinfo = imaqhwinfo('winvideo')
 
it returns the following results.
 
winvideoinfo =
       AdaptorDllName: 'C:\MATLAB7\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll'
    AdaptorDllVersion: '1.8 (R14SP2)'
          AdaptorName: 'winvideo'
            DeviceIDs: {1x0 cell}
           DeviceInfo: [1x0 struct]
 
If I'm not mistaken, this means matlab doesn't see my device correct?
 
However, if i use the MAX software, I can use the camera just fine, which tells me that my devices are properly installed. 
 
Any help on this matter is greatly appreciated. 
 
Thanks much in advance
 
Richard
0 Kudos
Message 1 of 9
(6,617 Views)
Hello Richard,
The fact that you are able to acquire an image fine within Measurement and Automation Explorer (MAX) means that your hardware works fine and that the NI-IMAQ driver also works correctly.
 
I do not know precisely how to acquire that image into MATLAB.  It is my understanding that the image acquisition toolkit, if that is what you are using, provided for MATLAB does not directly support NI hardware.  You may need to make calls to the IMAQ library using C function calls to acquire the images.  There are help files for making C function calls to the IMAQ driver.  I suggest contacting The Mathworks for more help with using MATLAB to make C function calls if needed.
 
For the sake of ease in processing you could also consider our Vision Development Module, which includes many image processing functions and can be used in multiple programming environments, including LabVIEW, C and Visual Basic.
 
If you have any more questions that I can help with please let me know.
 
Regards,
Angela
Applications Engineer
Message 2 of 9
(6,605 Views)
Richard


  Were you able to fix this problem. I am also dealing with it and there is no much documentation neither in NI nor in Mathworks.

Thanks

JC
0 Kudos
Message 3 of 9
(6,466 Views)
we wrote a c dll that is easily called in matlab and returns a double vector with the image data.
0 Kudos
Message 4 of 9
(6,393 Views)

Hi Richard,

As of Image Acquisition Toolbox 3.0 (R2007b), the PCI-1428 is supported through the 'ni' adaptor (rather than the 'winvideo' adaptor):

http://www.mathworks.com/access/helpdesk/help/toolbox/imaq/rn/bq__ro8.html

Mark Jones

Software Engineer

The MathWorks, Inc.

 

Message 5 of 9
(5,933 Views)
Hello Adam. You said that you had written a C dll that can be called in MATLAB. Can you give more details about it. Thank you
0 Kudos
Message 6 of 9
(5,817 Views)

Adam, could you give the C dll that you wrote as I need to interface with an ORCA-ER (IEEE 1394) camera using Matlab and I thought your dll would be helpful.

Thank you

0 Kudos
Message 7 of 9
(5,385 Views)
long _stdcall imagetest( int channel,double * Buffer)
{
//declare variables
INTERFACE_ID iid;
SESSION_ID sid;
uInt8* ImaqBuffer=NULL; //NI-IMAQ image
long x =0;
long error;

//Initialize interface and session
char    interfacename[64]="img0";
imgInterfaceOpen (interfacename, &iid);
imgSessionOpen (iid, &sid);
imgSetAttribute (sid, IMG_ATTR_CHANNEL, channel);////// change the channel
error=imgSnap (sid, (void **)&ImaqBuffer); //NI-IMAQ function
//convert to double for matlab
for(x=0;x<(648*480);x++)
{
    Buffer[x]=*ImaqBuffer++;
}
 
if(sid)
        imgClose (sid, TRUE);

if(iid)
        imgClose (iid, TRUE);
return error;
}
0 Kudos
Message 8 of 9
(5,369 Views)

Hi ellas,

 

The Hamamatsu ORCA-ER is also supported by the Image Acquisition Toolbox.

 

Mark

 

0 Kudos
Message 9 of 9
(5,364 Views)