PDA

View Full Version : External Trigger



drgolf
September 29, 2010, 17:29:20
I'm using the code below to grab images from the camera.
The first time I trigger the camera --> it doesn't return an image.
However, sebsequent triggers work.
Any ideas as to what might be causing this?



bool CCameraDLL::Initialize()
{
cout << "Initialing......\n";

result = DShowLib::InitLibrary("--------");
if (result == false)
{
printf("FAILED\n");
cin.get();
}

grabber.openDev(" ------");
grabber.setVideoFormat("Y800 (640x480)");

pSink = FrameHandlerSink::create( eY800, 1 );

pSink->setSnapMode( true );
grabber.setSinkType( pSink );

tIVCDPropertyItemsPtr pItems = grabber.getAvailableVCDProperties();
tIVCDRangePropertyPtr pRange;
pItems->findInterfacePtr(VCDID_Gain,VCDElement_Value,pRang e);
long pMax;
long pMin;
pRange->get_RangeMax(&pMax);
pRange->get_RangeMin(&pMin);
pRange->setValue(gain); // 4 to 31

pItems->findInterfacePtr(VCDID_Exposure,VCDElement_Value,p Range);
pRange->get_RangeMax(&pMax);
pRange->get_RangeMin(&pMin);
pRange->setValue(exposure); // -2 to -13

result = grabber.prepareLive( false ); // this allows getting info
if (result == false)
{
printf("FAILED\n");
cin.get();
}

pSink->getOutputFrameType( info );
pBuf = new BYTE[info.buffersize];

result = grabber.setExternalTrigger(true);
grabber.startLive();

Sleep(1000);
cout << "Done\n\n";

return true;
}

bool CCameraDLL::GetBuffer()
{
pSink->snapImages(1);
pBuf = (BYTE*)pSink->getLastAcqMemBuffer()->getPtr();

return true;
}

Stefan Geissler
September 30, 2010, 14:29:06
Hello Dr. Golf,

Please let me know, which camera model you use. Also the serial number is helpful.

Thank you in advance.

drgolf
October 2, 2010, 15:51:23
It's a Dmx 72BUC02 -- serial # 22010188
THANKS

Stefan Geissler
October 4, 2010, 09:31:44
Hello,

I checked with my camera and found no problem. However, my cameras uses firmware v 88 and your's uses v 85. I suggest a firmware update. Please generate a support case at http://www.imagingcontrol.com/en_US/support/case/ thus I can send you the firmware update.