Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

1428 imgPulseCreate (C code) pulse not generated

Hi,

I need to trigger an event on an IMU (Applanix) when a frame is acquired. To do this I wrote the following test code, independent of photo acquisition, just to see if I could manipulate Pulses and related triggering functionnality from my 1428 board and the attached D6804 cable. The code is called in that sequence whenever a pulse is required :

createPulse();
startPulse();
disposePulse();

the code is :

static PULSE_ID pulseId1;
SESSION_ID Sid = 0;
INTERFACE_ID Iid = 0;

int initSession(IMG0)
{
long error;

error = imgInterfaceOpen (IMG0, &Iid);
if(error < 0) DisplayIMAQError(error);

error = imgSessionOpen (Iid, &Sid);
if(error < 0) DisplayIMAQError(error);

return 1;
}

int createPulse()
{
unsigned long realDelay, realWidth, timebase;
int error;

// Délay de 5 ms (5000 micro secs), width 5 ms
error = imgPulseRate(5000, 5000, &realDelay, &realWidth, &timebase);
if(error < 0) DisplayIMAQError(error);

// Trigger IMU on TRIG0
error = imgPulseCreate(timebase, realDelay, realWidth, IMG_IMMEDIATE, 0, IMG_EXT_TRIG0, IMG_PULSE_POLAR_ACTIVEH, PULSE_MODE_SINGLE, &pulseId1);

if(error < 0) DisplayIMAQError(error);

return 1;
}

int startPulse()
{
int error;

error = imgPulseStart(pulseId1, Sid);
if(error < 0) DisplayIMAQError(error);

return 1;
}

int disposePulse()
{
int error;

imgPulseStop(pulseId1);

error = imgPulseDispose(pulseId1);
if(error < 0) DisplayIMAQError(error);

return 1;
}

The signal does not seem to be generated... I have installed the latest IMAQ driver (3.1) yesterday. Images were captured using MAX following the installation of the new driver. By this I assume that the new driver is correctly installed.

When the imgPulseRate(5000, 5000, &realDelay, &realWidth, &timebase); function is called, realDelay and realWidth are 500000000, timebase is 3. No call report failure, but the trigger is not seens on my Applanix (nor a camera on which I did the test also). I tried both possible settings for IMG_PULSE_POLAR_ACTIVEH (H/L) and various widths but the pulse appears not to be generated. I also tried to trigger a MS3100 DuncanTech camera with the same results. Everything seems to be correctly set on my camera and IMU versus IMAQ but there is no response from the trigger on both equipment.

I have also connected a pocket size multemeter (voltmeter) to the end of the coaxial cable (TRIG0) but the voltmeter does not show any change upon triggering (pulse). Could it be (a $30 multemeter) not sensitive enough ..?

Any idea where something may be set wrong or if you have had similar problems, would be appreciated.

thanks,
Best regards,
André Bombardier
0 Kudos
Message 1 of 2
(3,077 Views)
Hello all,

ok... found the problem. There was a bad connexion problem. The Applanix responds correctly to the pulse. The code works.


A. Bombardier
0 Kudos
Message 2 of 2
(3,071 Views)