Hi,
We need to transmit 2 pattern via 2 channels periodically
We use “AnalogMultiChannelWriter function and it works good, see the code below.
Our problem is that the number of sample in each channel is different, therefore the shorter pattern is pad with zeros.
How can we transmit periodically 2 patterns with unknow lengths independently (without zero padding)?
Thanks,
fGenTask = new Task();
for (int chIndex = 0; chIndex < channels.Length; chIndex++)
{
channelName = ProduceChannelName(deviceName, channels[chIndex]);
fGenTask.AOChannels.CreateVoltageChannel(channelName, chNames[chIndex], min, max, AOVoltageUnits.Volts);
}
//Verify the task before doing the waveform calculations
fGenTask.Control(TaskAction.Verify);
if (fGenTask.Timing.SampleTimingType == SampleTimingType.OnDemand)
{
fGenTask.Timing.SampleTimingType = SampleTimingType.SampleClock;
}
fGenTask.Timing.ConfigureSampleClock("", rate, SampleClockActiveEdge.Rising,
SampleQuantityMode.ContinuousSamples, samplesPerBuffer);
AnalogMultiChannelWriter writer = new AnalogMultiChannelWriter(fGenTask.Stream);
writer.WriteMultiSample(false, data);
fGenTask.Start();