02-15-2008 12:13 PM
02-18-2008
06:17 PM
- last edited on
09-30-2025
11:57 AM
by
Content Cleaner
Hi Jason,
Let's see if we can get you up and running. When you install NI-DAQmx, you are given install options such as support for Visual Basic 6.0. This will install examples to your hard drive that you can find in the default location of C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\Visual Basic 6.0. If you don't see these files, go into Add/Remove Programs in your control panel and edit your National Instruments installation of NI-DAQmx.
In here you should be able to find many different examples dealing with analog I/O, digital I/O and triggers. Also, I've added some links that can help you out dealing with DAQmx and VB6.
Getting Started with NI-DAQmx: Main Page
KB 41P6PDLA: NI-DAQmx Examples for Visual Basic 6.0
KB 3146J6FQ: Programming DAQ in Visual Basic 6.0
02-21-2008 07:45 PM
Thanks. Managed to find the samples but still have some queries regarding running multiple task and multiple channel in VB6.
Below are some of the doubt that I have:
1) Is it possible to create and start more than 1 task, for example 4 task with different measurement channel like digital input, output, analog input and output together?
2) Or just 1 task to handle the different measurement channel as mentioned above?
3) Or is it faster to start stop individual task when required?
Pls help asap, thanks.
02-22-2008
09:19 AM
- last edited on
09-30-2025
11:57 AM
by
Content Cleaner
Hi Jason,
A single DAQ board can run one task at a time. That task can contain mulitple channels of varying type but you can not have multiple timing engines. So the answer to your question is #2. Try looking through the Getting Started With DAQmx tutorials and you will gain a better understanding of how to program with DAQmx. There are quite a bit of examples and also some very useful information in there. For example, this is one of my favorite pages: Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
02-22-2008 08:59 PM
02-25-2008
05:15 PM
- last edited on
09-30-2025
11:58 AM
by
Content Cleaner
It is straightforward to create a multiple channel task. For example, the Acq-Int Clk.frm example to measure analog inputs contains the function : DAQmxCreateAIVoltageChan. This function is used to configure the analog inputs. To read from more than one channel all you need to do is specify the range of channels you want to read instead of a single channel. The second input to this function is “physicalChannel.” Either hard coded or in the user interface you can enter Dev0/ai0 to read from one channel or Dev0/ai0:4 to read from channels 0 – 4. It is as simple as that. The “data” read back will now be a multi-dimensioned array with the various channels.
All of this information can be found in the help files Start >> Programs >>National Instruments >> NI-DAQ >> NI-DAQmx C API Visual Basic 6.0 Help c and the NI-DAQmx C Reference help. The NI-DAQmx C functions and Visual Basic 6.0 functions are basically the same.
You might also look for at the DAQmx ANSI C examples. They can be easily converted to Visual Basic 6.0.
This link explains how to convert them: NI-DAQmx Examples for Visual Basic 6.0