I see now that you are receiving a "First Chance Exception" error from NI-DAQ.
This is a rare error that occurs on some systems, and deals with NI-DAQs memory space. When NI-DAQ loads, it attempts to occupy a specific location in memory. On some systems, Visual C++ and/or Visual Basic will take that memory space (usually due to third-party plug-ins), such that if either environment is open, NI-DAQ cannot initialize properly when called from within the same process. This is why the standalone executable that is run without the Visual C++ or Visual Basic IDEs open will not generate an error.
This error has been fixed in our latest NI-DAQ 7.0 driver. I recommend that you upgrade to our latest driver version to resolve this error.
Rega
rds,
Justin Britten
Applications Engineer
National Instruments