Combining a circular buffer with dynamic data

Hello

I am trying to save data in a test that surrounds an impact event to determine the period during which the acceleration passes a certain threshold. I want to record a second of data before and after the event occurs, I put the threshold crossing. The duration will be about 10-15 ms, so two seconds of data at 10 kHz will be a lot of data. I have my VI written so far to export the data from the buffer to an excel file, but is it possible that I could record an extra second of data and it concatenate into what I already have? I usually use the express VI of data collection for dynamic data collection and report generation specific excel live for static data, but how could combine the two?

Any kind of conceptual thinking would be much appreciated.

Thank you!

What I've done in the past, is to use a queue of fixed size with the queue with loss to store data (is like a circular buffer).  Then, when the threshold is detected, recording a 1 second.  Your queue should now have 2 seconds of stored data that you can then write just to your file (use the status of the queue to get data without emptying the queue).

Tags: NI Software

Similar Questions

  • Circular buffer with reference

    I create two measurement systems that will enjoy air with instruments 13 and 10 respectively. I communicate with instruments through the series, MODBUS TCP, voltage and current. In order to synchronize the data of different instruments (which have their own data rate) in the stream, I need basically a circular buffer by instrument. I wish to add to each buffer circular instruments in a loop for each instrument and have a timed loop that records the data in a file by reading all the instruments circular buffers. Circular buffers must also be able to give me data that are not the most recent data.

    How can I create a circular buffer that I can add items to a loop and read another looping? I would prefer something but who uses a reference that I can pass both the loop of the instrument (producer) and save data of loop (consumer), like the queue works in Labview, I don't know how to implement this in a good way.

    Use LabView 2010 Fall edition...

    Thank you

    mrsound

    Native queues in LV 2010 allow you to create a circular buffer if you are using the antiderivative of Lossy Enqueue.

    Warnings:

    1. You must specify the size of the queue when get everything first, if you can not resize dynamically.

    2. To play the buffer, you can use the primitive that returns the queue information and wire a T in the items back? entry (very important to remember it). This will create a copy of the data in the queue.

  • Track of multiple graphs on a single diagram of waveform with dynamic data types

    I'm putting multiple charts on a single diagram of waveform and data contract error. I was wondering if it has something to do with the fact that the dynamic data is used (I have had no problem with other types of data in the past). Does anyone know how to fix this? I have attached the following .VI. There will be a lot of. Live on the bottom which does not load, but they are not related to this problem.

    Thank you!

    Brian

    I don't know what you're doing now, but a part of your origianl code is simply ridiculous. Your DAQ assistant takes a single point. You convert that into an array. If you had converted into a scalar value (which is) first place, your graphics update would have been fine.

    If you want to remove the DAQ Assistant, and then select generate DAQmx code. You'll be a little more closely, but it seems that it generates a NChan DAQmx Read 1Samp instead of a 1Chan 1Samp DAQmx read.

  • The implementation of (linear) average moving in a Subvi with dynamic data?

    I was wondering how to implement a moving or linear bearing on average using a Subvi on a set of dynamic data from the DAQ Assistant or a meter input channel that is written by using the writing custom file VI?  Here is an example of what I mean.

    You can use the vi MeanPtbyPt to give the running average.  Assuming that your code snippet is inside a loop, wire one = 0? Comparison between the number of iteration to initialization of entry to reset the value to 25 (or whatever) as the length of the sample.

  • How to make a hyperlink with dynamic data from a php database table?

    Level - the rare user Dreamweaver

    I have a couple of master / detail standard of pages using MySQL and PHP. This feature works correctly. Among the items of data in the Details page contains the name of a PDF file (including the .pdf suffix). PDF files are stored in the library of PDF documents under the root of the Site. I am eager to the ability of the user to the page to watch the associated PDF. Keep it as simple as possible I just put in place a text field "View report" followed dynamic text for the name of the document. I tried to set the properties of the links with the library name PDF files (more the root level) followed by the code, I thought that it was necessary to determine the selected PDF (<? php echo $row_rslivesDetail ['link'];? >). The first part is correct, because when the code does not have I changed it to a PDF fixed and that worked. I have tried various combinations but failed. Can anyone please suggest what I'm doing wrong with the code.

    Concerning

    Cliff

    I think you have your recordset named incorrectly. The image you provided according to me it should be: (see highlighted in RED below)

    ">View the report

  • XmlElement with dynamic data

    Hello

    I have a Table donnees_xml with 2 rows as follows:

    depose1 Field2
    xbrli:StartDate 09.11.2010
    10.11.2010 xbrli:EndDate

    I want to generate XML data and I tried the following

    for x in (select depose1, donnees_xml Field2)
    loop...
    var_filed1: = x.filed1
    Select xmlelement (var_filed1, x.filed2)
    of donnees_xml;
    .....

    the problem is that the generated output looks like this
    < var_filed1 > 09.11.2010 < var_filed1 > < var_filed1 > < var_filed1 > 10.11.2010

    Is there a way to get a result like this

    < xbrli:Startdate > 09.11.2010 < / xbrli:Startdate > < xbrli:enddate > 10.11.2010 < / xbrli:enddate >

    Thanks in advance

    MDK.

    1. Please read the guidelines of display ad. It is much more polite provide a script to configure your examples of data then just typing in values, since it allows to save the person who takes the time to solve your problem of having to create said...

    for example

    SQL> create table XBRL_ITEMS
      2  (
      3    ITEM_NAME VARCHAR2(512),
      4    ITEM_VALUE VARCHAR2(512)
      5  )
      6  /
    
    Table created.
    
    SQL> insert into XBRL_ITEMS values ('xbrli:Startdate','09.11.2010')
      2  /
    
    1 row created.
    
    SQL> insert into XBRL_ITEMS values ('xbrli:enddate','10.11.2010')
      2  /
    
    1 row created.
    
    SQL> commit
      2  /
    

    2. Please indicate what database, you work with

    for example

    SQL> select * from V$VERSION
      2  /
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL>
    

    The answer is by using evalname

    for example

    SQL> set lines 128
    SQL> column XBRL_ITEM FORMAT A128
    SQL> select xmlElement(evalname(ITEM_NAME),ITEM_VALUE) XBRL_ITEM
      2    from XBRL_ITEMS
      3  /
    
    XBRL_ITEM
    --------------------------------------------------------------------------------------------------------------------------------
    09.11.2010
    10.11.2010
    

    However, your output is junk... The date is not correctly formatted by XML / XBRL standards and the xbrli of namespace prefix is not defined. These two will probably cause you problems if you try to do any further XML processing on the results of your query.

    The correct solution is

    SQL> select XMLELEMENT(evalname(ITEM_NAME),xmlAttributes('http://www.xbrl.org/2003/instance' as "xmlns:xbrli"),to_char(to_date(ITEM_VALUE,'DD.MM.YYYY'),'YYYY-MM-DD')) XBRL_ITEM
      2    from XBRL_ITEMS
      3  /
    
    XBRL_ITEM
    --------------------------------------------------------------------------------------------------------------------------------
    2010-11-09
    2010-11-10
    

    Also, if you treat XBRL you will want to monitor for an announcement of the Extension of XBRL Oracle XML DB in the very near future...

    Published by: mdrake on November 28, 2010 07:28

  • Insert several lines with dynamic data

    Hello
    When I do an insert into a table that has several lines of dynamic information. on
    a page, it inserts all rows that are dynamically filled. I want only what he
    to insert the lines that I choose the initials on. How can I do? Let's say I
    have 5 items that are displayed on a page and I want to insert only original
    the first 2 because the last 3 are left blank, how should I do this? I tried
    implementation of an if statement that says:

    < cfif "form. "Help of # PNR_Approval_Initials #" NEQ "" > "".

    Then make the insertion in the table

    < cfelse >
    < / cfif >

    I have this game were also up in a loop that says:

    < cfloop index = "help" list = "" #form.listofids # "delimiters =",">"

    Here is the code for just the insertion. I also have a code here
    Update another table. I got this to work, so I just try to get the insertion
    works fine for the moment. I can not use this where the query statement:
    Where ItemID = #id # because I'm trying to insert into the table of approval, not
    the items table. The table is just updated with some other info. in
    a few other input boxes.

    < cfloop index = "help" list = "" #form.listofids # "delimiters =",">"
    < cfif "form. "Help of # PNR_Approval_Initials #" NEQ "" > "".

    < cfquery Datasource = '#application. DataSource #">"
    Insert into accreditation (APV_ItemID,
    APV_ECID,
    Document_Type,
    Approval_Initials)

    Values (' #Evaluate ("form.) (' ItemID # help # ") #',
    ' #Evaluate ("form. ("ECID # help #") #',
    < cfif isDefined (form '. ') ("Help of # PNR_Doc_Type # ') and
    "form. "Help of # PNR_Doc_Type #" NEQ "" > "".
    ' #Evaluate ("form. ("Help of # PNR_Doc_Type # ') #',
    < cfelse >
    NULL,
    < / cfif >

    < cfif isDefined (form '. ') ("Help of # PNR_Approval_Initials # ') and
    "form. "Help of # PNR_Approval_Initials #" NEQ "" > "".
    ' #Evaluate ("form. (Aide de # PNR_Approval_Initials #») #
    < cfelse >
    Null value
    (< / cfif >)

    < / cfquery >

    < / cfif >
    < / cfloop >

    On the page display, just a table of dynamic info. Here are the 4
    things that I have on this page that needs to be inserted to the database.

    < input type = "hidden" name = "' ECID #ItemID #" value = "#ECID #" > "
    < input type = "hidden" name = "' ItemID #ItemID #" value = "#ItemID #" > "
    < input type = "hidden" name = "" PNR_Doc_Type #ItemID # ' value = "PNR Req" > "

    < td align = "center" >
    < cfif Approval_Initials is not "" > "".
    #Approval_Initials #.
    < cfelse >

    < select name = "PNR_Approval_Initials #ItemID #" >
    < option value = "" > select initials < / option >
    < cfloop query = "ShowInitials" >
    < Cfif Engineer_Initials EQ 1 >
    < option value = "#Initials #" > #Initials # < / option >
    < / cfif >
    < / cfloop >
    < / select >

    < / cfif >
    < table >

    Can someone help me please on just the insertion in the database so that it
    will insert on the lines that I chose the initials on and not others? Thank you.

    Andy

    You almost managed, but I see that you have commented.

    (" The help of # PNR_Approval_Initials # ') AND form ["PNR_Approval_Initials # help #" ""] NEQ "" >

    Do things here

  • Plot multiple charts XY (dynamic data type)

    Hello world

    I searched but could not find the solution. I'm tracing several XY graphs with dynamic data type.

    I have here an example five 2D-arrays of X/axis Y to draw.

    I need them in dynamic data in order to trace in Diadem using Diadem protocol.vi.

    I get all the values of the X/Y axis as values Y.

    Any help is really appreciated,

    Yan.


  • dynamic data in the formula is originally running slow and weird results

    I am collecting 11 channels of analog input voltage, then perform a series of calculations (different, editable) on each channel of the voltage to convert each temperature sensor.

    My first step in calculations (with the help of multiply, subtract and divide blocks) works very well.

    My second step of calculations (which includes a natural logarithm "ln") is performed with the formula block. However, the formula block has three red arrows where are the constants of entry, and the results of the formula block are intermittent and incorrect (if drawn, drop the lightning just drawn what looks like a value of 1 intermittently... If saved to a csv file, the results show a bunch of zeros and then a row of values, then more zeros).

    I don't know if I need to convert my dynamic data in a table before feeding in the formula, or if there is another way by applying a complex formula of dynamic data, or...? I would stick with dynamic data because it makes tracing easier, but I'm open to other suggestions.

    The answer is very simple- do not use Dynamic Data.  I have never understood why NEITHER created this (other than to show "how easy it is to collect the DAQ and screw Express Wizard" (and not to mention that you lose a lot of control over what you do).)  There have been many questions here in the Forums and a number of players with a lot more experience I have also made the same recommendation.

    I don't know where the dynamic data in your case.  If it came from the DAQ Assistant, by all means read this and get rid of this wizard!

    Bob schor

  • Buffer with data multiple plots solutions

    How to create a buffer zone of 5 min with multiple display of data plots?

    My data consist of a waveform (worms, dt and y) there is a 2D array.

    I tried to use the circular buffer found on the forum EITHER but who can't do several display field data.

    Any body else had this problem before? Please help

    Okay, so now we're getting somewhere now that you have provided a bit more information.

    Now, I went and spent too much time working on it. Find out what I did in the attached screws. Essentially, I wrote my own waveform that has a table in it instead of a 1 d and then modified 2D your attached VI buffer to work with 2D table. I hope this helps.

    There is certainly a better way to do it, but I kinda blacked out and went with it. You will see in the main VI I had to convert from a range of waveforms of a wave of 2D data and then come back. It is a little bit of extra memory and work for labview each iteration, but I guess it's ok.

  • Smart way to save large amounts of data using the circular buffer

    Hello everyone,

    I am currently enter LabView that I develop a measurement of five-channel system. Each "channel" will provide up to two digital inputs, up to three analog inputs of CSR (sampling frequency will be around 4 k to 10 k each channel) and up to five analog inputs for thermocouple (sampling frequency will be lower than 100 s/s). According to the determined user events (such as sudden speed fall) the system should save a file of PDM that contains one row for each data channel, store values n seconds before the impact that happened and with a specified user (for example 10 seconds before the fall of rotation speed, then with a length of 10 minutes).

    My question is how to manage these rather huge amounts of data in an intelligent way and how to get the case of error on the hard disk without loss of samples and dumping of huge amounts of data on the disc when recording the signals when there is no impact. I thought about the following:

    -use a single producer to only acquire the constant and high speed data and write data in the queues

    -use consumers loop to process packets of signals when they become available and to identify impacts and save data on impact is triggered

    -use the third loop with the structure of the event to give the possibility to control the VI without having to interrogate the front panel controls each time

    -use some kind of memory circular buffer in the loop of consumer to store a certain number of data that can be written to the hard disk.

    I hope this is the right way to do it so far.

    Now, I thought about three ways to design the circular data buffer:

    -l' use of RAM as a buffer (files or waiting tables with a limited number of registrations), what is written on disk in one step when you are finished while the rest of the program and DAQ should always be active

    -broadcast directly to hard disk using the advanced features of PDM, and re-setting the Position to write of PDM markers go back to the first entry when a specific amount of data entry was written.

    -disseminate all data on hard drive using PDM streaming, file sharing at a certain time and deleting files TDMS containing no abnormalities later when running directly.

    Regarding the first possibility, I fear that there will be problems with a Crescent quickly the tables/queues, and especially when it comes to backup data from RAM to disk, my program would be stuck for once writes data only on the disk and thus losing the samples in the DAQ loop which I want to continue without interruption.

    Regarding the latter, I meet lot with PDM, data gets easily damaged and I certainly don't know if the PDM Set write next Position is adapted to my needs (I need to adjust the positions for (3analog + 2ctr + 5thermo) * 5channels = line of 50 data more timestamp in the worst case!). I'm afraid also the hard drive won't be able to write fast enough to stream all the data at the same time in the worst case... ?

    Regarding the third option, I fear that classify PDM and open a new TDMS file to continue recording will be fast enough to not lose data packets.

    What are your thoughts here? Is there anyone who has already dealt with similar tasks? Does anyone know some raw criteria on the amount of data may be tempted to spread at an average speed of disk at the same time?

    Thank you very much

    OK, I'm reaching back four years when I've implemented this system, so patient with me.

    We will look at has a trigger and wanting to capture samples before the trigger N and M samples after the outbreak.  The scheme is somewhat complicated, because the goal is not to "Miss" samples.  We came up with this several years ago and it seems to work - there may be an easier way to do it, but never mind.

    We have created two queues - one samples of "Pre-event" line of fixed length N and a queue for event of unlimited size.  We use a design of producer/consumer, with State Machines running each loop.  Without worrying about naming the States, let me describe how each of the works.

    The producer begins in its state of "Pre Trigger", using Lossy Enqueue to place data in the prior event queue.  If the trigger does not occur during this State, we're staying for the following example.  There are a few details I am forget how do ensure us that the prior event queue is full, but skip that for now.  At some point, relaxation tilt us the State. p - event.  Here we queue in the queue for event, count the number of items we enqueue.  When we get to M, we switch of States in the State of pre-event.

    On the consumer side we start in one State 'pending', where we just ignore the two queues.  At some point, the trigger occurs, and we pass the consumer as a pre-event.  It is responsible for the queue (and dealing with) N elements in the queue of pre-event, then manipulate the M the following in the event queue for.  [Hmm - I don't remember how we knew what had finished the event queue for - we count m, or did you we wait until the queue was empty and the producer was again in the State of pre-event?].

    There are a few 'holes' in this simple explanation, that which some, I think we filled.  For example, what happens when the triggers are too close together?  A way to handle this is to not allow a relaxation to be processed as long as the prior event queue is full.

    Bob Schor

  • Write to the file of measurement with a loop For using the value of the dynamic data attributes

    I looked and looked, but couldn't find a solution for this.

    I currently have 15 points of different data that I try to write in an Excel file.  I have all combined in a table and lie with the function "write into a file position.  However, the column names are always "Untitled", "Untitled 1" etc.  I then used the function 'Set the Dynamic Data attributes'; but for this I have to do 15 different functions "set data dynamic attributes.  It was suggested to use a loop with the function 'Set the Dynamic Data attributes' inside of her, but I can't find how do.

    I have several arrays consisting of 15 different values for 'Signal Index' 'Name of Signal' and 'Unit', but also a unique 'get Date/Time In Seconds' related to 'Timestamp '.  The problem is that the error I get when I try to connect the output with Scripture at the entrance to measure file:

    The source type is dynamic data table 1 d.  The type of sink is Dynamic Data.

    How can I fix it?  I have attached a picture of my installation; Sorry if this is gross (I'm new on this!).  Thank you!

    It will get rid of the error, but it is not quite correct. What you need to do after that is to click on the output or the tunnel entry and select 'replace with the shift register. In addition, the array of values that you have wired to the Signal Index is wrong. Arrays are 0 based. Just wire the iteration Terminal here. And, finally, take the size of the table and this connection to the N terminal are stupid. Don't wire nothing to this.

  • How to combine real-time video with LabVIEW indicators so that the video can be displayed and saved with the overlay data

    Let's assume for the moment that I can find a device for which LabVIEW has the appropriate drivers.  Is it possible to combine the camera feed with digital indicator fields so that there is a video out showing the data superimposed on the live image?

    I'm talking about something like a screen of the camera where you see the camera settings are displayed on the image in the viewfinder.  Note I have one isn't about analysis of video data or somehow reading parameters of the camera to the camera.  Data would be temperatures, pressures, speeds, etc., acquired by different instruments at the same time the video is captured and processed somehow by LabVIEW.

    No problem Wildcatherder, don't let me give you an overview of the process.

    When you get a video acquisition method entry, it will be an image format. Essentially, it's a bunch of images that are updated at the speed of video capture, just like the material. There are screws express (wizard - like elements) that simplify the obtaining of images from your video source. With the drivers and measurement and Automation Explorer installed, you should be able to get at least the image.

    If you have IMAQ toolkit, I mentioned, you could just wire the reference image (a purple wire wavy) and a text input (say, a temperature that is converted to a string) in the text overlay VI and it would produce the desired effect. Without this, you will need to convert the Image into image (these are two different data types in LabVIEW) and use the image instead, editing tools (essentially replacing pixels in 2D image data). You would then update an indicator of the photo with your photo altered, if all goes well to the pace of the acquisition hardware. As I said this is less elegant and can take a certain amount of time processor. If you view these images at all and are just their routing, it should be slightly faster.

    I don't know about video production equipment, I mainly used entry Firewire or USB, the computer screen or the file data. However, if the driver exists, it should be possible, but a quick review of the functions doesn't seem to come with output functions. Cannot advise on hardware, but you can start with:http://sine.ni.com/np/app/main/p/bot/no/ap/vision/lang/en/pg/2/sn/n17:vision, n21:11600 /?

    Kind regards

    Mello

  • How to create personalized with a dynamic date stamps

    I tried to create a customized with a dynamic date stamp. But the date is not dynamic. Help, please

    There are a number of things that need to be properly configured for a stamp to work as a dynamic stamp, form the name of template to the calculation script. If you provide the details of how you set the PDF stamp, it would be useful, as would the next book that has all the information you need: www.amazon.com/About-Stamps-Acrobat® - without paper-Workflows/dp/0985614706 /.

  • Graph of the Excel data with overlay of dynamic data acquisition

    Hi all

    I was next to the forum of Labview for about a year, it's the same with my programming so I'm a little rusty. I don't have someone code this for me, but just a quick plan high level to point me in the right direction.  I am able to work through the tutorials Excel etc.

    Task 1: Basically, I have a set of data Excel (2 to 6 columns of figures, not the time) I want to read in Labview and throw in a XY graph as the base model that remains visible all the time.  This data set is quite long, length vs. size (length is 100km, 1 m intervals). I essentially want a scroll X graph to display all of the data.

    Task 2: Acquire a direct serial data string which will be superimposed on the graph of task 1 model. Acquired essentially data comparing data in real time to previously.

    In the past, I made the simple projects with Excel data reading and also the reading of data in series.  What I'm not clear on is how to create the (static) graph with Excel data model while superimposing live data as it comes.  It is the basis of an annual check of the investigation process.

    Advice on the process would be appreciated so I'll be working through the nuts and bolts.

    Cheers for any help,
    Wes

    If you are worried that your data sets is too large, then run a test with simulated data to see how LV takes it. You might be surprised. In all cases, you should be aware that the chart control will need to redraw it with any changes you do anyway, and as far as I know, having a large amount of data is the main thing that can make a slow chart control. If you find that you have too much data, you might need to decimate it you based on how much you zoom before putting it in the graph.

Maybe you are looking for