Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about querying information about task's output buffer with more than 1 channel

Hello,

 

One is able to query the NI API for information about task stream buffers. For example, one can get or set the size of a tasks output buffer with the following statement: task.Stream.Buffer.OutputBufferSize. Now, let's say I have a task dedicated to analog output with 2 channels (partial configuration shown below).

_task = new NationalInstruments.DAQmx.Task("AnalogOutputTask");
_task.AOChannels.CreateVoltageChannel(_hardwareInfo.AnalogOutputModuleName + "/ao0", "ao0", -10, 10, AOVoltageUnits.Volts);
_task.AOChannels.CreateVoltageChannel(_hardwareInfo.AnalogOutputModuleName + "/ao1", "ao1", -10, 10, AOVoltageUnits.Volts);
_task.Timing.ConfigureSampleClock("", _hardwareInfo.AnalogOutputSamplingRate, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 8000)

Continuing with the example above...let's assume that this setup yields an OutputBufferSize of 8000. I then write 3000 samples to each analog output channel. After doing so, I want to know how much space is available in the output buffer. At this point, if I were to print out the value of task.Stream.OutputBufferSpaceAvailable what number would be expected to be printed out?

0 Kudos
Message 1 of 2
(2,009 Views)

I would expect it to show 2000. Does it appear to be showing something different? Also it looks like this forum post may have been about a similar issue to this if you want to read through it.

 

https://forums.ni.com/t5/Multifunction-DAQ/Daqmx-write-property-TotalSampPerChanGenerated/td-p/31411...

Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(1,984 Views)