Hi,
I have some query on InstallCallback function(C Programming function) for the NI-IMAQ 1394 v2.0. Just want to ensure my understanding is correct and at the same time gain some insights into the grabbing process. I have written the following code:
In main code:
imaq1394InstallCallback(Sid, IMG1394_EVENT_FRAME_DONE, (IMAQ1394_CALL_BACK_PTR)GrabCallback, NULL);
imaq1394ConfigureAcquisition(Sid, TRUE ,10, rectangle);
imaq1394StartAcquisition (Sid);
In the function GrabCallback
uInt32 NI_FUNCC GrabCallback(SESSION_ID Sid, uInt32 event, int error, uInt32 cumulBufferIndex, void* userdata){
............
imaq1394GetBuffer2(Sid, IMG1394_LASTBUFFER, &bufferNumber, IMG1394_ONOVERWRITE_FAIL,(void **)&ImaqBuffer)
}
Here are my query:
1) The function GrabCallback will be called each time when a frame is completed right?
2) The setting of the buffer in ComfigureAcquisition is device buffer right? So is the writing of frames to this buffer is in the order of 0,1,2...9 then 0,1,2...9 again as long as the Grabbing process is ongoing?
3) Regarding about the IMG_LASTBUFFER attributes, should it be the previous buffer instead of next buffer as stated in the manual? I assume the buffer they are talking about is the device buffer and ImaqBuffer is the buffer to hold the acquired buffer in the camera
4) Just a query on synchronisation, is the calling of GrabCallback is in parallel with the grabbing acquisition? ie the two process GRabCallback and camera grabbing is ongoing concurrently?
Thanks for your help!