Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed issues with PCI1422?

Hello everyone,

 

First of all, thank you for deciding to read my post!

 

I am having problems with acquiring images at fast frame rates. I am using a hamamatsu camera (ORCA-ER), PCI1422 gramegrabber card and LabWindows/CVI 7.1 for software.

 

The objective is to acquire images in triggered mode. Specifically we send a pair of pulses to start and stop the acquisition of an image and we do this repetitively.

 

I give below the code segment for the acquisition step. The code was written many years ago by someone else in the group. I was unable to find any documentation for how this code was developed.

 

For (i=1; i<=totalNumImages;i++)
{
//STEP 1 Start acquisition:
returnStatus1 = imgSessionAcquire( Sid, TRUE, NULL);
 
//STEP 2: send the start pulse:
returnStatus2 = imgSessionTriggerDrive2(Sid, IMG_SIGNAL_EXTERNAL, 1, IMG_TRIG_POLAR_ACTIVEL, IMG_TRIG_DRIVE_ASSERTED);
// Start the timer to measure the time elapsed
t1 = Timer(); 
flag = 1;
while (flag)
     {
      if (Timer() - t1 >=ExposureTime)
           {
           //STEP 3: send the stop pulse:
           returnStatus3 =  imgSessionTriggerDrive2(Sid, IMG_SIGNAL_EXTERNAL, 1, IMG_TRIG_POLAR_ACTIVEL, IMG_TRIG_DRIVE_UNASSERTED);
           flag =0;
         }
    }
   
//STEP 4 OPTIONAL: introduce a delay/sleep
Sleep(25);
 
//STEP 5: Poll for new data/buffer:
returnStatus4 = imgSessionStatus(Sid, &status, &buf_num);
while(status) {
 returnStatus5 = imgSessionStatus(Sid, &status, &buf_num);
 }
 
//STEP 6: Copy data from IMAQ buffer to an image Array:
memcpy(imageArray, IMAGBuffer,imgSize);
}

 

The problem that I have is that for exposure times >= 150 msec (image size = 128x128), the code runs fine. However, if I reduce the exposure time below 120 msec, then the code gets stuck inside the while loop in Step 5. For these exposure times I have noticed that code successfully acquires the first image, but gets stuck in the while loop in STEP 5 for the second image. Introducing a delay in step 4 avoids this problem, but this compromises my acqusition speed.

 

The value of the returnStatus variables is zero in all cases (including the case when the code get stuck inside the while looop).

 

I noticed that the commands that I am using to send the trigger pulses and to poll for the availability of new data are high-level commands. Therefore I was wondering whether there are any speed issues related to these commands or is this a problem with my framegrabber board?

 

As I am not sure if the problem that I am experiencing is software/code related or hardware (framegrabber) related .  Therefore this query has also been posted in the LabWindows/CVI forum.

 

I welcome all suggestions and comments.

 

Thank you very much for reading my post.

 

Sripad

 

0 Kudos
Message 1 of 4
(3,666 Views)

consider also posting to the Machine Vision Forum so that others that use the image acq products more will see this post.

 

-gaving

0 Kudos
Message 2 of 4
(3,634 Views)

Thanks for the tip. Will do it!

 

 

0 Kudos
Message 3 of 4
(3,625 Views)

Please see active thread on identical post here.

 

Thanks!

0 Kudos
Message 4 of 4
(3,603 Views)