Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get timing information from analogwaveform C#

Hello,

 

I'm using a USB-6008 and I want to get a timestamp for each sample that I acquire. As you can see in my code I'm using an AnalogWaveform. I found out that I have to set the Timing  enumeration of the WaveformAttributeModes property to gather the time data and include it with your waveform data. But I don't know where to set the WaveformAttributeMode??

 

        private AnalogMultiChannelReader analogInReaderCheck;
        private int samplesPerChannel = 50;
        private int rateHz = 500;
        private Task checkTask;
        private AsyncCallback analogCallbackCheck;

        .........

 

 

                    checkTask = new Task();

                    // Create a virtual channel
                    checkTask.AIChannels.CreateVoltageChannel("dev1/ai0:3", "",
                        AITerminalConfiguration.Differential, -1, 5, AIVoltageUnits.Volts);

                    // Configure the timing parameters
                    checkTask.Timing.ConfigureSampleClock("", rateHz,
                            SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, 1000);
                   
                    // Verify the Task
                    checkTask.Control(TaskAction.Verify);

                    analogInReaderCheck = new AnalogMultiChannelReader(checkTask.Stream);
                   
                    analogCallbackCheck = new AsyncCallback(MyCallback);

                    analogInReaderCheck.SynchronizeCallbacks = true;
                   
                    analogInReaderCheck.BeginReadWaveform(samplesPerChannel, analogCallbackCheck, checkTask);


                    .............

 

kind regards                  

0 Kudos
Message 1 of 1
(3,348 Views)