Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple CallBack functions

Is it possible to have multiple Callback functions, i.e. to do more than one 'imgSessionWaitSignalAsync2(...)' call With the same session ID?

As it would be e.g. in ...:

 

   void NI_grab::StartGrabNow(bool bMaster)

   {

     bIsMaster = bMaster ;

     iFrameNumber = 0 ;

     iReturnValue1 = imgSessionStartAcquisition(siSessionId) ;

     timeBeginPeriod(1) ;

     iReturnValue1 = imgSessionWaitSignalAsync2(

       siSessionId,

       IMG_SIGNAL_STATUS,

       IMG_FRAME_DONE,

       IMG_SIGNAL_STATE_RISING,

       &xSessionWaitSignalCallbackPadTimeStamp,

       this

     )

     ;

     // The 'xSessionWaitSignalCallbackPadTimeStamp' will put the time stamps in a queue buffer, ...

     iReturnValue2 = imgSessionWaitSignalAsync2(

       siSessionId,

       IMG_SIGNAL_STATUS,

       IMG_BUF_COMPLETE,

       IMG_SIGNAL_STATE_RISING,

       &xSessionWaitSignalCallbackProcessImage,

       this

     )

     ;

     bStoppingAcquisition = bAllGrabbersStoppingAcquisition = false ;

     // ... which is read by 'xSessionWaitSignalCallbackProcessImage', so that the

     // time stamps are padded into the correct images.

     // I consider it fully possible that there are sometimes "two or three" acquired images

     // in the "input FIFO pipes"....

     bInterfaceOK = (iReturnValue == 0) ;

     bAcquisitionRunning = true ;

   }

 

Best regards

Staffan Cronström

0 Kudos
Message 1 of 1
(3,038 Views)