The use of queues for the buffering

Hello

In my application, I'm scanning my computer com ports, seeking information on the buffer. What I want to do is run a Comsumer s/producer achetiecture so that I can constantly scan the com ports, and as soon as I get on the buffer data, it is sent to a queue. Queue, and then runs another loop that makes some manipulations of database, and it is this manipulation, I want to go back and keep sweeping him agrees more data.  My problem is I want to be able to start and stop the program at any time, but I don't want to lose any information on the queue buffer. The manipulation of the database takes about 800 ms and com ports scan takes about 50 ms.

Basically, I want program blocking when I hit the "stop" button control, but if it contains data on the buffer, I want that he do the manipulation of data to all data on the buffer, then the output so I don't lose any information.

Thank you.

Gerardo

Since you have a queue, why not just add a Boolean value to your queue (ie: cluster) that you change value when the button is pressed.  It will inform the other part of the program in order to process the remaining data, then stop.  Very simple with little extra treatment.

R

Tags: NI Software

Similar Questions

  • What is a good way to use the queues for the model of consumers/producers?

    Hi all

    I am following the model of consumers/producers to use the queue to synchronize the following process: the producer is a loop to produce a number N, I will put each number generated in a table and after each 5 numbers generated, I put the table in the queue and pass it on to the consumer. I have to wait the use by consumers of the data and it will then remove the item from queue so that producers will have the chance to produce another 5 numbers. As I put the maximum size of the queue one, I expect that the producer and the consumer turns to produce / consume all five numbers and the opportunity to another. Here is my code

    When the checkbox is false, the code will be

    For the first 5 numbers, product will generate every thing right and put it in the table, and it's going to pass the array to the quere so that the consumer will have the chance to loop through the table. I except the procude loop will continue only when the queue is available (i.e. all items are deleted), but it seems that once the consumer starts the loop loop of the product will continue (if the indicator x + 1 and x 2 will be changed to numbers). But this isn't what I want, I know there must be something wrong, but I can't say it is.

    dragondriver wrote:

    As you say in 1, sequency structure to enforce the order of execution, that's why I put it here, in this example, the simple question, I replace the complete code with increase in the number, in the real case, the first markers + 1 and + 2 must be performed in this order.

    Mikeporter says:
    1. get rid of all the structures of the sequence. None of them are nothing but apply a work order which would have been the same without them.

    So even if you delete the sequence structure, there will be a fixed & defined order and it is because LabVIEW follows the MODEL of FLOW OF DATA.

    Data flow model (more precisely in the context of LabVIEW): a block diagram node runs when it receives the required inputs. When a node is running, it produces output data and transmits data to the next node in the path of the data stream. The flow of data on the nodes determines the order of execution of the VIs and functions on the block diagram (click here for reference).

    Now in your code, just remove the sequence structure will not make you order will be going to stay the same, but you need to do some very minor changes (as thread of the error in loop, before that he go to the node "Élément Dequeue").

    Come to the main point: it's a good way to use the queue for the consumer/pmodel that?
    The model you are using (and qualifying as consumer/pmodel) is much too deviated from the original consumer/pmodel which model.

    dragondriver wrote:

    For the second, Yes, it's my fault for delete, though. I'm actually the example of model of producer/consumer design pattern, but I do not pay attention to the while loop in the part of the consumer.

    While loops (two producers & consumers) are the essential part of this architecture and cannot be deleted. You can start your code using standard model.

  • Size of the queue for Signal form write XNET

    Hello

    I am using the XNET library to play a preset on an output signal waveform. I work with LabVIEW 2014 SP1, 14.5 XNET on a W7 Pro 32-bit operating system. I use an NI PCI-8512 map. This is my first app using the xnet library.

    In my test application, I give the user the ability to set the waveform to play. The total duration and the sampling frequency can be set. The output MAY report is cyclical, with a cycle time of 0.01 s (10 Hz). I chose to use the same frequency for example my wave form and writing of the CAN.

    I have difficulty working with the size of the queue. In this example, it's good but I did not really why. I tested different values in the size of the queue and 100000 seems to be good up to 60 seconds. But for the longest (about 5 minutes), this method is not good...

    What is the right way to work in this mode and how use efficiently the property size queue? Information and example of using software and hardware OR XNET are not very convincing...

    Thank you in advance!

    You can add several items at the end of the queue until the queue is empty.  So if you want to write 10,000 points, and your buffer is only 1000 points, then wait and monitor the number of messages remaining in the buffer, and once it is less than 100 say adds an another 900.

    I used this method for flashing on CAN and LIN.  I needed a way to watch specific at specified times images, and a single point of frame link would not repeat (which could write the same byte twice what would be bad) I could have made the rivers and used avoiding, but a better solution was to use queue and add more pictures at the end of the queue to try to keep it as complete as possible.

  • How to increase the value of the queue for a server to avoid errors

    In the RESOURCES section of a config of ubb, "MAXQUEUES 700" stand for all servers queue or queue on each server?

    Because there are a lot of "ERROR: the Message Queue blocking warned childbirth, Qaddr = 583902 ' for a server in ULOG, what should I change the value of the queue of this server to a higher value to avoid this error? Change the "MAXQUEUES? If increase the queue for a server?

    Thanks for your kindly reply.

    MAXQUEUES is used to specify the maximum number of queues - not number of messages on a queue of (each).

    To solve your problem of blocking, you might consider adding servers (to accelerate the responsetimes).
    Another option could make synchronous calls if it would make sense for some application that you design.

  • Size of queue for the server reports

    Hello

    How to increase the size of the queue for our reports, good that now it shows only 1,000 records.

    Thank you
    Sanjay

    Hello Sanjay

    As an option. You can have a maximum of a single element of the queue in the configuration of your server. If you have nothing in the queue, the default value, 1000, will remain in force.

    The queue item to specify the maximum number of jobs that can be held in each of the queues of reports. Reporting Services OracleAS components three of the queue:

    a queue of scheduled tasks

    a work in progress queue

    a queue of tasks completed

    The queue item provides the value allowed for each of these components.

    This element applies only to the work queue. Thus, if the number of jobs is greater than the specified maximum value, this work queue automatically purge his older works. Planned work queue, and the queue of work in progress are not affected. By default the reports server queue size is 1000 jobs.

    If you increase the size of the queue at more than 3000 and use reports (rwrqm.exe) queue manager to monitor the queue, the queue manager may fail. When a queue of 3000 or higher is necessary, use Oracle Enterprise Manager 10 g or reports Servlet (rwservlet) to manage and monitor the queue of jobs to report server.

    Configuration file is located in $ORACLE_HOME/reports/Server

    Kind regards
    Myth

    Published by: myth on July 7, 2010 11:09

  • Can I use my iPhone for the load

    Can I use my iPhone for the load?

    Yes

  • "Use setting customized for history" in the tab privacy options in firefox version 19.0.2 does not work

    When I select 'use custom for history setting' in the Privacy tab and press OK button nothing happens. He returned to the story to remember. I have Windows 7 and firefox 19.0.2.

    A problem that results is firefox remember now username and password on a new gmail account.

    The problem started with the latest revisions to Firefox. In the past, I've saved usernames and passwords on multiple accounts gmail without problem.

    As a result, I had access to the gmail accounts in another browser to save all my gmail account IDs and passwords.

    Any suggestions on how to remember passwords and usernames gmail again? and/or get "Use Custom setting for the story" to work? Thanks for your help

    I had the same problem this is how I solved it
    Tools > options > saved passwords > locate the corresponding site, you will see that the user name is missing highlight and delete.
    Back to the site log in enter your password and you will then be asked to save it... That's fact

  • TomTom map is wrong in vietnam, pls use google map for the ios update, thank you

    Map of Tomtom is very bad in vietnam, please use Google map for the ios update, thank you

    We are fellow users on these forums, not support nor Apple iTunes.

    TomTom are responsible for their own data to the card, if you have problems with their app and/or cards that you have tried to contact them?

  • Can I use iMovie trailer for publishing a Web site? I've included thanks to iMovie and iTunes in the credits.

    Can I use iMovie trailer for publishing a Web site? I've included thanks to iMovie and iTunes in the credits.

    I think that you will need official permission from both Apple and the owners of the trailer of the film.   You can not just simply print a receipt, just like that.   However, you can see, your site can be entirely flattering to the other two parties, they see things.

  • I'm trying to select several images (Forms), but I have not found a selection tool. This selection tool to transform the mouse cursor in an arrow and it is possible to select several images or figures. I use Microsoft Excel for Mac 2011 Version 14.5.3.

    I'm trying to select several images (Forms), but I have not found a selection tool. This selection tool to transform the mouse cursor in an arrow and it is possible to select several images or figures. I use Microsoft Excel for Mac 2011 Version 14.5.3. Thank you!

    tupensi wrote:

    use Microsoft Excel for Mac 2011 Version 14.5.3. Thank you!

    Then you should post on the Microsoft Mac forums where to hang out the gurus of the Office, as is the Microsoft product, with that you are having problems:

    http://answers.Microsoft.com/en-us/Mac

  • Use of 'root' for the system volume is 100% and/dev/md0 is full

    Hello

    I recently started to receive notifications that the use of 'root' volume of my system is 100%

    I went through all the files and it seems that the culprit is/dev/md0

    I don't have any add-ons installed, and this NAS solution is specifically used as a backup to another NAS. It uses ReadyNAS Replicate for backups.

    Here is the output of df - h and df - i

    I tried commands like this:

    du - csh/var
    du - csh/var / *.

    And the problem doesn't seem to be in these directories. Very low use it.

    This error started appearing on the day that I got a copy no error of ReadyNAS Replicate that gave me an Exit Code: 11 (error e/s files)

    Can someone help me solve this problem?

    The reason why you could not find, was that at some point, your encrypted volume was not mounted (perhaps the USB is not was connected when you start the NAS server) and a repeated backup job is filled with the partition of the OS on the NAS.

    When you have looked at the system, the data volume has been mounted. There was data under/data on the partition of the OS, but could not say that.

    I passed on a summary of what has happened to our engineers and am waiting for their suggestion. However as it is a long weekend in the United States I don't expect an answer at least a few days.

  • The use of DAQmxWriteDigitalScalarU32 for write channels share the same ports?

    Hello

    I have a USB-6509 and NOR-DAQmx installed 15.5.1. Using the ANSI c api.

    Is it possible to create several independent channels that use different lines of the same port?

    DAQmxCreateTask("",&th1)

    DAQmxCreateDOChan(th1,"Dev1/line0:4","",DAQmx_Val_ChanForAllLines)

    DAQmxStartTask (th1)

    DAQmxCreateTask("",&th2)

    DAQmxCreateDOChan(th2,"Dev1/line5:9","",DAQmx_Val_ChanForAllLines)

    DAQmxStartTask (th2)

    ....

    and repeat for the following strings:

    Dev1 / line0:4
    Dev1 / line5:9
    Dev1 / line10:14
    Dev1 / line15:19
    Dev1 / line24:28
    Dev1 / line29:33

    So I can use DAQmxWriteDigitalScalarU32 to write to each task independently?

    for example:

    DAQmxWriteDigitalScalarU32 (th1, 1, 10, 0 x 1, NULL)

    DAQmxWriteDigitalScalarU32 (th2, 1, 10, 0 x 2, NULL)

    DAQmxWriteDigitalScalarU32 (th3, 1, 10, 0 x 3, NULL)

    ...

    DAQmxWriteDigitalScalarU32 (th6, 1, 10, 0 x 6, NULL)

    These tasks will interfere with each other because they use the same port, but are assigned different lines?

    If this isn't the case, I bits to the data, if the task/channel does not start at the Px.0 line?

    Thank you!

    Yes, as long as you use the same line on different channels, they must not interfere with each other for this reason, you can create a channel by line if you wish

    The reference to using the DAQmxWriteDigitalScalarU32 function:
    "A sample of the integer unsigned 32-bit unique, wrote to a task that contains a single digital output channel. "Use this format for devices with up to 32 lines per port.

    http://zone.NI.com/reference/en-XX/help/370471AC-01/daqmxcfunc/daqmxwritedigitalscalaru32/

    So yes, the DAQmxWriteDigitalScalarU32 can write on each task independently

  • What is the algorithm/method used by Diadem for advanced research?

    Hi all

    Can you please let me know what method/algorithm is used by Diadem for advanced research? Please note I am familiar with search function of DIAdem peak, but I need to know the theory/algorithm it uses to find the vertices.

    Thank you

    Hossein

    Hossein greetings

    Verify the last paragraph of this document.

    Let us know if this answers your question or if you have more information on this subject. Good day!

  • TreeSize Professional - using this tool for the first time - need help to run the report

    Using TreeSize Professional for the first time and I need search records to analyze documents containing invalid characters and path names that are too long.  We are moving the content in SharePoiint and SharePoint will not accept path names that are more than 250 characters and invalid characters.

    Does anyone know how to do this research?

    [Moved from the community centre of Participation]

    What is a TreeSize question or a question of SharePoint?

    Try SharePoint forums on the left side of

    https://social.technet.Microsoft.com/forums/en-us/home?category=SharePoint&filter=AllTypes&sort=lastpostdesc

    Don

  • Use two assistants for the acquisition of data at the same time

    Hello

    I want to read multiple data channels of analog inputs on my DAQ hardware. However, when I try to create two separate data acquisition assistants for each entry, it gives an error saying "is reserved for the specified resource. The operation could not be performed as indicated "." Can't use two assistants for the acquisition of data at the same time?

    I have to add different channels in the same assistant DAQ? I tried, but I couldn't separate the data in different graphs.

    How does this work?

    Kind regards

    Allard

    You can't have multiple tasks of the same type (in this case inputs analog) on the same device.  Just so having 1 DAQ Assistant read all your channels and separate your channels for individual transformation.

Maybe you are looking for

  • Overheating, endangered transition effects!

    I use iPhone SE (64 GB). I just love the size and the design of the phone. I thank Apple for that. But I am facing some problems. The phone overheating all playing games like Mortal Kombat X or Modern Combat 5. It becomes impossible to play after 5-1

  • Map to China (Shanghai region)

    Just bought and taken W450 return from the United States to China. Where can I find the file MSO/EMBD for China? Thank you! PS - Cards/OpenStreetMap OSM for China/Shanghai exist and are in fact with good street level detail.

  • CPU 100% busy

    CPU 100% busy, windows xp. I opened an email in my yahoo page. The object of the dispute has been called HELLO. There was a hyperlink in the text; I didn't click on it. Since then, felt this slowdown of my PC. Grateful if someone could advice. PKM.

  • Creative cloud repeatedly asks me to update - even after I've already updated. Why is this?

    Creative cloud Launcher located on my task bar ask me to update. When I click on the button to update and give the access authorization of my MBP, the software goes through the process of update, but when I try to launch the CC program, it asks once

  • Script to automate an option "save the template.

    I have a great workflow with photos, layout and facilitate my work to find a way to 'SAVE for WEB' each 'Layout' in its own folder on my system (C:-Program Files (x 86)------Adobe-Adobe Photoshop CC------plugins------panels------Diagramais) and each