From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

C# write to USB-6001

I already have a task created in MAX.

I am loading the task using Task Setpoint_Task = NationalInstruments.DAQmx.DaqSystem.Local.LoadTask("Setpoint");

The channel is called AO-0 in MAX.

I am not sure what I need to do to set that channel to 5V.

0 Kudos
Message 1 of 5
(5,860 Views)

nyc,

 

When you create a voltage analog output task in NI MAX, you will set the signal output range to a maximum of 5 volts, and then at the top you will set the voltageOut to 5 volts.

 

William Fernandez

Applications Engineer

National Instruments

0 Kudos
Message 2 of 5
(5,824 Views)

@wfernand wrote:

nyc,

 

When you create a voltage analog output task in NI MAX, you will set the signal output range to a maximum of 5 volts, and then at the top you will set the voltageOut to 5 volts.

 

William Fernandez

Applications Engineer

National Instruments


From reading the Help file, it appears that I would need to

Task setpoint_Task = NationalInstruments.DAQmx.DaqSystem.Local.LoadTask("Setpoint");
AOChannel aochannel_setpoint = setpoint_Task.AOChannels[0]; AnalogSingleChannelWriter setpoint = new AnalogSingleChannelWriter(setpoint_Task.Stream); setpoint.WriteSingleSample(true, 5);

 

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

nyc,

 

I thought that you were asking about how to set up the 5 volts output using NI MAX. The code that you posted seems to be right to me. The following white paper can help you with the DAQmx functions. 

 

Mapping the NI-DAQmx .NET API to the NI-DAQmx C API - NI-DAQmx .NET Class Library Help for Visual Studio 2010
http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/daqapimapping/

 

Please give this a try and let me know.

 

Warm Regards,

William Fernandez
Applications Engineering
National Instruments
www.ni.com/support

 

0 Kudos
Message 4 of 5
(5,804 Views)

@wfernand wrote:

 

Mapping the NI-DAQmx .NET API to the NI-DAQmx C API - NI-DAQmx .NET Class Library Help for Visual Studio 2010
http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/daqapimapping/

 

 


Thank you for the link, but we are not upgrading from C to C#.

 

 

0 Kudos
Message 5 of 5
(5,787 Views)