Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

read analog output value c#

Hi,

I've seen already many posts regarding reading back analog output value on NI 6008, but so far all posts refer to internal channels. In .NET environment (C#), however the name
Dev1/_ao0_vs_aognd throws an exception saying that that channel is not available. What could be wrong?

How the virtual channels can be "read"? Using AnalogSingleChannelReader + ReadSingleSample or something different
0 Kudos
Message 1 of 5
(4,004 Views)
Raul,

Unfortunately the USB-6008 does not support the Dev1/_ao0_vs_aognd channel - this feature is only available for E and M series cards.

What you could do is loop your analog output back into analog input physically using a wire and then measure that analog input channel instead.


Abhinav T.
Applications Engineering
National Instruments India

LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Measurement Fundamentals
0 Kudos
Message 2 of 5
(3,998 Views)
Hello again,

Could you please describe the incompatibility in more details. For instance, it is possible to read back digital output signals:

            DigitalMultiChannelReader reader = new DigitalMultiChannelReader(DIOOutputTask.Stream);
            bool[] samples = reader.ReadSingleSampleSingleLine();

So how come the NI API does not allow analog output reading?

Thank you for your patience,

Raul
0 Kudos
Message 3 of 5
(3,995 Views)
Hi Raul,

More than a C# issue, this is a misunderstanding about the devices.
When you output some voltage in your AO, you assume the device did it and that's it. If you want to read this value, you need another piece of hardware that performs measurements. In this case, the same analog inputs that your device has. E Series and M series have internal routing that allows this procedure but not your device.

For digital task you can read the actual port that was last latched into the device and therefore you can get the current state.

Hope this clarifies,
Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 4 of 5
(3,976 Views)

Hi there, but if I build kind of functional generator on Analog output (which works "automatically"), after it stopped, how could I get (in c#) last value written to Analog output (or buffer linked to it)?

Thanks

0 Kudos
Message 5 of 5
(3,381 Views)