PDA

View Full Version : Trigger Polarity



ruicosta
June 13, 2006, 16:37:32
Hello,

I would like to configure the trigger polarity manually.
I have configure the Exposure as followed, but i donĀ“t now how to configure the trigger polarity. I have try to configure the polarity in the same way, but it donĀ“t work. Can you help me ?

IĀ“m using the "IC Imaging Control 2.1" with "DFx 21BF04".


code:
__________________________________________________ ______________

CSimplePropertyAccess m_VCDProp;


m_VCDProp.init( pGrabber->getAvailableVCDProperties() );

//Configure Exposure
m_VCDProp1.setAuto(DShowLib::VCDID_Exposure, FALSE);
m_VCDProp1.setValue( DShowLib::VCDID_Exposure, value);
__________________________________________________ _______


Best regards
Rui Costa

Stefan Geissler
June 13, 2006, 17:09:47
Hi Rui,

The polarity can be handled in the same way like exposure. The definition of the Guid is in the file "VCDPropertyIdTIS.h". The property ID is:

VCDElement_TriggerPolarity


m_VCDProp1.setValue( DShowLib::VCDElement_TriggerPolarity, 0);

or


m_VCDProp1.setValue( DShowLib::VCDElement_TriggerPolarity, 1);


shoul work.

ruicosta
June 13, 2006, 20:00:30
Hello Again,

The trigger continuos to not work has expected. I have 2 fires, one on rising edge and other
on falling edge. I just want one fire on rising edge.
I have the follwing code:

code:
__________________________________
CSimplePropertyAccess m_VCDProp;

m_VCDProp.init(pGrabber->getAvailableVCDProperties() );

m_VCDProp.setValue( DShowLib::VCDElement_TriggerPolarity, 0); //or 1
m_VCDProp.setValue(DShowLib::VCDElement_TriggerMod e , 0 );
__________________________________

I have tested the example "DemoApp" and the trigger works has I expected (just 1 fire) when
I check the fields "trigger Enable" and "Polarity" at Devices properties Dialog. If I uncheck
the polarity, I have 2 fires.
It seems that my problem is the polarity.

What kind of property is configure when I check/Uncheck the "Polarity" field at Properties Dialog ?
What I'm forgetting or doing wrong ?


Best regards
Rui Costa

Stefan Geissler
June 15, 2006, 11:35:36
Hello Rui,

Please excuse me, i gave the wrong hint in my last post. First of all, it seems, that the trigger polarity can not be set with the SimplePropertyaccess class, because there is a GUID missing. Thus you can insert following code in your program to set the trigger polarity:



void SetPolarity(DShowLib::Grabber *pGrabber, bool bPositive)
{
DShowLib::tIVCDSwitchPropertyPtr pTriggerPolarity;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
if( pItems != 0 )
{
tIVCDPropertyItemPtr pTriggerItem = pItems->findItem( VCDID_TriggerMode );
if( pTriggerItem != NULL)
{
tIVCDPropertyElementPtr pPolarityValueElement = pTriggerItem->findElement( VCDElement_TriggerPolarity );

if( pPolarityValueElement != NULL )
{
pPolarityValueElement->getInterfacePtr(pTriggerPolarity);
pTriggerPolarity->setSwitch(bPositive);
}
}
}
}


If the parameter "bPositive" is true, then the camera reacts on a rising edge. If it is false, the camera reacts on the falling edge.

ruicosta
June 16, 2006, 20:52:20
Thanks Stefan,
now it works.


I have another question:

I have tested the example "DemoApp" from "IC Imaging Control 2.0/2.1/3.0" and I
have verify that if the "trigger" and "polarity" is checked at "Devices properties Dialog"
on version 2.0 and 2.1 the first fire of the trigger donā€™t show any image. But at version
3.0 the first fire is not lost, and works fine.

Why this happen?
What configuration should I do to get the first fire of the trigger on version 2.1 ?

Best regards
Rui Costa

Stefan Geissler
June 28, 2006, 17:14:06
Hello Rui,

Please excuse the long delay of my answer, but the problem was hard to catch. The lost first trigger is caused in the current firmware version of the camera. It occurs, if the external is enabled before the camera has delivered an image. You may work around this problem, if you start and stop the camera just after you have opened it and before you enable the trigger. After this you enable the trigger and start the camera again.

You may send a request to support@imagingcontrol.com. I will send you a firmware update as soon as it is available. The firmwareupdate software runs only with Windows XP.