Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

analog input waveform with 6236

Hello NI experts,
 
I have a 6236 PCI board installed in my PC.
I tried to run the example provided in C:\Program Files\National Instruments\NI-DAQ\Examples\Visual Basic 6.0\Analog In\Measure Voltage\Acq-Int Clk using the 6236 PCI.
However it gives the following error message: Error -200431 Measurements: Selected physical channel does not suppoprt the measurement type required by the virtual channel you're creating.
 
What does it mean? The 6236 provides an AI channel. It seems to works properly if I use the MAX  test panel.
 
Loooking forward to your advice.
 
Regards,
 
Diaz
0 Kudos
Message 1 of 12
(5,240 Views)
Hello NI experts,
 
I have read many Q&A about multi-channel AO (and AI).
My understanding is: to change a single channel into a multi-channel AO I need to change Dev1/ao0 to Dev1/ao0:1.
 
 
I try to change the example given in C:\Program Files\National Instruments\NI-DAQ\Examples\Visual Basic 6.0\Analog Out\Generate Voltage\Cont Gen Volt Wfm-Int Clk, which is a single channel AO example for continuous wfm Gen into a multi channel by changing Dev1/ao0 to Dev1/ao0:1.
But I got this error message: attempted writing analog data that is too large or too small (error 200561).
 
Anything else I have to change?
 
1. I want to send the generated waveform into 2 different channels, ao0 and ao1.
2. Is it possible to have different frequency and/or different voltage level at the two channels? (one converter?)
 
(I have PCI 6236)
 
Looking forward to your comments,
 
DAQ novice,
 
Diaz
 
 
 
 
0 Kudos
Message 2 of 12
(5,224 Views)
Hello Diaz,

The 6236 is not one of our typical M series cards.  It is one of our industrial cards that has more specific applications.  Specifically, the 6236 does not have any voltage inputs.  It does, however have 4 current inputs.  The first example you reference is setting up an AI Voltage channel.  If you change this to a current task, you should be good to go.

As for the second example and error you reference in your second post,  I believe what you are seeing is a result of the data being written to the channels.  The program is set up to only write to one channel.  There is code (which I assume you removed) which makes sure you are only using one channel so that this error does not happen.

In order to write to multiple channels, there are several things you need to change.  It sounds like you already know how to add the multiple channels to the task (with the Dev1/ai0:1), but you also need to change the data that is being written to the channels.  You need to add a second dimension that has the channel information (e.g. col 0 = chan 0, col 1= chan1). The number of columns needs to match the number of channels in the task.

Doing this, you can have different voltages on the different channels (by specifying different values in any given row), however since there is only one timing engine for AO, you can only output at one rate.  The way to make it look like different rates is to generate faster than you want and just generate the same value multiple times.

I hope this points you in the right direction,  post back if you have any questions or if I need to clear up anything.

Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 3 of 12
(5,198 Views)

 

Hello Neal,

Thank you for your message. It seems I need another PCI card and I hope you can give me suggestion on the best but cheapest card available for me 🙂 My application requires the following:

1. at least 6 lines of Digital I/O for switching purpose.

2. at least 1 counter/timer (2 is better)

2. at least 2 voltage inputs. NOT current input 🙂

Can I have all of these in one PCI card? What card is it?

Cheers,

Diaz

 

0 Kudos
Message 4 of 12
(5,190 Views)
 

Hello again diaz,

I did a search from our data acquisiton page using the various links under the "Find the Right Data Acquisition Device" section and came up with many results.  Depending on sampling rate, bits of resolution, etc, you can narrow down your results even more.  When I sorted by price, it came up with the PCI-6010, however from experience, if you want to expand or add functionality, the E series DAQ (60xx) devices are the way I would go.  For the best in rates, bits, etc, the M series devices (62xx) provide all of the multifunctionality and very good specs.

We also have some low cost USB devices that may be cheaper and provide lots of functionality. I would recommend looking at those as well.

All of these use the DAQmx driver, so programming them is exactly the same (you can even use the same programs for all of these devices).

Our sales representatives (www.ni.com/contact) are great at making sure you get the best product for your application.  They are very knowledgable about our wide range of hardware and are a great resource.

 
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 5 of 12
(5,175 Views)

Hello Neal,

Thank you so much. Now I can generate two waveforms at 2 different channels with diff. voltage levels. This is how I do it.

For i = 0 To numElements  'this is in the generate sine wave function
        data(i) = amplitude * Sin((i * 2# * Pi) * frequency * deltaT)
        data2(0, i) = data(i)
        data2(1, i) = data(i)
    Next i

and then I replaced data(0,0) with data2(0,0) in the DAQmxErrChk DAQmxWriteAnalogF64 statement.

But I still don't understand your last sentence; " The way to make it look like different rates is to generate faster than you want and just generate the same value multiple times".

Do you mean I should set the frequency higher than the value I want (in the For loop above) ?

and then what next? what do you mean by 'generate the same value multiple times' ? and how?

Sorry, my english is limited.

Regards,

Diaz

 

0 Kudos
Message 6 of 12
(5,166 Views)
Hello Neal,
 
Thank you for your suggestion on PCI card. the 6010 only has 4 DO. I need 8 DO. I have checked the 6221 instead.
What is the advantage of having the USB-6221, compared to PCI-6221. Can I plug in the USB version into my laptop, for example? So if my application is small enough, I can bring it wiith my laptop?
 
I also read the USB-6009. The differences (from USB-6221) are:
1. timing (software vs. hardware): what does it mean? what is the advantge of H/W timing?
2. sampling rate (200 kS/s vs 45 kS/s?): what application can we use the 45 kS/s for?
Is it enough if I want to read the ouput of photometer exposed to a light source modulated at freq of say 200 Hz?   
 
Thanks,
 
Diaz
0 Kudos
Message 7 of 12
(5,165 Views)

Hello again Diaz,


To answer the questions in the first post:

What I was talking about with the outputting different rates has more to do with the actual generation than the for loop.  The easiest way to explain this I believe is with an example, so here we go:

Say we wanted to output 2 voltage step signals (0V,1V,2V,3V,4V,etc) at different rates.  The first we want to output at 1Hz and the second we want to output at 5Hz.  What we would have to do is set our sample clock rate for the analog output task (with both channels in it) to 5Hz and write our two output arrays as follows:

data1=(0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,...)
data2=(0,1,2,3,4,...)

So what would happen is the first channel would output 0V 5 times at 5Hz and then 1V 5 times at 5 Hz, then the same for 2V, 3V, etc. (which is equivalent to outputting at 1Hz). 

You have to build your data accordingly with the for loop, but the trick is in the sample rate of the actual task.


The Questions in Your Second Post:

All the differences between the USB-6221 and the PCI-6221 have to do with the bus (USB v PCI).  The actual devices are the same.  USB transfer is slower and does not have DMA channels like PCI does.  There are some other differences, but I am sure that you can search the internet for these if you wish.  If you are not doing high speed applications, this difference is relatively easy to get around.  So basically, yes, you could use the USB version with your laptop and not loose much functionality.

When it comes to your two questions about the differences between the 6009 and the 6221, the differences are large.  Hardware timing means that the card divides down an oscillator to control the output/input rates (when to take a sample).  Software timing means that the computer polls the card for a sample each time. Hardware is far more accurate when it comes to exact sampling rates.  You can also do buffered acquisition, meaning sample faster than you can transfer across the bus and store the data on memory that is on the card.   You then read the data off that memory in chunks.  That is why the M Series devices have much higher sampling rates.

This being said, however, choosing your sampling rate relies completely on what you are trying to read.  You say you are trying to read a 200Hz signal.  In order to get frequency information out of this, Nyquist Theory says you need to sample at least 2x as fast as the frequency you are trying to measure.  We recommend sampling at least 10x your signal to get a better idea of shape.  So you would need at least a 2kHz (2000 S/s) sampling rate.

To be sure you get exactly what you need, I will tell you again about our sales representatives (www.ni.com/contact).  They are very good at figuring out exactly what you need.  Most people cringe at the idea of talking to a "Sales Person", but ours are very good at figuring out what you need and giving you the best, cheapest options that will work for you.

 

 

 
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 8 of 12
(5,142 Views)
Hello NI experts,
 
I am currently using PCI 6236 with NI-DAQ ver.8.5
This PCI doesn't have AI voltage.
So I try to use DAQPad-MIO-16XE-50.
The problem is: my PC doesn't detect this DAQPad-MIO-16XE-50.
Why is that?
Can't I install DAQPad-MIO-16XE-50 together with the 6236?
Is it because the version. 8.5 ? Do I have to reinstalled the traditional DAQ? I hope not.
The DAQPad-MIO-16XE-50 is switched ON OK. (LED is ON)
 
Thanks,
Diaz
0 Kudos
Message 9 of 12
(5,005 Views)
 

Hello Diaz

 

 

If you check the specifications of the DAQPad-MIO-16XE-50 it is only supported under the traditional DAQ driver, and more the point, only versions 6.9.3 and earlier of the DAQ driver.  Also this driver is only supported on Windows 2K and earlier.  The PCI-6236 is only supporter under the DAQmx driver, so if you are running XP it is not even possible to install both drivers on the same computer.

NI-DAQ Driver Support: PCI/PXI Devices

 

 

 

 

Chris_K

 

 

0 Kudos
Message 10 of 12
(4,983 Views)