10-19-2012 03:31 PM
Hello,
I am new to using the NI DAQ board and NIDAQmx. I am trying to figure out the best way to capture analog DC voltage input values from my function generator on multiple channels, display them in real time, and also stream them to disk. Could someone please provide some pointers on this? The documentation seems to indicate that I need to capture the values as single samples but there are no examples.
Thanks,
-brian
10-23-2012 08:43 AM
Hello Brianbat,
When you install DAQmx, you can add support for text base languages. If so, you should have a folder of examples for C++ using the DAQmx API. Navigate to All Programs>>National Instruments>>NI-DAQ>>Text Base Code Support>>ANSI C. Take a look at the example: Analog In>>Measure Voltage>>TDMS-Cont Acq-Int Clk for a continuous analog input acquisition and logging to a TDMS file.
Best Regards,
Alina M
Applications Engineering
National Instruments
10-24-2012 11:16 AM
Hello Alina M.
Thanks for responding. Unfortunately I don't see an option to add Text-Based Code Support when installing NI-DAQmx. What version is that option in? I am currently using version 9.6.
Thanks,
-brian
10-25-2012 11:09 AM
Hello Brianbat,
Go to the Control Panel>>Programs and Features, browse for National Instruments Software and click Uninstall or Change. Browse for DAQmx and click Modify. It will open the NI-DAQmx 9.6 driver wizard, expand NI DAQmx 9.6>>Application Development Support and you will see the options for text base support, change the ones you need. Take a look at KB How Do I Install Examples for Visual Basic, Visual C++, and Delphi with NI-DAQ?.
Best Regards,
Alina M
Applications Engineering
National Instruments
07-29-2013 01:53 AM
Dear Alina,
i wrote a program in VC++ which acquires some analog voltage channels using NIDAQmx. By means of the "DAQmxCreateAIVoltageChan()" function it works properly, but I've faced a question:
When I measure a sine wave as a input channel whith diffrential terminals (pins) on NI-Device, there is no problem but if I connect the input signal in single ended form (connect input signal to each single terminal and connect GND of NI-Device and Signal generator together), there is a irrigular and alternative offset (DC value) in aqcuiered data that shows there is an error in connection of GND's. (I'm sure about function generators)
Is there any specific function to assign exactly that input data should be measured in differential or single ended form? I mean, should I write seperate codes in C++, if I want to measure input signal in both forms of differential and single ended or does the mentioned function satisfy both needs (if so wherefrom does this fault emerge)?
Thanks a lot for your helpfully replies in advance,
yours,
Mohammad
07-30-2013 04:59 PM
Hi Harati,
The mentioned function should have a parameter to specify Terminal Configuration. The full function prototype is below:
DAQmxCreateAIVoltageChan (Task Handle, Physical Channel, Name to Assign to Channel, DAQmx_Val_RSE, Min value, Max Value, DAQmx_Val_Volts, Custom Scale Name);
So if i wanted to configure cDAQ1Mod1/ai0 channel for "MyTask" handle and I was using a RSE terminal configuration on a 0 - 5 Volt range, it would be configured like so:
DAQmxCreateAIVoltageChan (MyTask, cDAQ1Mod1/ai0, "", DAQmx_Val_RSE, 0, 5, DAQmx_Val_Volts, "");
Hope this helps
08-26-2013 01:59 AM