Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

interface hardware data acquisition with vilsua C++

Hi,
I'm new to use NI hw. I need to know if i can use Visual C++ (MFC) to interface to NI data acquisition board using only Ni-DAQmx (if supported by DAQ hw).
Can i use some kind of callback method to accumultate data in double-buffer (ping-pong buffer)?

Thanks in advace.
0 Kudos
Message 1 of 5
(3,680 Views)
Hi,
When you talk about Visual C++ are you referring to VStudio 6.0 or .NET?
Anyways, when you install NI-DAQ 7.x (Version 7.4 is the latest one available) you should find a set of examples installed on your machine under
...\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\ that can be a good starting point for your applications.
If you can't find these examples it might be that you need to restart the installation of the driver and make sure you select support for Visual C++.

Regards,
AlessioD
0 Kudos
Message 2 of 5
(3,666 Views)
Thanks a lot.

I refer to Visual C++ 6.0 or Visual C++ 7.0 (MFC - unmanaged C++).
0 Kudos
Message 3 of 5
(3,655 Views)
THe application you describe is a good place to use the new DAQmx events feature, recently added for NI-DAQ 7.4. There is an analog input events example (Events\Every N Samples\Cont Acq-Int Clk-Every N Samples Event) that will show you how to use the C API to configure events.

When using MFC, you can take advantage of the DAQmx_Val_SynchronousEventCallbacks flag in the "options" parameter of the DAQmxRegisterEveryNSamplesEvent function (this option is not used in the example). This will cause your callback to be called in the same thread that registered the events. If this is the same thread as your window's message pump thread, this will keep you from having to post messages back to your main window. If you don't use the DAQmx_Val_SynchronousEventCallbacks option, your callback will be called in a separate, DAQmx-created thread.

--Joe
0 Kudos
Message 4 of 5
(3,645 Views)

Hi,

Do you have an example program about DAQmx device used MFC (Visual C++).

I try to find an example but don't have any example in Forum.

Thank you!

0 Kudos
Message 5 of 5
(2,793 Views)