From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Writing a single analog waveform to pxi-6363

Solved!
Go to solution

 

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.

0 Kudos
Message 1 of 3
(3,899 Views)
Solution
Accepted by topic author johngardner58

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!

0 Kudos
Message 2 of 3
(3,874 Views)

Thank you this was what I needed and it worked!

0 Kudos
Message 3 of 3
(3,826 Views)