02-25-2021 10:17 AM
hello,
I am using NI Hardware consisting of Analog Output Voltage channel. I have configured voltage output channel to run in continuous sampling mode. The data being generated by the voltage output task has to be changed after some time. Can i write new data to my analog voltage output task without stopping the task ?.
02-25-2021 11:02 AM
Sure, I don't see a problem with it.
02-25-2021 11:13 AM
I might be wrong but I think your example shows software timed generation whereas I'm doing a hardware timed continuous sampling mode data generation. My data consists of fixed number of samples repeated continuously. I need to change this data after sometime. But the number of samples in each of my data set is same.
I hope I'm able to put my thoughts in words properly.. 🙂🙂
02-25-2021 11:29 AM
Attach your VI then we can see what you are doing now and suggest and suggest a more appropriate change.
02-25-2021 01:27 PM
Please find the vi in the attachment as well.
The Analog Output channel is configured for continuous sampling mode. Voltage Generation will start when user clicks on Set Data. data will be generated continuosly. User can enter new frequency or amplitude value and click on Set data to change the Data being generated. Once the user clicks on Set data new data value will be generated continuously.
I hope i have made my case clear. Please let me know if you require further input.
Thanks.
02-25-2021 01:29 PM
Please note that i have the set value of 'Auto Start' input for DAQmx Write.vi as 'True'.
02-25-2021 05:44 PM
As I look that code over I'd quibble about several little style things, but functionally it looked to me like it ought to work.
So what actually happens instead? Do you get a task error and if so, what is it?
The first thing I'd try to change would be to call DAQmx Start explicitly before the loop instead of using auto-start. I prefer to know exactly when I'm starting and stopping my tasks. Auto-start makes things less clear.
-Kevin P
02-26-2021 01:34 AM
i took trial with the code.
Voltage starts generating on the output channel when i click on set data and data is generated continuously. When i change the Frequency or Amplitude value and click on set data again. The data change doesn't happen instantly on the output channel. Data change is observed after a very long wait maybe somewhere around 20 secounds or more.. 😅😅
02-26-2021 06:53 AM
First, friendly advice to help you help yourself. The info you just now provided is the crucial detail, but there was no hint of it in your earlier descriptions.
Speaking for myself (but expecting several others will at least nod along), I'm much more inclined to offer my time and help to someone who has obviously spent their own time being careful to describe their issue clearly and thoroughly right from the start. Some time to describe what you *want*. Some time to describe what you did, i.e., the things you tried and how you did them, including attachments of code when possible and sometimes data too. And then some time to clearly describe your observations of what you *got*.
Ok, back to your issue.
That long delay you see is a side-effect of buffering. There are at least 2 buffers to consider, and the general rule is that bigger buffers lead to longer delays. Here's a really good overview about output buffers (with emphasis on USB devices that need to involve a 3rd buffer).
First there's the task buffer that your calls to DAQmx Write interact with directly. For Continuous Sampling tasks, the buffer size is set by the # samples you write to the task prior to starting it. (There are also ways to size it explicitly if you choose.) The size of the task buffer affects how long it can take from the time you write until the data is delivered to the board. It's pretty much a high limit on the time. Depending on exactly when you write relative to what the driver is doing independently to deliver data to the board, the delay (also called "latency") may be shorter. When you want shorter delays, you make this buffer smaller. (When not using the default "regeneration" feature, this also means you must write more often.)
Second, your DAQ device has an onboard hardware FIFO buffer. The size available for this buffer varies greatly by specific device model. All data delivered by DAQmx to the board must travel through this FIFO before being generated as a real world signal. However, there are some advanced DAQmx properties available that can help limit how *much* of the available FIFO buffer gets used. It seems that some properties are only relevant & useful for a particular subset of devices -- you'll need to do some experimenting to discover what to use for your as-yet-unidentified device.
-Kevin P