05-28-2008 06:11 AM
myTask = new Task();
myTask.AOChannels.CreateVoltageChannel("Dev1/ao0",
"aoChannel",
MIN_VOLTAGE,
MAX_VOLTAGE,
AOVoltageUnits.Volts);
myTask.Control(TaskAction.Verify);
myTask.Timing.ConfigureSampleClock(
"",
numberOfSamplePointsInSecond,
SampleClockActiveEdge.Rising,
SampleQuantityMode.FiniteSamples,
numberOfSamplePointsInSecond);
double[] data = new
double[numberOfSamplePointsInSecond];
AnalogSingleChannelWriter writer = new AnalogSingleChannelWriter(myTask.Stream);
int i = 0;
for (int j=1;
j<5; j++)
{
for (i = 0; i <
numberOfSamplePointsInSecond; i++)
data[i] = Math.Sin(2 * Math.PI * ((double)i/100.0))
* (double)j;
writer.WriteMultiSample(false, data);
myTask.Start();
myTask.WaitUntilDone();
myTask.Stop();
}
myTask.Dispose();
the problem, while reading the data, there's a lag between each read (using BeginReadMultiSample/EndReadMultiSample, I know I have no problem with reading) can be seen in the attached file - there's a lag between each sample.
05-28-2008 08:08 AM - edited 05-28-2008 08:08 AM
02-23-2011 02:50 PM
Hello LiorS. Would it be possible for you to show your syntax after implementing DoNotAllowRegeneration? I have the same problem with my coding and, even after looking at the link you posted and following their syntax for chaging the Regeneration settings, I get an error.