Consumer loop very slow, queue size grows. How to speed up my consumer loop? As the array grows the slower it gets.

LabView version: 2012
OS: Windows XP SP3
Hardware: USB NI cDAQ-9174 NI-9221
Application: Oscilloscope
I'm relatively new to LabView and I'm currently experiencing some performance issues with my project. I guess it has something to do with the way it's programmed. I'm hoping to get some tips from you guys.
This is my producer loop. It should be capable of acquiring 100 000 Samples/s. I guess I've done this the right way and can't really be improved. Or am I mistaking?
This is (part of) my consumer loop. It's too slow, the number of elements in the queue keeps getting bigger. I'm doing two types of calculations on the queue data. One for changing the scalling (a multiplication), one for changing the y-position (a summation). Because each time there are 10 000 samples acquired I have added an extra loop (inner loop). This loop splits the array into x samples when the requested samples are smaller than 10 000 or adds them when the requested samples are bigger than 10 000. This depends on the user input (time/dev).
For example: when the user request 100 seconds of data to be plotted on a graph we get an array of 10 000 000 x 8. Is this considered big? Enlarging the array to that size is very very slow, the queue builds up rapidly.
I don't know what really slows it down or how to 'debug' this properly. Transposing the array twice seems avoidable?
Maybe I'm doing this in an inefficient way? Any thoughts that might help me?
The VI's are attached.
Thanks for your input.
Attachments:
Scope.zip ‏199 KB

Thank you for your replies so far!
LV_Pro,
I agree it is a bit silly to plot more than 2000 points. I will change this. But even without a graph, the consumer loop seems to be unable to handle the speed.
tst,
1. Ok, I will change this
2. Thank you for pointing this out. I implemented your technique and have some increased performance.
Still not the speed I would expect from LabView. The system is 'stable' with a sample rate up to 100 Hz, increasing this makes my queue overflow.
I must be doing something else wrong... Anymore ideas?
Latest version of program in attachment.
Attachments:
Scope 1.zip ‏211 KB

Similar Messages

  • I have upgraded my I phone's ios from ios 6.1.4 to ios 7. After that my phone is very slow and getting hang. So now I wants to downgrade from ios 7 to ios 6.1.4. Please let me know how I can do it

    Subject: need to downgrade ios
    I have upgraded my I phone's ios from ios 6.1.4 to ios 7. After that my phone is very slow and getting hang. So now I wants to downgrade from ios 7 to ios 6.1.4. Please let me know how I can do it

    You cannot downgrade.

  • Flash player loading files very slow and getting stuck after 100%

    Hello all,
    I have an issue with my development and need your help and feedback for the same:
    I  have developed various E-Learning courses which was published some in  Flash Player 9 and some with version 10. Since Flash Player 10.1 was  introduced all my developed courses was running fine. But it's found  that user who are using Flash Player 10.1.85.3 is facing issue with file  loading and playing the courses. Some time Flash player fails to load the  chapters and files after preloading 100%, and sometime it's very slow in  loading performance. I like to intimate that all these was not happening  with Flash player version 10. Please give me any idea where I am going  wrong. Is this kind of issue possible? If anyone faced the same experience. Please give me your valuable feedback.
    Please  Note: I have faced an scenario that, suppose a user is stuck with loading  the course, and after getting stuck he clear his browser cache, and  immediately after that the same player start working fine. And loading  the course chapter properly. Need help to get rid of this kind of  situation.
    Thank you
    Amitava D

    Hello all,
    I have an issue with my development and need your help and feedback for the same:
    I  have developed various E-Learning courses which was published some in  Flash Player 9 and some with version 10. Since Flash Player 10.1 was  introduced all my developed courses was running fine. But it's found  that user who are using Flash Player 10.1.85.3 is facing issue with file  loading and playing the courses. Some time Flash player fails to load the  chapters and files after preloading 100%, and sometime it's very slow in  loading performance. I like to intimate that all these was not happening  with Flash player version 10. Please give me any idea where I am going  wrong. Is this kind of issue possible? If anyone faced the same experience. Please give me your valuable feedback.
    Please  Note: I have faced an scenario that, suppose a user is stuck with loading  the course, and after getting stuck he clear his browser cache, and  immediately after that the same player start working fine. And loading  the course chapter properly. Need help to get rid of this kind of  situation.
    Thank you
    Amitava D

  • Copies of e-mails repeatable being downloaded and when I try to delete them it is very slow (I get the not responding message) how can I cure this?

    the question covers most of it. I will add that this suddenly has started to happen and I have not knowingly made any changes to my system. The e-mail address is a secondary one to my main address which is a btinternet.com account

    http://kb.mozillazine.org/Duplicate_messages_received

  • Macbook has become very slow, i get the rainbow wheel whenever i click on something, i can barely do anything!

    My macbook pro has slowly been getting worse over the last few months, it takes ages to load up when i turn it on, and whenever i try to click on something (google chrome, itunes, etc) i get the rainbow wheel for an unknown amount of time, its so slow! i can barely do anything on it, im having to upload this question on my ipod because i cant use my mac, ive had the mac for about 4 years, and i dont think its anything to do with the memory, any help would be very grateful!

    Sounds like it might be your hard drive.
    Go to Applications -> Disk Utility, select your hard drive, and click on the "Info" button and see what is reported for your S.M.A.R.T status at the bottom of the screen:

  • When I type a fraction for recipes they sometimes stay full size, but will also automatically reduce to a smaller size.  How do I control what format I want the fraction to be?

    Sometimes when I type fractions they remain full size, other times they automatically reduce to a smaller format.  How do I control what my fraction looks like?

    Fractions can be found as characters (glyphs) in Unicode fonts. You would need to set the auto-substitution in Pages' preferences to auto substitute to the correct Special characters in Unicode found in:
    Menu > Edit > Special Characters…
    Peter

  • I have purchased the app geowalk and garaband from the ipad itself and found it was very slow to get it installed. Then I used a pc (not mac) to download the app and found that I cant install to the ipad. It said error... anybody can help?

    Help! I have purchased the app geowalk and garaband from the ipad itself but found the files were too big and the process is too slow. I later use non mac pc to install the 2 apps but I couldnt tranfer to the ipad. It always said error. anyone can help?
    Thanks

    WHat does the error say?  Is there an error code?

  • Mail very slow to get new mail after Lion upgrade

    After I upgraded from Snow Leopard to Lion my Mail application has become very sluggish. It takes ages to show new mail from my Gmail account. It seems to spend ages downloaded messages. If I access my Gmail via Safari it is virtually instant.
    Any advice most welcome!

    I had a similar problem and it was related to my wireless network settings.  The Lion upgrade had created a second wireless network setup named Apple 888.b1 on my airport/time capsule.  I deleted that second phantom one so it was just back to the one that I had setup and everything is fine again.
    So if your broadband connction is wireless you might check the wireless settings and see if a second network setup was created.

  • Why is the Safari program so very slow in getting a Website?

    I have to wait and wait for the Safari program to get a Website. My old computer, using the 5.1 Explorer is 3 times as fast as this supposed to be super fast Safari. Something is wrong here? Any help is much appreciated. Thanks for your help. Uncle Milty

    "Just fixed it; changed the cable (wire) going to the modem and wow..apparently the other cable is not of the same quality...Swapped the cable that I had connected to the viao"
    Glad you found the trouble. It is too easy sometimes to immediately suspect software trouble when the actual cause is something like this. In my job (central office technician for "the telephone company" we use the term "stare and compare". What is different about the one that works and the one that doesn't? What changed and when did it change? There have been furious arguments between the hardware guys (me and mine) and the software guys (them) when things break. And, most of all, when you are 99.99% sure that the problem is the other guy it turns out to be your problem after all.

  • How to speed insert my 1000000 records into the database?

    my code like:
    <cfloop from="1" to="#inserteddb.getrecordcount()#"
    index="x">
    <!----
    Here make the InsertFieldList and InsertValueList
    --->
    <cfquery datasource="#cfdsn#" name="insertdata">
    insert into inputtest (#InsertFieldList#)
    values (
    <cfqueryparam value="#InsertValueList#"
    cfsqltype="cf_sql_varchar" list="yes">
    </cfquery>
    </cfloop>
    The test inserts 100,000 records, has spend I 30 minutes
    time,but I have 1,000,000 record to insert , is there any way to
    enhance the insertion speed?
    Thanks a lot.

    By removing ColdFusion from the process as much as possible.
    Where is the 'insertedDB' data coming from? It looks to be a
    record set?
    Are you moving data from one data source to another? If so,
    some DBMS
    have the ability to insert an entire record set in one step.
    I do not
    have the exact syntax at my finger tips, but I have done
    something like
    this in the past with Oracle. INSERT INTO aTable SELECT FROM
    bTable.
    Are you building a record set from a text file such as CSV?
    If so, many
    DBMS have the ability to do 'bulk' inserts from such text
    files and CF
    does not even need to be involved.
    As you can see, knowing exactly what are you working with
    will help us
    provide suggestions an how to improve your process.

  • How do you hook your mac up to the tv and get audio?

    I figured out how to get the image on the screen, but I can't figure out how to get the audio to come from the TV and not my mac.
    So does anyone know how to fix that?

    What model Macbook Pro? What OS?, What connector are you using? What connector on your TV?  If you are using Mini Display Port to HDMI or other connector you may need to use a separate audio cable.

  • How to speed up system boot time and the performance

    Disclaimer
    You are using this guide at your own risk. I don't take any responsibility for any problems.
    Warning
    Before you will do anything please backup your system.
    How to do backup? Check the topic created by CherylG in the below link:
    Custom 'Recovery' Options
    If after performing changes which are suggested in this guide, will be a problem with the operating system then, you will have possibility to restore the system to its original state.
    Recommendation
    When after adjusting the system you will realize that everything is working faster and better then before, backup the system again. Why? It's always good to have an Image of well tuned system.
    Table of Contents:
    A Increase the Windows 8 performance
    B Increase the Windows 7 performance
    C Increase the Windows Vista performance
    D Increase the Windows XP performance
    ** Say thanks by clicking the "Thumb up" icon which is on the left. **
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **

    A Increase the Windows 8 performance
    01. Check the below link:
             Improving System Performance without Adding Memory (Windows 8) - the HP document
    Back to the top
    ** Say thanks by clicking the "Thumb up" icon which is on the left. **
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **

  • Performance Assistance (F1) : very small Font size

    Hi,
    When we press a F1 key on any field. The Performance Assistance(help) pops up.
    1.The problem is the user cant read it as it has very small font size.
    How to change the font size and Make it Bigger.?? So it become Readable
    Regards,
    Anupam

    Hello Anupam,
    Please follow below steps to change the font :-
    1. Open SAP GUI
    2.Go to options
    3.Select SAP Signature Theme,
    4.Select Font and change the font
    5.Login into SAP.
    Thanks

  • How to check if Message already exists in the queue and if message is processing currently

    Hi everyone
    I am new to Azure and worked on adding messages to the queue through workerrole1. Worker role 2 pulls them out from queue and processing them and de-queing them.
    Worker role1 runs method gets called after every 10 seconds and puts messages in queue
    CloudQueueMessage
    message = newCloudQueueMessage(oAzureWorker.WorkerInstanceOf
    + "_"+ oAzureWorker.AgentId.ToString()
    + "|"+ ExecutionId.ToString());
                                    queue.AddMessage(message);
    Worker role2 runs method gets called after every 10 seconds too and checks the queue like this
    foreach
    (CloudQueueMessagemessage
    inqueue.GetMessages(20,
    TimeSpan.FromMinutes(5)))
    // Process all (20) messages in less than 5 minutes, deleting each message after processing.
    // Process message
    queue.DeleteMessage(message);
    Following are my questions
    1) How do I check in worker role1 if the message is already in queue, Because I don't want to queue it back again if its not yet processed and is in the queue already
    2) How do I check in worker role1 if the message is currently processing. Because I don't want to queue it back again.
    3) How do I make sure that ALL the messages get processed in the order they are inserted. I know Queue is FIFO, but I know if the message gets delayed in processing another instance can pick it up, even if it gets picked up by another instance, I want to
    make sure that the order remains.
    Right now the instances of both these worker roles are 1, in the future when we increase them, I don't want them to queue the same messages multiple times or queue them if the message is already in process mode.

    Hi Sarah,
    I agree to the Frank's suggestion. Why you need to burden the worker role 1 to check if the message really sits on the queue or not? You can do this simply in your code before pushing it on queue instead querying queue.
    All you need to do on worker role 1 is - push the message on the queue and forget as the entire queue design in azure is designed from asynchronous processing.
    About worker role 2 - Use the GetMessage method which hides retrieved message's from other clients and hence makes sure that only one client is processing it at a time. If processing is successful - delete the message. if it is not - the message will be
    visible anyways after the mentioned time provided in the GetMessage method.
    I agree that when you will increase number of instances of your worker role 1 which might insert duplicates in the queue - in that case - you might need to introduce the shared entity (like database) and let all instances communicate through it to avoid
    the duplication of messages on queue. 
    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale

  • Aperture 3.5 running Very Slow

    Good Evening
    Aperture is now running very slow and get the spinning wheel alot, even worse whe trying to open NIK add ons, didn't get this before the upgrade, anyone else experiancing this ? also unable to import an old aperture Libary into 3.5, i get the message that it was created with an older version !
        Cheers

    Same problem.
    Library access is very slow.
    I have restored my library after crash and now i have 250.000 previews to recreate (very big library : 2To but no problem before aperture 3.5) it's very long, about 20.000 previews by day.

Maybe you are looking for