07-12-2018 02:13 PM
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?
07-13-2018 05:59 PM
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.