03-15-2010 07:46 PM
Hi,
Is there any Visual Basic 6 example for acquiring analog signal using USB-6009? Where can I find them?
Thanks!
Pei-Ying
Pei-Ying.Hsieh@siemens.com
03-16-2010 04:43 AM - edited 03-16-2010 04:45 AM
03-16-2010 08:17 AM
Hi,Muks,
Thanks for the links!
The first link has a labView vi, but, I am looking for a VB6 example. I just want to acquire 2 analog signals (0 - 5 volt) in VB6, and then, save them in VB6 for plotting Excel later.
Pei-Ying
03-16-2010 01:08 PM
Hi Pei,
You can install examples for VB6 when you install the DAQmx driver; select “Custom” as the install type and then navigate to the select Microsoft Visual Basic 6.0 support from Application Development Support.
If DAQmx is already installed you can modify your install through Add-Remove program to include the appropriate ADE support. This will put VB6 examples in the following location:
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples
These examples should help you get going.
03-16-2010 01:29 PM
Thanks a lot Matt! I found the examples.
Pei
03-17-2010 08:09 AM
Hi, Matt,
I am wondering if you can shed some light on my problem.
I have AI0 connected to terminal 2, and AI1 connected to terminal 5. Both in single-ended mode. I then run the VB6 example given in NI-DAQmx as is. I got voltages like 1.1 volt. However, when I use a LB vi to acquire the same 2 channels, I got 2.5 volt (which should be the correct answer). What could be wrong in the VB6 code? Any suggestion?
Thanks!
Pei-Ying
03-18-2010 05:41 PM
Hi Pei,
I believe running the example “as is” will tell the DAQmx driver to choose the default terminal configuration, which is differential for the first four channels of your device. This may be causing the behavior you are seeing. You can test this easily enough by running a test panel in Measurement and Automation explorer and toggling between Differential and RSE.
03-19-2010 09:39 AM
Thanks again, Matt,
I got the RSE vs differential resolved. When can I find more information about acquiring data from AI? for example, I want to collect sample at 2K Hz for 500 ms. In the one sample example, it uses
DAQmxReadAnalogScalarF64, while in the continous sampling example, it uses DAQmxCfgSampClkTiming. Where can I find the command to use for finite sampling (ie, 2K Hz for 500 ms)?
Pei-Ying
03-19-2010 05:34 PM
03-21-2010 06:01 AM
Hi, Jeff,
Thanks!
I have to sample 2 channels at the same time. Is DAQmxReadAnalog1ChNsamplesdbl for just 1 channel?
Also, where can I find all the commands that are available for VB6? So far, I have seen DAQmxReadAnalogScalarF64, DAQmxCfgSampClkTiming, and DAQmxReadAnalog1ChNsamplesdbl. Are there others?
Pei-Ying