Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Queston on DAQ using Visual C++

I'm new to DAQ programming. I want to use Visual C++ 6.0 to do data
acquisiton on DAQ card. I can find some examples in NI's package. Although
the examples are said to be VC++ examples, but they are really C style
example, not C++. Does anybody here know where I can get some examples
which use VC++ (using classes, functions etc.). It would be of help if
there are separate functions like
initialization()
acquisiton()
finalise()
in the example.

Thank you so much.
0 Kudos
Message 1 of 8
(3,650 Views)
Hello,

I guess we ship the C style examples so that customers using either C or C++ can both use them. I suppose you could put these into a class yourself, but is it that you are really looking for higher level functions? Here is a link to a good Knowledge Base that might answer some of your questions. Programming DAQ in Visual C++ 6.0 Our new DAQmx API is very easy to use compared to the Traditional NI-DAQ API.

I hope this helps!

Russell
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 8
(3,650 Views)
HI

I went through these C code examples and in all the programs there are functions like NIDAQErrorHandler,NIDAQPlotWaveform. Wat exactly are these functions and how are they embedded in the program.I am planning to write the same kind of C code for my application.Where can i get more information on more functions like this and how to use them?Is it a good idea to write application in C using Traditional NI-DAQ? because I am using NI-DAQ-16E-4 PCMCIA card and i think DAQmx doesnt support this card.

Thanks
0 Kudos
Message 3 of 8
(3,650 Views)
Good questions,

1) Those functions that start with NIDAQ... are not really part of the NI-DAQ dll. They are just supporting functions to provide a means of error handling and data plotting, etc. So they are just there to help demonstrate functionality. We don't have any documentation or support on these functions since it is assumed you will have your own means of error handling, plotting data, etc...

2) The best ADE to use is LabVIEW. It's easy to use, there's plenty of examples, quick to develop and quick to learn. Many people have also used Traditional NI-DAQ in C. LabWindows/CVI for example. There is certainly nothing wrong with this either.

3) Many people are unaware, but you can actually use PCMCIA DAQ boards with DAQmx, bu
t as of now you have to download an add-on dll. (This will be included directly in the NI DAQmx driver very soon.) Unfortunately, it is only for certain DAQCards and I don't think the DAQCard-AI-16E-4 is one of them. See KB 2XM6TEB9: NI-DAQmx 7.0 Support for PCMCIA DAQCards.
0 Kudos
Message 4 of 8
(3,650 Views)
Thanks.

1) Is there any code available to show how these error handling functions are written??As I am new to DAQ Programming I am not sure how should I write my own error handling functions.If you can throw some more light on that I would apprciate it.

2)I am not sure what kind of advantages DAQmx will provide over traditional NIDAQ and wat kind of functionalities will be added if i stall this file?

Thanks
0 Kudos
Message 5 of 8
(3,650 Views)
Thanks, Russell. I walked through an example in DAQmx and feel it's better
and easier than that in old DAQ. good job and thanks again.

"Russell" wrote in message
news:50650000000500000035230100-1042324653000@exchange.ni.com...
> Hello,
>
> I guess we ship the C style examples so that customers using either C
> or C++ can both use them. I suppose you could put these into a class
> yourself, but is it that you are really looking for higher level
> functions? Here is a link to a good Knowledge Base that might answer
> some of your questions.
>
href="http://digital.ni.com/public.nsf/websearch/0087C1E20920F7B986256D9B006
1DEE2?OpenDocument">Pro...
Our new DAQmx API is very easy to use
> compared to the Traditio
nal NI-DAQ API.
>
> I hope this helps!
>
> Russell
> Applications Engineer
> National Instruments
> http://www.ni.com/support
0 Kudos
Message 6 of 8
(3,650 Views)
1) Each NI-DAQ function will return an integer. If the integer is 0, then no error occurred. If the integer is negative, the function returned an error. Positive numbers are warnings. The NI-DAQ Function Reference Help file contains a list of error code descriptions. The error handler function used in the examples matches the error codes with these explanations and displays them in a popup box. Many programmers prefer to have error descriptions that are related more to the application they are developing. However, you can still use the NIDAQErrorHandler that the examples use if you want, we just don't document it.

2) DAQmx has advantages over Traditional NI-DAQ in several areas. See KnowledgeBase 2XBDKM7V: What is NI-DAQ 7.0? Overall, it is much easier to use and learn than Traditional NI-DAQ. It exceeds Traditional NI-DAQ in performance and is much more flexible than Traditional NI-DAQ. (It's not simply higher level functions built on top of Traditional NI-DAQ. It's a completely new driver.) Basic as well as advanced applications are much easier to develop in DAQmx. If you are new to DAQ, I would especially recommend learning DAQmx instead of Traditional NI-DAQ. Unfortunately, I just noticed from the README that the DAQCard-AI-16E-4 will not be supported by DAQmx at all. (Sorry to build things up so much.) So I suppose you will need to use Traditional DAQ afterall as long as you're using the DAQCard-AI-16E-4. You could, however, use DAQmx if you switched to one of the DAQCards listed in the KB above in the thread I suppose.

-Russell
0 Kudos
Message 7 of 8
(3,650 Views)
Hi

Thanks for the information.I tried to install the NI-DAQ mx and it gave me the message that you dont have CVI or Labview on your computer so that way also i couldnot install it.

But anyway.Thanks
0 Kudos
Message 8 of 8
(3,650 Views)