How do I programmat​ically set chart history length?

How do I programmatically set chart history length?

Hi, u could try instead of using a chart, u could use an xy graph with a chart buffer and with the chart buffer defining the length/amount points needed. And this also mimics what happens in a chart.
Stuart
Attachments:
XY_Chart_Buffer.vi ‏54 KB

Similar Messages

  • Why do i get crashes when setting chart history length

    I am trying to figure out how to get my chart to eat up less memory. At the moment it is capturing from 4 channels at 44100 samples/sec. It is a continuous capture and after a few minutes, the computer just runs out of memory and can no longer keep up with the capture, at which point the Vi quits. Opening up task manager, I noticed that as I capture, the memory gets chewed up really quickly, but when I stop my VI the used memory is not reclaimed. Even if I set the chart history to an empty array when the VI stops. I tried setting the chart history to a smaller number but whenever I set it below 512 the whole computer crashes.

    I have seen similar problems. I created a simple VI to test this and am continously getting LabView crashes when I try and write an intensity chart history to an array.
    First frame of the vi sequence generates a 100 random number array for the intensity chart display. The next frame in the sequence has the property node for chart history (of the intensity chart)set to read mode and it is wired to a two deminsional array.
    So, I generate psuedo chart data and then try to recover the history into an array. It crashes every time. No matter where I set the chart history length. I attempted to do as you had previously suggested and store the data to a file. Same response.... Crashes LabView. Local and online help have not been very hel
    pful. Will search the hardcopy literature now.
    thanx
    WLS
    Attached VI
    Attachments:
    history_grabber.vi ‏22 KB

  • Chart History Length

    Is there a way to programmatically change the Chart History Length of a Chart Graph Indicator?

    Hi Dude,
    no.
    Option:
    Use graphs and maintain your own buffer...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Programmatically changing chart history length

    I'm creating a VI where the user can choose the data sample rate via the wait(ms) used in a while loop. However changing the sample rate effects the time length being displayed on the chart. This is dependent on the chart history length, originally I thought I could just change this programmatically, but the history length doesn't appear on the property node.
    I've had a look at the advice in the ni support section:
    http://digital.ni.com/public.nsf/allkb/E9784F413A2269E086256F3A0064C8BB
    This method seems a bit messy (especially when I'll be doing this for a number of charts), although I couldn't open the example as its v7.1 and I have v7.0.
    Is there anything I can do?
    Help would be appreciated (deadlines approaching)

    The entire point of using a chart is that you update only the last value, so there is no point in writing the history data every loop. For that you can use a graph, which will allow you to do this without using a property node.
    The history length is not supposed to control how much data is currently displayed on the screen, but how many points are kept in the buffer, so you can scroll back and see them. When you change the length of the history data array, the chart doesn't seem to like it. It starts acting a bit crazy. Also, keep in mind that there is no point in displaying 1000 points if your chart is 600 pixels wide.
    There are problems with what you want to do, like if you add points, where do the extra points come from, or since a chart uses a constant multiplier, what happens to the old data when you change it and so on.
    I've modified your example slightly, so that it doesn't write to the property every time and so it handles the enlarging the history buffer case, but it's still buggy and needs more work.
    The main problem is that the History property doesn't change the chart length. If I understood you correctly, and you want to constantly display the last X seconds, I still think your only viable option is using a graph. The transition should be fairly simple and if you use a shift register it can handle it.
    Try to take over the world!
    Attachments:
    chart.vi ‏63 KB

  • How can I programmatically clear a chart?

    Hi,
    Could you please let me know how can I programmatically clear a chart? I would like to run a code multiple times and everytime I run it , the chart should be cleared . I tried to find a History property node but seems like there is no such properfy node for chart

    If I have conceived your problem clearly, there is of course history data property node for charts. You may get one by right clicking on chart 
    create>>Property node>>History data(which is last on list)  
    CLAD
    Passionate for LabVIEW

  • Snippet: "query" the chart history length programmatically

    Would have posted to this thread, but was concerned that the misspelled subject might keep it from being found by future searches.
    I have a brute force, inelegant, very mildliy tested workaround for programmatically determining the history length of a waveform chart.  In my app, I have a single chart on my gui that is meant to display history from any one of several duplicate test stations.  To help accomplish this, I wanted each station to have its own lossy queue whose size is equal to the chart history length.  Then, whenever the user chooses to look at a different station's data, I can simply copy the entire contents of the lossy queue over to the chart.  
    Here's how I "query" the chart history length programmatically:
    Note: Some of this feels a little dubious, but it has seemed to give correct results so far.  Specifically, several of the XScale properties seem to refer to the graphical rendering of the scale rather than an index # to the history data.   Can't guarantee this'll work for all combos of other properties -- I tested with a fairly generic, nearly straight from the box waveform chart.
    -Kevin P

    Intaris wrote:
    Hmm, any reason why you can't just do this?
    If you don't modify the Array, it's just copying a pointer, right?  Or does this operation automatically make a copy of the data and induce horrendous performance problems?
    That doesn't actually do what I need.  The "History" data array size works its way up from 0 to History Length as the app runs and data is written.  It *is* bounded, but until I fill the chart all the way up, this method won't reveal what that bound is.  I need to size up those lossy queues at the beginning of the program, before any data has been written to the chart.
    As to the other comments so far:
    - I chose charts over graphs to get some of the built-in features of charts for real time monitoring rather than having to manage them myself.  Things like zooming the X range, horizontal scrolling to show different segments of the history, that kind of thing.
    - just absorbed the followup comment about writing a dummy oversized array to the chart before running the quoted snippet above.  Yeah, that oughta work.  I just don't like the general case of not knowing how big a pre-write I need to do.  I guess it wouldn't be too bad to loop while writing the same big-but-not-crazy-big array until the History size is smaller than the # of samples written.  
      The main hitch I see in that approach is that I'd like this to be  a reusable utility vi, but a subvi that works by filling up the History would need prior knowledge of the chart datatype.  (Just thinking out loud here, overall it does kinda feel cleaner than the stuff I was doing with the scale properties.)
    FWIW, a little more testing led me to modify and simplify my snippet b/c the previous one might leave the X scale looking different on exit than it appeared originally.  Seems like a side effect of the way those properties are kinda more about the display of scale information than about actual index #'s.   Anyhow, here's v2, but hopefully someone else has a better generic v3 they can offer:
    -Kevin P

  • Graph & chart history length

    I was wondering why "chart" has got a "chart history length" property for the length of the displayed data, 
    but "graph" doesn't have such a "history length" property. 
    Why!?
    Solved!
    Go to Solution.

    Hi Cashany,
    you have to make your own buffers then.
    Well, there are examples coming with LabVIEW. There ARE examples showing how to use charts and graphs!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Set up history length programmatically

    Hi,
    I have a waveform chart and I would like if it is possible to change the history length programmatically. Is it possible?
    Thanks,
    ToNi.

    Hi,
    I have a waveform chart with a history length of 28800 points visible and I take a sample with a frequency of 1 second and I plot it. (I acquire data with and acquisition card). Then, I would like the user can choose the number of hours (1 to 24 hours) to visualize in the waveform chart from a configuration window and also he can modify the frequency to take the sample (1 to 60 seconds). Then each time he modify these parameters, the number of houres (1 to 24) and the frequency to take samples (1 to 60 seconds), I set up the history length from them doing the following operation:
    (60 seconds/frequency to take sample) * 60 minutes * number of hours = history length. (number of points taken during the hours you set up)
    where:
    (60 seconds/frequency to take sample)  : is the number of samples took during a minute
    (60 seconds/frequency to take sample) * 60 : is the number of samples took during an hour
    (60 seconds/frequency to take sample) * 60 minutes * number of hours: is the number of samples taken during the number of hours you set up
    So I only have the number of points in the history length necessary and not more.
    Thanks,
    ToNi.

  • Setting Chart History

    Is there a way where I can set the chart history to a user defined value while my program is running? Example, when the program starts running, the graph history is set to 200, so the max range for the x-axis is 200, once it gets to 200 the window will start shifting. I want the user to have control over this property. If the user wants the chart history to be 500, then I want to be able to set that property of the graph to 500 through my program. How would I be able to do this?

    I'm not sure what you're looking for. The graph has a ChartLength property that will allow you to specify how many points the graph stores while charting. If you would like to make this customizable in your application, you could provide a way to do this in the interface of your application. For example, you could create a dialog that has a text box or a numeric edit, then bring this dialog up from a menu and set the ChartLength property according to what they enter in the dialog. Is there something else that you were looking for from the graph for this?
    - Elton

  • How do I programmat​ically open block diagram?

    Hi, All
    How do I programmatically open block diagram of subVI and add frame to event structure
    Thanks,

    Could you be a bit more specific on what you are trying to do?
    Do you want to programmatically edit an existing VI that is currently not running? As mike said, scripting could work but it is unsupported (see the Lava scripting forum for details: http://forums.lavag.org/LabVIEW-VI-Scripting-f29.h​tml). Somehow, adding an event case does not give you much, you would also need to add the code contents and hook everything up to the existing controls, indicators, and other nodes.
    If you just need an event that is not always active during run, maybe you can use user events. Check the online help. (Also have a look at e.g. section 4 in the following application note:
    http://zone.ni.com/devzone/cda/tut/p/id/2994.
    LabVIEW Champion . Do more with less code and in less time .

  • How can I programmat​ically detect transition times in a digital waveform

    Hi, I have a digital waveform and at certain times I have transistions and glinches , how can I programmatically detect and record the time stamps of the transitions
    Thanks  

    Let me see if I understand you. You are reading 14 bits in parallel and you want to know how long between transitions of just one of those bits - say bit 11. Is this bit number constant or can the number of the bit in which you are interested change?
    Well, you could XOR the value from each read of the digital bits with the 14 bits you got from the previous read. If the resulting value of bit 11 is true, the state of bit 11 has changed. Use that flag to read/restart an interval timer. Of course the resolution of your measurement will be dependent upon the rate at which you are reading the 14 bit input. If you are only sampling the 14 bits every 500 msec, you obviously won't be able to measure intervals of less than 1/2 sec.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How do you programmatically add a chart effect

    Hi,
    I'm trying to create a reusable monthly chart component with
    the months of year and add various sets of data to it. I'm trying
    to add interpolation effects but because i might have between 2-10
    data sets I can't hard code a series effect in the mxml. My
    question is how do you go about programmatically adding these
    effects to each series?
    Many Thanks
    Murdo

    Basically, it takes three steps:
    Physically connect the USB printer to the USB port on the AirPort Express Base Station (AX).
    Using the AirPort Utility share out the printer.
    Configure your computer for the network printer.

  • Error -201402; how do you programmat​ically determine 'Samples per file' size

    Error -201402 - The samples per file is not divisible by the file write size. The error also give a suggested value to use, which is helpful, and i have amended by code to suit this value.
    I am writting to a tdms file in chunks, such as the first 2.5-5 seconds save the data (sampled at 1M samples per second per channel) to tdms files named initial.tdms, initial_0001.tdms (need to be able to split the files due large data size) then capture the remainder, such as 150 seconds of data (sampled at 1000 samples per second per channel) into a single file, remainder.tdms
    Example Inputs to the vi will be:
    Initial sampling rate = 1M
    Initial acquire time = 2.5 seconds
    Remainder sampling rate = 1000
    Remainder acquire time = 150 seconds
    What I want is to be able to programmatically set Logging.SampPerFile and maybe Logging.FileWriteSize to improve maintainablility and code reuse (I have a number of difference sequence patterns to generate/ capture.)
    I am also developing this code on a debug system which may have a different hard drive volume sector size so need to be able to derive the FileWriteSize based on this value, but don't know how to get/view this hard drive info.
    How do I go about this?
    Cheers,
    Helen
    CLD, CTD

    Thank you for your help.
    The Get Volume Info does indeed give me the Sector Size, however i still had problems with working out what multiple of the sector size to use.
    Based on "Samples per file - must be EVENLY divisible by the file write size" and "File write size - must be EVENLY divisible by the sector size" I have derived te following code snippet which ensures that the calculated SampPerFile is divisible by 4 (2 lots of evenly divisble by).
    Whilst this appears to work I wonder if anyone could comment/ suggest any pitfalls etc.
    Regards,
    Helen
    CLD, CTD

  • How do I programmat​ically modify array element sizes?

    Hi All,
    I have a quick question about modifying the size of array elements. Hopefully someone can help, because I am at a dead end!
    I am logging some intensities from a Fibre Array using a camera. For calibration of the system, I acquire an image from the camera, click points on the image to divide it into areas of interest. I overlay my image with a grid showing the regions of interst - for example a 4x6 array. I then have to select the fibres - or ROIs - I want to log from.
    I have a cluster type-def ( a number and a boolean) to specify the fibre number and to turn logging from that fibre on/off. I overlay an (transparent) array of this typedef over my image to correspond with the regions of interest. So here's my problem - I want to modify the dimensions of the array so each control matches my ROI. I can resize the elements by rightclicking on the elements on the frontpanel, but can't find a way to do it programmatically. The Array Property Node>>Array Element>>Bounds won't 'change to write'...thats the first thing I tried.
    Its really only important that the elements align with my ROIs - so programmatically adding in gaps/spacings would also work for me...but again I can't figure out how to do this! I've attached a screenshot of part of my image with array overlaid to show you all exactly what my problem is.
    Thanks in advance for you help,
    Dave
    PS I am running Labview 8.6 without the vision add on.
    Solved!
    Go to Solution.
    Attachments:
    Array_Overlay.png ‏419 KB

    Here's my cheat (and cheap?) way If you want to get fancy and center the numeric and boolean indicators, you could add spacers on the north and west sides, too.
    Attachments:
    ClusterSpacer.vi ‏13 KB

  • How to create programmat​ically a new step type in TestStand (to myTypes.in​i)

    I need to create a new step type to myTypes.ini file programmatically. I have tried to do it with following steps:
    - Get reference to engine
    - Load type palette files
    - creating new step type (engine.NewSteptype() )
    - Inserting new type using TypeUsageList.InsertType method. Problem with this is the first parameter. It excpects it to be in a form of PropertyObject, but engine.NewStepType returns it as a StepType object. If I try to use StepType.AsPropertyObject it returns an error.
    How to convert StepType object to a PropertyObject?

    And here it is in C++:
    TS::IEnginePtr mEngine;
    SAFEARRAY * typeList;
    TS::TypeUsageListPtr typeUseage;
    TS:tepTypePtr stepObj;
    mEngine = engine;
    mEngine->LoadTypePaletteFiles();
    typeList=mEngine->GetTypePaletteFileList();
    TS:ropertyObjectFilePtr *rgelems;
    SafeArrayAccessData(typeList,(void**)&rgelems);
    typeUseage = rgelems[0]->TypeUsageList;
    stepObj=mEngine->NewStepType();
    TS:ropertyObject *property = stepObj->AsPropertyObject();
    property->PutName("TestMe");
    typeUseage->InsertType(property, 0, TS::TypeCategory_StepTypes);
    rgelems[0]->IncChangeCount();
    rgelems[0]->SaveFileIfModified(true);
    SafeArrayUnaccessData(typeList);

Maybe you are looking for