I have an IMAQ PCI-1411 and the Vision software/driver suite. I am
attempting to write a C program using .NET 2003 and the Labwindows/CVI
functions provided to acquire an image. I have written some test code
around the imaqEasyAcquire as a sanity test before diving into image
analysis. The code I have written is as follows:
#include <stdio.h>
#include <conio.h>
#include "nivision.h"
int ErrorCode;
int borderSize;
Image* image = NULL;
void main()
{
borderSize = 0;
image = imaqCreateImage(IMAQ_IMAGE_HSL,borderSize);
if ( image == NULL )
{
ErrorCode = imaqGetLastError();
printf("Error: NULL Returned\n");
printf("Errorcode = %i\n",ErrorCode);
}
printf("Press Enter to Test imaqEasyAcquire\n");
getch();
image = imaqEasyAcquire("img0");
if ( image == NULL )
{
ErrorCode = imaqGetLastError();
printf("Error: NULL Returned\n");
printf("Errorcode = %i\n",ErrorCode);
}
else
printf("Test Complete\n");
ErrorCode = imaqDispose(image);
if ( ErrorCode == 0 )
{
ErrorCode = imaqGetLastError();
printf("Error: Image could not be dumped.\n");
printf("Errorcode = %i\n",ErrorCode);
}
getch();
}
This compiles fine but the program crashes on execution of the line
"image = imaqCreateImage(IMAQ_IMAGE_HSL,borderSize);"
The error message tells me that it "Could not load type Image_struct
from assembly." Image_struct is not defined in the header "nivision.h,"
so I see why this problem occurs.
Can anyone tell me where "Image_struct" is defined? Or, if I am on the
wrong track entirely, let me know. I'm a mechanical engineer and my
programming skills are shaky outside of Matlab and Motorola Assembly,
so don't hesitate to give me an obvious/condescending answer.