Trouble creating a circular buffer

I am using a DAQ-6024E multifunction IO card with LabVIEW 6.1. I am trying to play out encoded signals that are in a database. These signals are encoded in binary and decoded by a previous portion of the VI. This decoded data is then normalized at the start of the code that I provided, then sent to the DAQ card. I have tried several implimentations and this is the only one that seems to work properly for the most part. I am getting glitches, however every couple of thousand samples where it seems to drop about 100 samples or so. I am new to this and am sure that I am doing something incorrectly. If someone could take a quick peek and tell me what the problem might be, I would greatly appreciate it.
Attachments:
sample.vi ‏43 KB

I tried running your VI, but there were many broken lines and missing controls, so it was kind of difficult to see what was happening. One thing I would suggest is using AO Configure to configure the system for Analog Output first. Also, try keeping a count of the number of updates done so that you can compare that with what you should have done. This may give you an idea of what's going on. Let us know what you find out.
J.R. Allen

Similar Messages

  • Is there any way to create a circular buffer using the INSERT ARRAY function?

    I saw the example using the REPLACE ARRAY function, but it uses too much CPU power on my laptop. I'm using it for a very sensitive application and saw that the INSERT ARRAY function used much less CPU power.
    I am also not wiring the index on the INSERT ARRAY function so that whatever is read from the buffer is added to the array.
    However, since it is not indexed, I don't know how to set the "write" index back to 0 when it reaches a certain sized array (ie 1000 elements). I was looking for an array property node, but couldn't figure out if one exists for the "current write index".
    Can anyone help?
    Thanks

    I will try to answer this question to my best understanding. I apologize if I interpreted the question wrong.
    You are using the "Insert Array" vi without wiring the index. By doing that, new elements will be added (appended) to the array.
    If you just want to know the current index to stop your acquisition when the array reach certain amount of elements, then you can use the "Array Size" vi to keep track of the size of the growing array. Remember that Array Size = last index + 1 because the index start at zero.
    A second option is that you may want to start over the array when it hits the maximum number of elements that you will allow. If that's the case, then you may want to re-initialize the array to a NULL state by stablishing a condition (for example, when the
    size of the array is 1000, re-initialize). I provided an example attached to this message showing how this can be accomplished. In the example, an 1D array grows in size using the "Insert Array" vi and inserting a random number. When the array reach 4 elements, it is re-initialized. You can expand this example by saving the array first to a file or some other holder before re-initializing the array. The example is in LabVIEW 6.
    Finally, if you want to replace the current values with new values, I think you do not have other choice but to use the "Replace Array" vi.
    Hope this can be of help.
    Regards;
    Enrique Vargas
    www.vartortech.com
    Attachments:
    array_example.vi ‏20 KB

  • "End of File" error 4 when trying to use Advanced TDMS Palette to create a circular file buffer

    I'm using the Advanced TDMS palette to create an on-disk circular buffer. I was able to successfully implement the buffer for a single channel of data.
    However, when I try to write multiple channels of data, I continuously get "End of File Encountered" error 4. I am pre-allocating 60,000 data points for each channel using the "TDMS Set Channel Information" function.
    I am able to (1) Set Next Write Position and (2) perform an Asynchronous Write to the first channel. But when I try to Set Next Write Position to the second channel, I immediately get an error 4.
    The examples have not been helpful as none of them write to different channels in sequence.
    Attached is an example project of what I'm trying to do, coded in 2013SP1.
    Sorry about the file hierarchy, the project is located in the ZIP file here:
    Workspaces\V12000\_V12000 Common Labview Code\Named WF Array\Named WF Array.lvproj
    http://linkd.in/mikele
    Attachments:
    Named WF Array Project.zip ‏1500 KB

    I looked into your project and found that the error comes from Set Next Write Position because the "offset" passed in is out of range. In fact, for continueous logging, you don't need to put the Set Next Write Position in front of the write. Remove this function and you will find your VI can run successfully without throwing out any errors.

  • Enumeration with Circular Buffer

    Hi, im having trouble with the enumeration of Circular Buffer .
    I had compilation errors with the Ring Buffer Class, it keeps pointing to public Enumeration elements () {return new RingBufferEnumeration(this);}
    Any advice ? Thanks
    This is the RingBufferEnumeration Class code
    public class RingBufferEnumeration implements Enumeration {
    private RingBufferNode firstFree, firstFilled;
         public RingBufferEnumeration(RingBufferNode a) {
              firstFree = new RingBufferNode(a);
              firstFilled = firstFree;
              firstFree.next = firstFree;
    public boolean hasMoreElements(){
      return firstFilled != firstFree;
    public Object nextElement () {
    return firstFilled= firstFilled.next;
    }this is the Ring Buffer Code
    public class RingBufferQueue implements Queue {
          * initialize an empty ring buffer queue
         public RingBufferQueue () {
              firstFree = new RingBufferNode(firstFilled);
              firstFilled = firstFree;
              firstFree.next = firstFree;
         private RingBufferNode firstFree, firstFilled;
          * Determines whether the collection is empty
          * @return true if the collection is empty
         public boolean isEmpty() { return firstFilled == firstFree; }
          * Determines number of elements in collection
          * @return number of elements in collection as integer
         public int size () {
              int count = 0;
              RingBufferNode p = firstFilled;
              for (; p != firstFree; p = p.next) count++;
              return count;
          * Yields enumerator for collection
          * @return an <code>Enumeration</code> that will yield the elements of the collection
          * @see java.util.Enumeration
         public Enumeration elements () {return new RingBufferEnumeration(this);}
          * add a new value to end of the collection
          * @param value element to be inserted into collection
         public synchronized void addLast (Object val) {
              if (firstFree.next == firstFilled)
                   firstFree.next = new RingBufferNode(firstFree.next);
              firstFree.value = val;
              firstFree = firstFree.next;
          * access the first value in collection
          * @return element at front of collection
          * @exception java.util.NoSuchElementException no matching value
         public Object getFirst () {
              if (firstFilled == firstFree) throw new NoSuchElementException();
              return firstFilled.value; }
          * remove first value in collection
          * @exception java.util.NoSuchElementException no matching value
         public synchronized void removeFirst () {
              if (firstFilled == firstFree) throw new NoSuchElementException();
              firstFilled = firstFilled.next;
    class RingBufferNode {
         public Object value;
         public RingBufferNode next;
         public RingBufferNode (RingBufferNode n)
              { next = n; }
    }

    im not sure is it a RingBufferNode but, im sure it is not indexed data for ring Buffer
    My IndexDeque is working correctly
    public Enumeration elements () { return new IndexedEnumeration(this); }IndexedEnumeration
    public class IndexedEnumeration implements Enumeration {
          * initialize newly created IndexedEnumeration
          * @param d collection to enumerate over
         public IndexedEnumeration (Indexed d) { data = d; }
         private Indexed data;
         private int index = 0;
          * see if enumeration should continue
          * @return true if enumeration has at least one more element
         public boolean hasMoreElements () { return index < data.size(); }
          * get next element in enumeration
          * @return value of next element in enumeration
         public Object nextElement () { return data.elementAt(index++); }
    }

  • Fastest array operations on a 2D circular buffer

    I'm trying to create a a type of circular buffer on large-ish set of 2d data which are samples of voltage from a data acquisition board.  The boards are Measurement Computing and a lot of the nice programming features built into DAQmx for NI boards aren't easily available to me.
    I'm grabbing chunks of samples, 1000 per channel * 64 channels, every 100ms.  I'm calling this a 'page'.  For each page of samples I take a median for noise filtering and then I publish this median for multiple threads to use.  I also want to be able to string together pages of samples as if it were one longer data acquisition, for up to 30 seconds.  I'm doing it this way because the threads that are expecting their data every ~100ms can't release these AI boards for long periods of time to allow other threads to use them to perform long scans.  The data coming back from my boards is a 2D array.
    I have enough RAM available to pre-allocate the memory to hold all these pages and I've been playing with the In Place structures for awhile now and I haven't been able to land on the magical combination that will allow me to replace any page in the buffer.  It's easy enough using the subarray option of the in Place to replace either the first page or the last page but it gets more complicated to do a page somewhere in the middle without having to resort to Case statements.  I tried to do it with nested In Place structures but it seems as if the subarrays that get created in the lower levels already go out of scope by the time the top level gets it assigned and I just get jibberish on the output side.  Does this make sense?

    SmokeMonster wrote:
    I tried to do it with nested In Place structures but it seems as if the subarrays that get created in the lower levels already go out of scope by the time the top level gets it assigned and I just get jibberish on the output side.  Does this make sense?
    Sorry, but at least to me, this doesn't make sense.  Can you post your code?  I can't see how "out of scope" is a concept that applies here - LabVIEW keeps track of the memory for you and should never lose track of memory that's still in use.
    I posted one approach to a 2D circular buffer; maybe it's of some use to you.

  • I'd like to know how I can acquire a waveform on a loop and do a circular buffer with this waveforms I will acquire, cause I want to reduce the noise.

    I'm using trigger for this data acquisition.

    deco,
    If you really want a circular buffer, how much data do you want it to hold? One acquisition? Two? Three? Once this is decided, you will need to create the waveform and then continuously strip the old data out and place the new data in. This will add a bit of overhead to your VI.
    There are also software noise filters in LabVIEW that you can use to reduce the noise in your signal.
    Lastly, if there is a lot of noise, you may want to consider an SCXI system which will filter out most of the noise as the data is being acquired.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • How to implement multiple queues in one circular buffer?

    Spoiler (Highlight to read)
    Recently I have successfully shared data of 2D array among different vis in a project, using circular buffer.
    However, there is only one circular buffer allowed in one project for one data type.
    I want different vis, running and getting data from circular buffer in different speed, all getting data as a queue from circular buffer. Like the circular buffer's read continuous mode.
    The problem is that after a vi reads in continuous mode, the read data is deleted from the circular buffer. Then other vis can not use them any more and can not keep track where they should begin to read again.
    So if it is possible that there are multiple pointers or queues in circular buffer to keep track the progress of different vis, and data only update when it gets input from DAQ but not deleted when read?   

    LawrenceChong wrote:
    Spoiler (Highlight to read)
    Recently I have successfully shared data of 2D array among different vis in a project, using circular buffer.
    However, there is only one circular buffer allowed in one project for one data type.
    I want different vis, running and getting data from circular buffer in different speed, all getting data as a queue from circular buffer. Like the circular buffer's read continuous mode.
    The problem is that after a vi reads in continuous mode, the read data is deleted from the circular buffer. Then other vis can not use them any more and can not keep track where they should begin to read again.
    So if it is possible that there are multiple pointers or queues in circular buffer to keep track the progress of different vis, and data only update when it gets input from DAQ but not deleted when read?   
    THe last time I wrote a multi-subscriber cirular buffer was in LV 6. Since then I have found that polymorphic queues perform much better so I now use multiple queues. One queue for each subscriber of the data. The subscribers are then responsible for maintaining their own histories.
    So just use multiple queues.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • I have trouble creating a pdf portfolio from Outlook: the result does not have "From" or "Subject"

    I have trouble creating a pdf portfolio from Outlook: it creates the portfolio, but the result does not have "From" or "Subject" in the index.  Please help!

    Thank you, I am aware of this function.  The fields are present, but blank.  (It seems that the data is not getting exported…)
    Please keep trying to help me!
    -Nancie

  • Trouble creating pie-chart

    Post Author: ujain82
    CA Forum: WebIntelligence Reporting
    Hello,      I am having trouble creating pie chart. I am calculating different count values from different data providers. Now I need to create a pie chart showing the proportion for each count as I can find the percentage of count.
    My scenario(task):I need count on persons depending on searching on complaint text. So for each search I have a data providers. Like this I am searching for 8 criteria. So I have different data providers for each search. I get person counts from each criteria.
    Now I want to show it in a pie chart. But I could not make it done.Does anyone faced a similar problem? How do I solve my problem?
    Any comments?

    Post Author: Chris Chen
    CA Forum: WebIntelligence Reporting
    Hi ujain82,
    Because you have some data provider,so some metric may have no conjunction,i suggest that you creat variables to reuse them.

  • Trouble Creating Forms in Dreamweaver

    Hello,
    I am having trouble creating a form in Dreamweaver for my website.  The form is fairly basic, just some contact/comment input required.
    I created my webpages using Fireworks CS4 and exported them as HTML and Images.  The basic format of my website is to have a rectangular block in the middle of the page, where the form elements are supposed to be entered.  However, it seems that I cannot simply add a textbox or textarea to the middle of my page.  If I try, everything gets shifted around very strangely.
    How can I leave the format of the page intact, but add in the form elements (name, email, comments)?
    You can see the page here: http://www.wafflesnjoe.com/preview/contact.htm
    Thank you

    Thanks Murray, I had a feeling that that's where I'd be headed.
    Is there a more seamless way of transferring webpages from Fireworks to Dreamweaver, such as CSS and Images, that would make it easier for me to work in Dreamweaver?
    Would you recommend building websites in Dreamweaver, and not bother with Fireworks?
    Sorry for all the questions, but I'm a newbie.
    Regards
    Date: Wed, 15 Sep 2010 05:25:31 -0600
    From: [email protected]
    To: [email protected]
    Subject: Trouble Creating Forms in Dreamweaver
    I'm not very familiar with Dreamweaver, so this may be a basic question to ask.
    The trick is to be familiar with HTML, not DW, since HTML underlies everything that DW does, and that you want to do on a web page.
    To add a form to a page without disrupting the layout of the page, you have to a) select a layout design that constitutes good practice, and b) build the layout so that it accommodates the form.  I know that's not a very satisfactory answer.
    First of all, unless you are fairly familiar with HTML, your layout will not be easy to implement because you will need to constrain the form and its elements to fit vertically within that central area.  This is not so easy because you have no way of controlling how large or small I (as a visitor) am displaying my text in my browser.  Thus, that form's content is going to expand or contract vertically causing the boxed area to need to expand or contract accordingly.  This is layout 101 for an experienced developer, but may just push you over the edge if you have no HTML under your belt.  So, I would discourage you from trying to use this design.  Is that possible?
    >

  • Trouble creating a MobileMe Gallery with Aperture

    I'm having trouble creating a MobileMe Gallery from within Aperture. In the past it work flawlessly but now it isn't working at all. This is what happens: I create a gallery from within Aperture by clicking on either "New/MobileMe Album, or "New From Selection/MobileMe Album." The gallery is made and appears in Aperture. However, when I visit the MobileMe site the Gallery doesn't contain any images. When I sync it again the gallery disappears from within Aperture all together.
    Any ideas?

    I resolved my problem by rebuilding the Aperture Library from the Aperture Vault. Apparently, and this makes sense, Aperture can't build a Gallery if the photo version, or photo itself is missing. I think the reason why it appeared visible is because the Preview file was embedded...

  • How to buil a circular buffer of message

    Hi, I have a GPS that sends me their information every 30 seconds, I'm receiving this information for the serial port and I should send this information by another serial port, but every 90 seconds or more, the transfer time is variable according to the performs of the microcontroller, we need to know how buil a circular buffer of tx message so as not to miss any reading that I sent me the GPS.

    One way would be to have the serial port read in one loop, placing the received messages onto a queue, with the writing done in another loop, popping the messages off the queue as needed. Of course, if you are "loading" the queue every 30 seconds, and "unloading" the same amount only every 90 seconds, you will eventually run out of storage, filling up the predefined queue size. So you will need to determine how long that would be, and how you want to handle it. This is a problem that will occur with whatever method you use, also understanding that the longer you run, the further behind the actual GPS location data you will be. In LabVIEW 8.x, click "File" and New, there is an example of a producer/consumer architecture.
    Message Edited by LV_Pro on 01-27-2009 01:28 PM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Trouble creating List of Channels in SunOne Portal

    Hi,
    I am trouble creating new channel withlist of all the channels availbale in the portal. If any body can help in this that will be really great.
    Thank you,

    Here is a set of Portal Server's tutorials:
    http://developers.sun.com/prodtech/portalserver/learning/tutorials/index.html
    And Portal Servers forums are available at:
    http://swforums.sun.com/jive/category.jspa?categoryID=2

  • Trouble Creating Users Via Web Form

    I'm having trouble creating user in a 9i database via web front end.
    I use the following sql to create the user
    strSQL="CREATE USER"""+strUser+"""PROFILE ""DEFAULT"" IDENTIFIED BY ""HELLO"" DEFAULT TABLESPACE ""DATA"" TEMPORARY TABLESPACE ""TEMP"" ACCOUNT UNLOCK"
    I then execute another two sql statments to grant "connect" thus
    strSQL="GRANT ""CONNECT"" TO "+strUser+""""
    strSQL="ALTER USER """ strUser"""DEFAULT ROLE ALL"
    Whenever I try connecting using the new users details, but get an error message that the server had problems accessing the LDAP directory service(ORA-28030).
    I'm happy that the SQL is correect as I created the account that I wanted using Enterprise Console and coppied the SQL it produced. I'm assuming that there's something in the background that is not being triggered when creating the user via the web front end.
    Can anyone tell me where I'm going wrong?
    Thanks
    Jason

    My apologies, I didn't realise HTML DB was a product. I thought it was a forum for questions regarding HTML and databases.
    Doh!!!
    Jason

  • Trouble Creating Padded Images for iMovie

    i am having trouble creating "padded" images to add to iMovie 09.  I followed the directions here (https://discussions.apple.com/message/10699725?messageID=10699725#10699725?messa geID=10699725) which recommend the following:
    Set up an Automator Workflow to
    1. Ask for Photos (You must select one or more photos and hit Select - you can make this easier by putting them in an album beforehand)
    2. Copy Finder Items (give it a folder to copy to- so you can find them easily)
    3. Pad Images. (put a check mark in "scale image before padding" and set for dimensions of your project.
    Hit Run and a dialog box will come up asking you to select photos. When you are finished, press SELECT and the Automator script will keep running.
    However, each time I run the script I get the following error: The action "Pad Images" was not supplied with the required data."
    My files are .jpg and I am running OS X.  Any suggestions on what I might be doing wrong?

    If you want a quick response it might make sense to try and contact user TessB directly. I say that only as that person was the one that proposed the Automater Workflow workaround, and that's not exactly something here can answer (Maybe the folks in another forum related to Autmator might be able to help). Unfortunately some solutions aren't as generic or easy to use for everyone as they are for the person who has written them up. I call it the "Works for Me" problem.

Maybe you are looking for

  • ISE 1.2 - AV/AS Remediation missing vendors

    Trying to create a remediation rule in ISE 1.2 patch 3 and the drop down list for the AV/AS Vendor Name is not scrollable so I am not able to select our AS/AV vendor. See picture below:

  • Customer replication from R/3 to CRM as BP's in install at role

    Hi experts, Customer's already exist in our ECC system. In CRM, we need to create the ECC customer;s as BP in install at role. From some ot the previous threads, I found that PIDE transaction can be used. Can anyone explain me the steps clearly for c

  • Why will Adobe Acrobat not load PDF from my work website, but will load on other computers?

    Why will Adobe Acrobat not load PDF from my work website, but will load on other computers?  I have to log in to a website to get our orders, and we thought it was the website at first, but have since realized it is just my computer with this issue. 

  • HR & Payroll Archiving

    Hi, Can anyone explain the activities to be carried out by a SAP HR consultant for achiving HR & payroll data? Any checklist has to be followed for pre archival and post archival? Thanks Rajesh

  • WD ABAP + Workflow ?

    Hi pple, Is there any standard SAP ABAP Web Dynpro Application which is integrated with Workflows? I mean, is there any Standard Workflow that calls ABAP Web Dynpro Application? Actually, I am able to call the ABAP WD Application using SWFVISU applic