AnalogWaveform time infromation

I'm performing data acquisition in continuous mode through the Commission NI 6132 under DAQmx, using .NET (c#).

Everythihng works perfectly, except that every time the AnalogWaveform acquired has exactly the same start time information!

Each aqcuision files is triggered by the trigger. We must now correct time what relaxation occurs 5 times in the line and acquire some data (for example, 100 samples after trigger). Acquired samples are correct. It's the time for each record information

For example, my back AnalogInCallback() function call is defined as follows, for the reading of 5 records of the same channel:

AnalogWaveform[] buffer = new AnalogWaveform[5];

int counter = 0;

private void AnalogInCallback (IAsyncResult ar)
{

...
AnalogWaveform[] data_oneRecord = reader. EndReadWaveform (ar);

buffer [counter] = data_oneRecord [0];

counter ++;

}

When 5 folders should be acuired, the function above is callsed 5 times.

The problem is that every time timing of waveform information are exactly the same, as the first time as well as for that of 5th.

That is to say

buffer [0]. Timing.StartTime is buffer [4]. Timing.StartTime

I have egg information exact start time each folder!


Tags: NI Hardware

Similar Questions

  • AnalogWaveform - problem of memory over time?

    I need to implement multiple graphs, each with a unique set of data.

    WPF, data application is related in an AnalogWaveform proberty XAML.

    For as far as I can see there's no opportunity to clear or reset the AnalogWaveform, if it grows and bigger with time, until that all memory is fed up. (See the example of a link on the next page)

    http://zone.NI.com/reference/en-XX/help/372636F-01/mstudiowebhelp/HTML/wpfgraphplotting/#DataSource

    1. Why is there not a clear option for that? How can I reset without creating a new AnalogWaveform

    2. any other chance to bind data via xaml to NEITHER: Graph?

    Link doesn't seem to work, affecting only "Chart1. Data source"in code-behind will result in a visible plot.

    The example that you have accessed to seeks to demonstrate binding data with the least amount of code possible. With the help of analogWaveform.Append integrated of the waveform change notification is used to warn the new data graphic. However, as you have found, just creates a wave of increasingly wider, leading to memory problems.

    If you want to keep the history with a fixed capacity, you can use the ChartCollectionAnalogWaveform . If you want to display individual signals, you can use a more common form of WPF data binding where we use INotifyPropertyChanged to notify that a new waveform is available:

    public partial class MainWindow : Window, INotifyPropertyChanged {

            private AnalogWaveform analogWaveform;

    public MainWindow( ) {

                InitializeComponent( );

                graph1.DataContext = this;

            }

    public AnalogWaveform Data {

                get { return analogWaveform; }

                set {

                    analogWaveform = value;

                    PropertyChanged( this, new PropertyChangedEventArgs( "Data" ) );

                }

            }

    public event PropertyChangedEventHandler PropertyChanged = delegate { };

    private void button1_Click( object sender, RoutedEventArgs e ) {

                Random random = new Random( );

    int pointCount = 100;

                double[] data = new double[pointCount];

                for( int i = 0; i < pointcount;="" ++i="">

                    data[i] = random.NextDouble( );

    Data = AnalogWaveform.FromArray1D( data );

            }

        }

    You can also expose Data as a dependency property in this example, that would manage the notification of changes automatically.

  • using c#, AnalogWaveform. GetRawData() vs. Samples

    HI - simple question:

    Suppose I have some data in the form AnalogWaveform]

    and I want to write to the disk (without wasting time, as I work on the continuous acquisition in real time)

    What is the difference between AnalogWaveform.Samples and AnalogWaveform.GetRawData ()?  What are the advantages/disadvantages?

    Thank you!

    Chicago_Joe,

    The raw data are the data before the scaling has been applied, so that the samples will already have been converted to real tensions.  Thus, for the purposes of data entry, it is probably more useful save samples.  However, it is possible to manually convert raw data to tensions.  Here is a sample program (in LabVIEW and C++, but the same thing could be done in c#) that takes the raw data and converts it.  In addition, if you want to learn more about the raw data, here is an article of knowledge that talks on this subject.  It refers specifically to the DAQmx functions in LabVIEW, but the same thing applies when you use DAQmx with c#.

    -Christina

  • Graphic problem with time axis in WPF

    I am new to use measurement studio.

    I used the rangeadjusters in the examples, followed messages in this discussion and put some my own codes trying to make the graph having a time axis.

    but now I'm stuck in a problem. Here there.

    There are students that I added;

    In the xmal part:


       


               
         

       
               
       

       
                 
         


     
           
               
                     
                 

           

     

    c# rolled in OnPlotDataClicked codes

    AnalogWaveform[vague];
    Double [,] plotData = new double [3, DataCount];

    for (int j = 0; j)< 3;="">
    {

    for (int i = 0; i)< datacount;="">
    {
    Double value = 1.2 * random. NextDouble() * Math.Sin (I * Math.PI * Math.PI/DataCount);

    plotData [j, I] = value;
    }
    }

    waves = AnalogWaveform. FromArray2D (plotData);

    for (int k = 0; k)< 3;="">
    {

    Calendar of WaveformTiming = WaveformTiming.CreateWithRegularInterval (new TimeSpan (0, 0, 0, 30), DateTime.Now);

    waves [k]. Timing = calendar;

    }

    Graph DataSource = waves;

    the result

    but the result is not that I want to, axis show the wrong date at any time. How to make right. waiting for your help, thank you very much

    By default, the PreferIndexData property true for the Graph control. This means that the chart uses the index values of the wave instead of calendar information and then converts the index values for DateTime to match the axis (so index 0 forced to ' 1 1 January 00 ').

    We have a task to improve this problem, but for now, if you set PreferIndexData to false , the chart will use the time information and update of the axis interval to match that of the wave.

  • Problems with the use of variables at the time of the SV - Loudness.vi

    Hello

    I'm rather new to Labview and will have questions, get my Time-Varying Loudness calcuations out correctly. Attached is my current VI and a .csv file of my data set (calibrated in PA. sampling frequency = 50 kHz for 5 seconds). It does not produce what I expected when I run the VI. Here are my questions:

    Time-Varying Loudness:

    (1) what are the signals so much? There are hundreds of lines, but I only expect one.

    (2) why my category axis are not a range from 1 to 24 years as bark should be?

    1/3 octave Band Analsysis:

    (1) why is it incorrect? Them should not be a linear increase the frequency...

    Data on the one hand be hurry and make a squeek. It is a transient noise that happens about 2 seconds. But, how could I go do a waterfall (Time (s), Frequency (Hz), Amplidtude (sones)) of this signal? Is there an easy way? or do I have to do all three signals and add to make a parcel?

    Thank you very much for your help! Let me know if you need more infromation,

    -Troy

    p.s. I have included a picture of the results as well.

    Hi Troy,

    (1) the SV specific volume VI 'chunks' given in blocks of 2 ms and returns then these as individual plots specific Loudness vs. Sone.  The colored lines that you see in your chart are representative of the 2 500 2 periods of time ms in your acquisition of five seconds.  Each of these plots contains 241 points, however they are ten sample "gradually", one for each sone.  The digital filter buffer takes a bit to fill and kick in properly, however, so you can give your first rows (0-. 02 seconds or more) scrutiny before using them - you can see a number of unexpected zeros around the lower sones.

    2) since you use a chart, the x-axis will be increments every race following (the previous data is stored.)  If you only want to display the most recent data, I would recommend switching to a chart, which is found in the chart controls palette.  Also, see above (#1) why the x axis are longer than 24 points.

    (3) remember that dB is a unitless measure and cannot be used in reference to another value. A typical reference for sound is 20 uPa, but you will probably need even out your data entry and determine/set dB reference.  You can take a look at the voltage from the snout to the Cloaca EU.vi scale (EU means equalized units) and from the snout to the Cloaca Set dB reference.vi.  In your case, I think the plot of Octave shows your dB from a default value of 1.  The values should be accurate with respect to the other, but you must provide a reference value to calibrate the scale.

    (4) I think that this VI is a good example how to do to create a cascade:

    Display cascading for Octave (DAQmx)

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/5562

    You will need to break up of your waveform into pieces, just like the specific volume VI, but the basic concept is roughly the same (take piece of waveform, take octave measure of the piece, add octave output measure cluster to cluster table, repeat for the rest of the waveform display)

    Phew!  It was a bit of information.  Let me know if this makes sense and don't be intimidated by the detail and/or unknown functions or methods - you're definitely on the right track, or to ask it to at least the right questions.

  • Add data to an [existing] the AnalogWaveform &lt; Double &gt;

    Hello

    I'm the life-long tension using DAQmx scene, and I am puzzled as to how I can add new samples in an existing array of waveform.  Whenever I run my program, I receive only 1000 samples of data in the AnalogWaveformarray.  Because I need to do some calculations after each asynchronous reading, I wish I had the waveform table 'accumulate' data until the acquisition stops.  Then, I can trace the entire waveform.  Is this even possible, or do I just store the data in a WaveformPlot?  Any suggestion would be appreciated.  Thank you!! Here's my code for callback:

    public void ReadCallBack_MeteringTask (IAsyncResult ar)
    {
    Try
    {
    If (runningTask is ATR AsyncState)
    {
    read data
    AnalogWaveformof the waveforms [] = daqReader.EndReadWaveform (ar);

    cancel the acquisition if channel trigger is not valid
    If (triggerChannelIndex < 0="" ||="" triggerchannelindex=""> = meteringTask.AIChannels.Count)
    {
    meteringTask.Dispose ();
    runningTask = null;
    System.Windows.Forms.MessageBox.Show ("Invalid trigger channel index.");
    return;
    }

    continue to acquire data until the short-circuit has been detected
    shortCircuitInitiated = IsShortCircuitInitiated (waveforms, triggerChannelIndex, desiredLevel);
    If (shortCircuitInitiated)
    {
    short circuit detected, read more and stop acquisition
    daqReader.MemoryOptimizedReadWaveform (desiredSamplesPerChannel, waveforms);

    Stop the task
    meteringTask.Dispose ();
    runningTask = null;
    return;
    }

    Read the next set of samples
    daqReader.BeginMemoryOptimizedReadWaveform (desiredSamplesPerChannel, callBack, meteringTask, waveforms);
    }
    }
    catch (DaqException ex)
    {
    meteringTask.Dispose ();
    runningTask = null;
    System.Windows.Forms.MessageBox.Show (ex) Message);
    }
    }

    Hi Eric,.

    Unfortunately, it seems that the AnalogWaveform data type has no the possibility of adding a waveform, mainly due to the uncertainty as how to manage with different timing waveforms.  In your case, since it is still the timetable, we should be able to piece together a solution.

    First of all, note that AnalogWaveform[] is an array of the data types AnalogWaveform returned by the function of data acquisition.  The table represents the number of channels that is to measure your task of acquisition.  This example I can give you is for a track, but you should be able to extrapolate in several channels.

    We must create a global variable of AnalogWaveform that will maintain the variable information.  Then, whenever your function will run, you must add the information of waveform at the end of the global variable.  Due to some restrictions in the type of data, we must do a few things to work around this problem, but hopefully the example code below is clear.  If it isn't, please answer any questions you may have.

    public AnalogWaveform = new AnalogWaveformglobalWaveform (0); //set to 0 because it is resized subsequently

    ....

    AnalogWaveformof the waveforms [] = daqReader.EndReadWaveform (ar);

    First, you must create a temporary variable waveform that is as large as the existing data stored in the global data as well as the size of incoming data

    AnalogWaveform tempWaveform = new AnalogWaveform(globalWaveform.Samples.Count + 100); //replace 100 with the known size of your waveform that you read in the previous step

    Then, you must copy the waveform timing information.  Given that your calendar information will not change, we can just do this copy every time your code runs

    tempWaveform.Timing = [0] of the waveforms. Calendar;

    tempWaveform.PrecisionTiming = [0] of the waveforms. PrecisionTiming;

    tempWaveform.ScaleMode = [0] of the waveforms. ScaleMode (ScaleMode);

    Then we need copy the existing data from the globalWaveform to the largest temporary variable.  This must be done because there is no way to add to the global variable.

    int index = 0;

    for (int j = 0; j)< globalwaveform.samples.count;="">

    {

    tempWaveform.Samples [index ++]. Value = globalWaveform.Samples [j]. Value;

    }

    Finally, it copies the data from the new waveform, read in the tempWaveform variable.  This means that tempWaveform is a local variable which contains the entire waveform.

    for (int k = 0; k)< waveforms[0].samples.count;="">

    {

    tempWaveform.Samples [index ++]. Value = [0] of the waveforms. Samples [k]. Value;

    }

    The last step was we do globalWaveform repoint towards the entire waveform.  When this function is out of reach, the data will always exist because globalWaveform is pointing to it.

    globalWaveform = tempWaveform;

  • New iPhone than 7 to 8 hours time to call to life

    I got a new iPhone 7 more, ordered through Verizon, a few days ago. Yesterday, I noticed that she had 8 hours and 51 minutes of life call time, which is impossible.

    This phone has replaced my iPhone 6

    I have not configured this phone via an iPhone backup 6. I plug it into iTunes once for synchronization of music and iTunes did ask if I want to set it up as a new phone. I said yes.

    I use the same iTunes/iCloud account that I used on my old phone, however.

    My use in line with Verizon for this month is only 113 minutes, so this number is clearly wrong.

    Still, I have the old phone and looked at the number of hours of calls from life. It's much more than 24 hours, the new phone has not inherit the old phone number.

    DIDS, I get a phone used or defective?

    Very strange... no one here can say what has happened. I go back to Verizon and ask them. If it was me, I insist on getting a new phone... that one has been used somewhere.

    Barry

  • I've never done a Time Machine backup and I have upgraded to iOS Sierra. Help!

    I'm a fool. After owning my Macbook for 5 years, I failed to make a single Time Machine backup. I just saved my essential to an external hard drive. I have upgraded to iOS Sierra. Big mistake. I want to go back to iOS Capitan, but it does not seem possible. Now, my external hard drive is wiped clean (things are dark). What are my options? If I'm stuck with Sierra?

    If you have downloaded El Capitan, it should always be available in your purchases. Now, you will need to make a backup to backup your personal files.

  • OS Sierra - Time Machine

    Since I upgraded my iMac 27 "I can no longer use Time Machine to recover.

    Whenever I want to use it, I get a black screen and I can't chose the files I wish to recover. Backup itself does not turn.

    I reformatted the drive that I use for Time Machine (drive external usb with a capacity of 0.5 TB) during the upgrade of OS Sierra.

    On my laptop - still running Yosemite - recovery works very well >

    Someone has an idea of what is goiing evil?

    Thanks for any suggestions...

    Hello! Is someone there?

  • macOS Sierra stuck on the Time Machine backup

    Its been 2 weeks now since I updated to macOS Sierra and my Time Machine backup is always stuck on "preparing backup" and I tried different disc backup on another partition but still no luck.

    Make sure that:

    o drive the TM is excluded from Spotlight indexing non-mandatory;

    o that all software anti-virus is disabled (especially Sophos);

    o journal of iCloud and other cloud services.

    o check this article: macOS Sierra: If Time Machine still at the stage of "preparation"

  • Time Machine does not work after upgrade to Sierra

    The Time Machine (TM) fail to start backup and there is still "preparing backup...". "for more than an hour. This right after upgrading to Mac OS Sierra.

    Another weird thing happens to the toolbar of the Mac Mail. The Junk button is replaced by another button. trying to put back in place, but remove the button become a button.

    Please help with the backup problem mentioned above. Thank you much in advance.

    How long have you waited? After a new installation, it must be a fair while even with a SSD to prepare the first backup due to the number of modified files.

    Make sure the TM drive is in the list of items excluded from Spotlight indexing. ICloud newsletter and other cloud services.

  • How to disable alerts from travel time calendar

    From iOS 10, I get calendar alerts, not 5 minutes before my meeting (which is what I said), but rather these travel alerts in time talk about traffic conditions and if I leave now, I'll make my meeting... or something to that effect.  Is it possible to disable these and have just alerts timed static normal that I specify.

    And besides, all my calendar events have time to travel the value 'None '.

    Thank you.

    Hello JupiterOne,

    Thanks for this info and choosing the communities Support from Apple. I know how to turn off this alert leave time is important to you! The good news is that these steps will be useful in solving your problem with this alert calendar events, you can go to settings > calendar > default alert time and disable the time alert off. This will transform this AutoFix to this alert feature.

    Calendar at a glance

    See you soon!

  • Time Capsule airport

    I upgraded my iMac OS to 10.12 Sierra... now my Air Port Time Capsules disappear from airport... utility that makes printers network unreachable... that makes the document recovery automatic does not work... which makes backups Time Machine can't not... which makes me irritable.

    Any help?

    Writing an effective question of communities to Support Apple - https://discussions.apple.com/docs/DOC-5931

  • Time machine backup is too large, that is not true, said

    After the upgrade to OS Sierra, Time Machine always tells me that the backup is too big to fit on the external drive that I use. I erased the disc and checked all volumes, I don't want to back up. He always tells me that the backup is 2 TB.

    My boot drive has 155 GB in use, I do not understand why TM attempts to use 2 TB. I've removed the preferences, he always tells me that it is too big. The external drive has 1 TB of free space.

    Any suggestions?

    If you open Applications > utilities > Terminal and paste the following command and press return, what is the result:

    DF h

  • Delete older backups time machine from the server

    I have a small number of iMacs here that back up using Time Machine on our local network to an external hard drive on an iMac running server. I added a second external hard drive and I say most of the Mac to use instead. Once they have saved once the new drive safely - how can I remove the old backup of the first disc? Is it safe to just delete the sparsebundle to it? Or is there a way to do it properly

    TIA

    Andy

    Yes, it is safe to delete the sparsebundle in the old media from backup after you remove as the backup location and create your 1st upward on the new location. Since your iMac is now pointing to the new backup media, they are more associated in the former. If you have no other Mac backup on old media, you can simply reformat.

Maybe you are looking for

  • HARD drive crashed, certificate .p12 lost but who still have the original SJC

    I am able to somehow get my apps to sign as the old packages or what I get BlackBerry to clear the old ID and allow my other?  Bit worried because my application stores saved locations, and users have the possibility of saving on their device file ma

  • How can generate ALX file

    When I choose file ALX generate in JDE4.7. The program to inform 'an ALX file cannot be generated for the selected object. What ' wrong? What should I do to have this file?

  • _contentView.URL with webView

    Im trying to call my xml file _contentView.url WebView { id: myWebView url:_contentView.url } I'm sure that the wrong way because its not working how I would do that. IV by looking at the sample stampcollector and found something simliar ImageView {

  • Article "what BlackBerry smartphone models and their corresponding GPS...". »

    Hi guys. This is article about GPS skills and function of carrier list. I use this picture on my request. I have a simple question about this article. So, you can see Bell5 and Bell service provider field. Actually I don't know what is the Bell provi

  • Site updated signature Cisco down?

    I just noticed that I was not doing my daily updates since Sunday.  I get the following error: Automatic download of work report: No file available for download. Error: Unable to communicate with the location service for recovering files available. H