Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to replace NIDAQ32.dll with new DAQmx?

Hello,
In Traditional drivers, I used Afxloadlibrary(nidaq32.dll) and used GetProcess to use its functionss. What do I do in NIDAQmx, as I looked into NIDAQmx examples in C, but I couldn't find an equivalent. I know I have to include nidaqmx.lib and nidaqmx.h, Do I need anything as far as DLLs to achieve the same concept?
Thanks
0 Kudos
Message 1 of 6
(7,754 Views)

Hello. 

I believe that all you need to include are the files that you mentioned: nidaqmx.lib and nidaqmc.h.  Is this not working for you?  If so, what error are you getting?  What programming environment and version are you using? 

Let me know and I will be happy to help you further. 

Brian F
Applications Engineer
National Instruments

0 Kudos
Message 2 of 6
(7,736 Views)
Hello Brian,
I am using Visual Studio 2005 (C++). My application crashes during run time after I read data in using NIDAQmx functions. It doesn't crash during Compilation time. I wasn't sure if the crash is due something that has to do with DLL, even though I doubt it. I guess, I could look at the Call Stack window and find out why its crashing.
Thanks
0 Kudos
Message 3 of 6
(7,734 Views)
Hello. 
 
Yes, it would be very odd if the crash was a result of the dll with a simple DAQmx read.  Were you able to find out anything by looking at the Call Stack window?
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(7,684 Views)
It seems to from a non DLL isuue (I think I have a clue to what it is). However, I do wanted to ask you a question about buffering, I am reading times reference values continuously to a time buffer using the ReadCounter NI command, then I flush the whole Buffer on the way out. I am acquiring about 72000 samples into that buffer, becasue I am flushing the buffer all at once, I am assuming that flushing takes time while Ni still trying to write into the buffer. I am not sure how to do house keeping here as in the traditional drivers, I emptied the first half of the buffer wile am in the second half of the buffer. How can i achieve the same concept of maintaining the Buffer ?
Thaks
0 Kudos
Message 5 of 6
(7,682 Views)
Hello. 
 
When doing continuous acquisition, the buffer is automatically created and flushed by DAQmx.  For more information on this, and how to override this functionality, please refer to the following knowledge base:
 
How is the DAQmx Buffer Size Allocated for a Finite or Continuous Acquisition?
http://digital.ni.com/public.nsf/allkb/E1E67695E76BA75B86256DB1004E9B07

Also, since you are used to using Traditional DAQ and are looking to use DAQmx now, I would recommend checking out a wonderful tutorial at:
 
Transitioning from Traditional NI-DAQ (Legacy) to NI-DAQmx Using ANSI C and NI LabWindows™/CVI
 
In part two of this series, it talks about counters and buffers, which should show you (with code examples) how everything should be handled. 
 
Let me know if you have any additional questions on this material!
 
Have a great day!
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(7,657 Views)