Benchtop Measurement and Test
Distributed Measurement and Control
Systems Engineering Software
Perspectives showcases how NI sees what’s next in the world of test and technology.
You can request repair, RMA, schedule calibration, or get technical support. A valid service agreement may be required.
Provides support for NI data acquisition and signal conditioning devices.
Provides support for Ethernet, GPIB, serial, USB, and other types of instruments.
Provides support for NI GPIB controllers and NI embedded controllers with GPIB ports.
unsigned int bitsPerPixel, plotFlag;
if (imgInterfaceOpen("img0", &interfaceID) == IMG_ERR_GOOD) // "img0" is interfacename, opens an interface named img0
std::cout << "Interface is open" << std::endl;
if (imgSessionOpen(interfaceID, &sessionID) == IMG_ERR_GOOD)
std::cout << "Session is open" << std::endl;
// 30 sept 2021: try GRAB
// 1. imgInterfaceOpen (DONE)
// 2. imgSessionOpen (DONE)
// 3. imgGrabSetup (DONE)
// 4. imgSessionStartAcquisition (DONE)
// 5. imgGrab (DONE)
// 6. User specific functions
// 7. imgSessionStop Acquisition (DONE)
// 8. imgClose (DONE)
imgGrabSetup(sessionID, TRUE); //manually start acquisition with imgSessionStartAcquisition
//5. imgGrab (sessionID, buffer address, uint32 waitForNext)
imgGrab(sessionID, NULL, TRUE);
//6. imgSessionSaveBufferEx to save a buffer of a session to PNG
imgSessionSaveBufferEx(sessionID, NULL, reinterpret_cast<Int8*>(const_cast<char*>("test.png")));
std::cout << "Image saved" << std::endl;
//7. imgSessionStop Acquisition
std::cout << "Stop acquisition" << std::endl;
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
std::cout << "Interface is closed" << std::endl;
I have a frame grabber PCIe-1437. I used to work with it using LABVIEW but now I'm trying to work with it using C++.
I'm exploring the function imgGrab() and I'm trying to see what kind of output I would get by obtaining a PNG file with imgSessionSaveBufferEx().
According to the NI-IMAQ function reference manual, I should get a PNG file. However, no such file was produced.
Also, my end goal is to produce an interference signal shown below.
Hence, my enquiries are these:
1. Did I misunderstand about how to implement imgGrab() and imgSessionSaveBufferEx() ?
2. Is there any advice on how can I achieve my goal?
What do you need our team of experts to assist you with?
We'll be in touch soon!