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.

Tags: NI Software

Similar Questions

  • Increase consumption of memory over time

    Greetings,
    I have a card MCC DAS1000 and usb3102. When I check the counsumption of the memory of the PC I see more with time until some point the PC freezes and I have to restart.
    What can cause this problem, any help greatly appreciated! (PC: XP SP3 1 GB Ram AMD64 X 2 CPU)

    PS: The code is attached

    Best regards Ferhat

    Move all your channels either BEFORE your loop creation.  You cause memory leaks since you keep just created new references without closing the 'old '.

  • Sky of memory over time, bad performance rockets.

    I noticed when I come home from work, my Fire Fox is incredibly bad. Tabs take a while to open, has a time mouse wheel scrolling, etc. You tube video could pause and stutter on video but audio is fine. I started to exercise oversight and it is the fact that my wife will open 10 windows, sometimes with tabs, but never completely close all of them. When I get home, its 1, 5-2, 2 GB of memory used in the Task Manager. I tried everything: memory and cluttered with references to facebook, even if no facebook tabs are open. It can have 1 or 2 tabs for recipes.
    The only solution is to close FireFox all together and then open.
    If I lose its tabs open, she gets a little upset, so I have to kill the exe in the Task Manager, so when I reopen it, it will offer to resume the previous session.
    It is a simple touch of the tedious after a few weeks.
    Is there a different command or something I can do to leave current windows hunting fair and open on all used storage space that?

    Hello, these quantities of used memory can't be normal, even with a few windows open. as a troubleshooting step, you can try to reset firefox (this will keep all the Favorites and passwords): Firefox Refresh - reset the parameters and modules

  • Memory lost over time in my C: drive

    I noticed over time that I lost memory over time in my C: drive. I have about 500 GB, now showing only about 3 GB of space left. I have some downloads, but nowhere near 400 GB (I had pictures, but they deleted the hard drive that saved the GB)

    What would cause it to lose so Go? only from downloads?

    Was going to do a restore system to delete everything and start again see if that can solve the problem, but when I went to do this, he tells me that I need a backup of windows 7 Professional disc.  Went to the microsoft site, but could not find.

    Could I download another version of windows, and it will work correctly?

    Hello

    It is now called the disk space to avoid confusion with the RAM, which is the main memory.

    ____________________________________________

    This free program allows you to see what is taking place.

    http://www.Jam-software.com/treesize_free/

    You can clean your hard drive using these two methods.

    "Delete files using Disk Cleanup"

    http://Windows.Microsoft.com/en-us/Windows/delete-files-using-disk-cleanup#delete-files-using-disk-cleanup=Windows-7

    Using the free CCleaner program:

    http://www.Piriform.com/CCleaner

    In NO case use the registry cleaning Option in CCleaner

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    See you soon.

  • Advice on the restructuring of code to avoid the downturn over time

    Hi, I am a new user of LabView, you want some advice on how to better structure the program I wrote and which is used to perform a hydrostatic test arrangement. Data are collected on a module of AI cDAQ 9207 and a cDAQ 9474 module is used to control the two valves that subsequently controls pressure in and out of the test Chamber. I enclose my first version of the reference code.

    What the VI is supposed to do when the user of the weapon system and strikes then the execution, the program switch will cause a transition of the test chamber through several States corresponding to the levels of different pressure for some time. Time curve vs pressure is written to a file of measures. I built using a state machine structure.

    My problem is, during the initial trial, when the duration of the test was about 5 minutes or so, the program went very well. However, once I started to test the length of the actual test of 2.5 hours, I noticed the program running slower and slower as time progressed to the point where it would take several seconds for each iteration of the loop, then by accident about an hour or two in the test. After scouring the articles and messages, I suspect the main culprit is the diagram of waveform and to a lesser extent DAQ assistant.

    While I need the loop structure data collection and case to run pretty quickly (preferably the order a few hundred s/s) I need the code to be able to react to changes in pressure in the room quickly enough, the actual data, that I need to store and display the graph can be as slow as a sample per second or even longer. My guess is at this point that I have to rebuild the program using some sort of architecture of producer/consumer, I'm looking for some advice on how best to structure the program.

    Data acquisition obviously belongs in the producer loop that will run at a fast enough pace and there will be a consumer loop that will run at a much slower pace for the Bulletin Board writing to the extent of the file vi, but where should I put the case of structure state machine which currently controls the valves? Should put in the loop of the producer since it must run at the same fast pace as the collection of data, so it can react to changes in pressure or should I build another loop of consumer for him? What other indicators (pressure and Boolean) and controls on the front panel, they should be on another loop operating at a medium speed I want to respond to a faster pace than the data to the chart/write the loop, but they do not need to be as fast as the data acquisition loop?

    Finally, I'm not quite sure what would be the best way to reduce the sampling rate of the data that I have in fact appear on the graph and the store in the file, it wouldn't make sense to create another task of measurement that samples at a rate below just for that purpose. Suggestions and advice would be greatly appreciated! Thanks in advance!

    Bob

    My guess is that if you monitor the use of memory over time, you see that going up, Yes? Everything is is always a good idea to get rid of the express VIs, I would look for the problem of slowdown in the structure of the case. You repeatedly open and never close tasks which are created using some DIO channels. Hnece each time that the loop more memory is allocated. Try to move creating channel screws out of the loop, then the tasks are created once before the start of the loop and then written to as required inside the loop - and don't forget to delete tasks once the loop over.

    Mike...

    PS: You are right with your comments regarding the structure of the producer consumer. Basically it break up as things get quickly (DAQ IO) that there is in a loop, while the user interface and the stuff that can take a long time (such as the data record) are in another loop. You can even have three loops with one for the acquisition of input data and the other for the digital output.

    PPS: Finally don't forget that even if the structure of consumption of the producer is usually represented with everything in a single diagram, there no need to be. I wrote a lot where each loop is in his own VI which is run dynamically, then the application starts.

  • I2C communication slows down over time using USB-8451

    Hi all!

    I try to communicate via a device slave using a USB-8451 I2C and I noticed that after a while the communication speed slows way.

    I can send and receive data very well and apparently my system seems to work. But the problem is that over time the speed of data transfer slows down so much so that if I let it run all night it has slowed to a crawl in the morning. My ultimate goal is to gather data, draw and save every second and at the beginning it is easily achievable, but after 10-15 hours I can no longer collect data as fast I need. I'm not quite sure if this is a problem with my code LabVIEW, the NI USB-8451 box or the slave device. But if I stop running the LabVIEW program and start it again, everything returns to normal.

    The slave device is a personalized card with a microchip PIC which acts as a slave I2C and returns the data at the request of the master. I can't imagine anyone will be able to determine if this is a problem directly, but if we can rule out the other two (code LabVIEW or the NOR-8451) as the source of the problem so I know it's my slave device.

    I've greatly simplified the LabVIEW code that I used to collect data on I2C and I see even this gradual slowing down over time. Attached, it's that the very simplified VI and the data file, it produced. I only ran it for about 45 minutes, but from the beginning to the end we see again that the enforcement timeframe is rising.

    I hope I'm just doing something stupid, thanks in advance!

    -Aaron

    Aaron,

    Do not have the additional module responsible for these functions, but I'm sure I know whats going on.  It seems that each time through the loop 'OR-845 x I2C Create Configuration Reference.vi' creates a new reference.  After a while it will start to slow things down.  Better to open the reference before the while loop starts and spend just the reference in the loop.  Don't forget to close the reference after the loop stops.

  • Poor memory - rendered Management slows over time

    I noticed a problem with my renders involving sequences. animation and not purely of the layers of things etc, but based on sequences of images as assets. I have a lot of free RAM initially with no other open applications. When I start making my CPU usage is very high and AE takes memory and gives him a number of aeselflink processes. Over time however in my iStatMenus I can see my 'active' RAM drag and my 'inactive' RAM goes upward, while at the same time my CPU usage slowing down my render grinds gradually stopped. It's like once it loads an image of my images in RAM for rendering, that he cannot let go of it completely once it is done so gradually, he eats all my RAM and my rendering slows down. If I stop the rendering and nothing do but running an application to empty all the 'inactive' in 'memory' memory and restart immediately made things are in their fast normal operation. He then proceeds to gradually slow down again. Everyone knows what is happening here? All the images located on the external eSATA drives and are made to external eSATA drives. Here are my specs for reference:

    AE CC 2014 (v 13.0.0.214)

    Mac Pro (early 2008) 3.1 8-core

    18 GB OF RAM

    Memory and multiprocessing:

    18 GB installed RAM

    RAM to leave for other applications 5 GB

    CPU reserved for other applications 2

    Allocation of RAM per CPU / 3GB

    Real CPU that will be used 3

    Any ideas would be greatly appreciated. Thank you!!!

    Robert

    What is the State of reduce the size when system is low on memory Cache preference?

    I describe this preference here:

    http://blogs.Adobe.com/AfterEffects/2012/10/after-effects-CS6-11-0-2-update-bug-fixes-and-added-GPUs-for-ray-traced-3D-renderer.html

  • Problem of memory Mac Pro 3.1

    Hello

    I have a Mac Pro 3.1. 16 GB of ram in it, but sometimes only see 14FR.

    8 x 2 GB 800 MHz DDR2 FB-DIMM

    What could be the problem? Sometimes you see all the memory and sometimes not.

    2006-2008 (1.1 - 3.1) use FBDIMM that work how and fail over time.

    When they fail if all goes well, they don't disappear that you encounter. Often, they fail when you access and which can cause a kernel panic.

    Sometimes the resettlement of the affected module solves the problem, but often this fix is only temporary and the module must be replaced.

  • Svchost size seems to me like svchost (s) becomes larger and larger over time (between restart).

    original title: svchost size

    It seems that svchost (s) becomes larger and larger over time (between restart).

    He/they tend to reach the top of the sort (PWS) in memory of my task manager.

    It automatically get rid of her... whatever... it is now for use by more than one process (when they are no longer used)?

    If not, is there a way for him to say?

    Hello

    Sometimes you try more than once (the link of MVP) and there may be a site
    issue.

    Try this link to my profile
    https://MVP.support.Microsoft.com/profile=D2CBAC3A-D59A-4085-BA97-22B57FD00DF2

    Here is the link to the signature
    https://MVP.support.Microsoft.com/profile/Rob1

    I tried to answer the question in paragraph 1 above. Unless you encounter
    a kind of system problem the SVChost in Taskmanager will vary, in particular
    so shortly after a restart. And when you use the computer SVChost entries will be
    adding and removing management tasks on the fly. Check the information in the upper part
    two links in my previous answer.

    I hope this helps and happy holidays!

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Want a ramp of output voltage over time and measure input 2 analog USB-6008

    Hello

    I want to produce an analog voltage output signal that increases over time with a certain slope, which I'll send in a potentiostat and at the same time I want to read voltage and current (both are represented by a voltage signal) that I want to open a session and ultimately draw from each other. To do this, I have a DAQ USB-6008 system at my disposal.

    Creation of the analogue output with a linear ramp signal I was possible using a while loop and a delay time (see attachment). Important here is that I can put the slope of the linear ramp (for example, 10mV/s) and size level to make a smooth inclement. However when I want to measure an analog input signal he's going poorly.

    To reduce noise from the influences I want for example to measure 10 values for example within 0.1 second and he averaged (this gives reading should be equal or faster then the wrong caused by the slope and the linear ramp step size.) Example: a slope of 10 mV/s is set with a 10 step size. Each 0.1 s analog output signal amounts to 1 mV. Then I want to read the analog input in this 0.1 s 10 values)

    Because I use a timer to create the linear ramp and the analog input is in the same loop, the delay time also affects the analog input and I get an error every time. Separately, in different VI-programs (analog input and output) they work fine but not combined. I searched this forum to find a way to create the ramp in a different way, but because I'm not an experienced labview user I can't find another way.

    To book it now a bit more complicated I said I want to measure 2 input analog (one for the voltage of the potentiostat) signals and one for the current (also represented by a voltage signal) and they should be measured more quickly then the bad of the analog signal. I have not yet started with because I couldn't read on channel work.

    I hope someone can help me with this problem

    An array of index. You want to index the columns for a single channel.

  • Get information from change of color over time

    Hi all

    I am new to LabView and on this forum, so I hope I'm in the right subforum. If this isn't the case, it would be nice if a mod could move this thread.

    My problem is the following:

    Let's say I have a white spot I want to observe with a camera. The color of the spot turns green over time and I want to acquire the photo, as well as to get the color intensity of green increase developing countries over time. I do not know what features I need to use to get there. Can someone me hint in the right direction? I think that it is at least possible in LabView.

    Thank your all for your help.

    Best regards

    Tresdin

    I don't know what the best resource for IMAQdx pilots, I think that the examples that provide OR are pretty useful. Here's a simple VI which will tell you the average value of green of all the pixels in your image.

  • Laptop HP G62-451SA: cannot read the label for Office 2010 product key as it dissipated over time

    Obliged to restore settings after a total crash.

    Spent the whole day as recommended by HP, including using my recovery disk that has failed.

    Tried to open Microsoft Office 2010 as usual, but said to give the product key to activate it.  Mine is on a sticker on the bottom of my laptop.  Unfortunately it is place to be where it is that some of the numbers have disappeared over time.  Now I can read only the last 15 digits.

    Ages worn on Microsoft support pages and basically they said that the onus to solve this problem since I legally paid for it when buying their product to HP.

    I'll lose more than a year of work, if I can't get this sort.

    Thank you.

    The label on the bottom of your laptop is not for the office. It's your Windows license key. It should say Windows 7 Home Premium above the numbers.

    Most of the HP machines come with a trial of office unless order you it with more full Office and pay extra. The trial usually actually works after the period 60 day trial - unless you do a recovery. After a recovery it will require you to buy a license key to use.

  • create the voltage over time

    Is it possible to generate an output voltage on a DAQ 6009 A0? I have a data excel sheet that I put in a 2D array. The voltage is not constant over time. I have problems with the synchronization of the signal. I was able to trace the signal on a chart. This is the same as the original data to excel. I have two data streams. Voltage and time. But after separating the two signals how can I generate the graph?


  • Problems of memory on a loop on all characters in a document

    Hi all

    I'm trying to implement an export custom HTML of a part of the contents of a document.

    I have a loop that checks whether any character has a particular style (bold, italic...) and apply the corresponding tag inline (< strong >, < i >).

    This loop takes too long and makes inDesign to stop working. If I'm not mistaken, it's a memory leak problem. I searched these forums and other places and found no solution to my problem.

    From what I've read here, it seems that each of these memory problems is always in need, it's a particular solution. I hope that you will be able to help me with this one.

    This is my code:

    main();
    function main() {
      //Some code
      var txtFrames = //an array containing all TextFrame objects in the document
      var txtFramesLength = txtFrames.length;
      for (i = 0; i<txtFramesLength; i++) {
        var parLength = txtFrames[i].paragraphs.length;
        for (j = 0; j<parLength; j++)  {
          var contentsWithCharStyle = applyCharStyle(txtFrames[i].paragraphs[j]);
          file.writeln('<p>' + contentsWithCharStyle + '</p>');
        }
      }
      var charStyleName = '';
      var charContents = '';
      function applyCharStyle(paragraph) {
        var chars = paragraph.characters;
        var result = '';
        for (k = 0, kLength = chars.length; k<kLength; k++) {
          charStyleName = chars[k].appliedCharacterStyle.name;
          charContents = chars[k].contents;
          if (charStyleName == '_03-Bold') {
            result += '<strong>' + charContents + '</strong>';
          } else if (charStyleName == '_02-Regular-Italic') {
            result += '<i>' + charContents + '</i>';
          } else if (charStyleName == '_04-Bold-Italic') {
            result += '<strong><i>' + charContents + '</i></strong>';
          } else {
            result += charContents;
          }
        }
        result = result.replace(/<\/strong><strong>/g, '');
        result = result.replace(/<\/i><i>/g, '');
        return result;
      }
    }
    
    
    
    

    If the problem is repeated calls to applyCharStyle. . AppliedCharacterStyle recovery of tanks [k] and .silence tanks [k] are special operations doing anything to slow down.

    I guess that these properties are staying somewhere in memory every time.

    Thanks in advance for your help and your time. .appliedCharacterStyle Appl dfdwyCharStyle applyCharStyle applyCharStyle

    You can simply use a series of find/replace greps:

    find: (. +), applied the character style: _03-Bold

    set up: $ 1

    and so on.

    or at least use textStyleRange instead of the characters collection.

  • Over time fill color

    Hello, I am working on an audio model. I'm doing a waveform similar to that which you can see soundcloud. I managed to program an expression to generate the waveform. But I have a problem with filling the waveform with a color based on the time. For example, see you on soundcloud how the waveform fills orange along the song? This is the concept, I am working on that. Here's what I have so far:

    AEIMAGE.PNG

    I want the blue bar to move to the right over time, but I want only the white parts of the wave to turn blue it progresses (the rest of the hidden solid blue). How would I go to do this? My knowledge in After Effects is limited, so any help is GREATLY appreciated! Thank you

    Please let me know if you need more information

    So just to clarify you are trying create a representation of levels for the duration of an audio file and not an animation audio frequency analysis. If that's what you do just before compose hundreds of layers, or nest the comp in your main comp, then use the cache by approach. If it was me I would probably just import the audio layer in the comp, press the L key twice to reveal the audio waveform, press on the ~ key to make complete timeline screen, expand the waveform, take a screenshot, add the screenshot to the model, apply Keylight, then add a shape layer below the screenshot set the screenshot as a reverse alpha cache approach for the animated gradient and be done with it. This model should be nested in my main computer to complete the effect.

    If I wanted a different look for the waveform I edit the screenshot in Photoshop or use a Premiere Pro or any other program to capture a screenshot of the wave. Since you did all the work of your hundreds of layers I just would compose before them, place a layer of shape with a gradient animated below the pre-comp and put in place the track matte.

Maybe you are looking for