From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't open interface in Visual Stuido

Everytime I use imgInterfaceOpen() function to access my camera,this function will return a negative value,which means I can't access to the camera interface.

Is there anything wrong with my code?

 

BTW:I can access to the camera with example code of IMAQ.

 

 

void AcquireThread::Acquire(void)
{
sprintf_s(intfName, "img0");//img0 Basler///img3 Atmel
imgInterfaceOpen(intfName, &Iid);
imgSessionOpen(Iid, &Sid);
AcqWinWidth = globalOptions->IMAGEWIDTH;
AcqWinHeight = globalOptions->IMAGEHEIGHT;

imgSetAttribute2(Sid, IMG_ATTR_ROI_WIDTH, AcqWinWidth);
imgSetAttribute2(Sid, IMG_ATTR_ROI_HEIGHT, AcqWinHeight);
imgSetCameraAttributeNumeric(Sid, "Exposure Time", 12);

 

....

}

 

 

0 Kudos
Message 1 of 1
(4,258 Views)