Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5625

NI 9263 D2A

$
0
0

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();


Viewing all articles
Browse latest Browse all 5625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>