I am trying to code in C++ to run and obtain images from it.
The following code was referenced and written from the NI-IMAQ Help manual.
int main()
{
INTERFACE_ID interfaceID;
SESSION_ID sessionID;
if (imgInterfaceOpen("img0", &interfaceID) == IMG_ERR_GOOD) // "img0" is interfacename
{
std::cout << "Interface is open" << std::endl;
if (imgSessionOpen(interfaceID, &sessionID) == IMG_ERR_GOOD)
{
std::cout << "Session is open" << std::endl
imgGrabSetup(sessionID, TRUE); //manually start acquisition with imgSessionStartAcquisition
imgSessionStartAcquisition(sessionID);
imgGrab(sessionID, NULL, TRUE);
imgSessionStopAcquisition(sessionID);
imgClose(sessionID, FALSE); // closes the session using the imgClose function
std::cout << "Session is closed" << std::endl;
}
imgClose(interfaceID, FALSE); // closes the interface using the imgClose function
}
}
My enquiries are these:
- Have I correctly understood/implemented the steps?
- How do I go about visualising the image? Possibly using imgPlot?
My end goal is to obtain an interference signal from the frame grabber.