Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

VB6 6009

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

0 Kudos
Message 1 of 14
(4,998 Views)
See whether this or this will help
Message Edited by muks on 03-16-2010 03:15 PM
0 Kudos
Message 2 of 14
(4,984 Views)

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

0 Kudos
Message 3 of 14
(4,971 Views)

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.

 Text based support.PNG

 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.

Matt
Applications Engineer
National Instruments
Message 4 of 14
(4,949 Views)

Thanks a lot Matt!  I found the examples.

 

Pei

0 Kudos
Message 5 of 14
(4,943 Views)

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

0 Kudos
Message 6 of 14
(4,924 Views)

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.

Matt
Applications Engineer
National Instruments
0 Kudos
Message 7 of 14
(4,897 Views)

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

0 Kudos
Message 8 of 14
(4,887 Views)
DAQmxReadAnalog1ChNsamplesdbl

"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 14
(4,876 Views)

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

0 Kudos
Message 10 of 14
(4,864 Views)