11-09-2015 05:57 PM
Hi,
I want to write a fixed set of samples to the analog output and then stop. I am using C# but that isn't the important thing. I don't want a continuous signal. Lets say I have 1000 Samples / second or a sample per 1 ms. I want to be able to generate single waveforms of anywhere from 10 ms to 1000ms wide. The shape is arbitrary but once the samples are done I want it to stop and remain at the last sample written.
I typically want synchronous writes, i.e. the .write is blocked until finished. I need the start and stop of the signal generation to be deterministic.
I haven't found a way to do this. It either regenerates or if I tell it not to regenerate I get an -200290 error. I don't want to regenerate and I want it to stop waiting for more samples.
Solved! Go to Solution.
11-10-2015 01:57 PM
Hello johngardner58,
It sounds like you are currently have your task to timing configured to generate samples continuously, and since you are only sending a fixed set of samples, the buffer is regenerating those samples to keep continuously generate samples.
For your application, it sounds like setting your task timing to finite samples might be a better fit. This will send the fixed amount of samples that you specify and then stop.
This can be done in the Task.Timing property with the SampleQuantityMode.FiniteSamples as the setting.
Here is a tutorial about the calls and configuration options you have while Using NI-DAQmx in Text Based Programming Environments.
I hope this helps!
11-16-2015 06:18 PM
Thank you this was what I needed and it worked!