Sequential simultaneous writing of the queue

Hello everyone, nice day.

I have what should be a very simple matter.

I'm currently implemented a producer consumer-consumption-consumer architecture. (Loop acquisition > write disk acquisition > read data from disk data > display of the user based on the data.) In plain language, I have a created the data loop, a loop of these data, a loop of disc storage and a loop displays a user interface. (This isn't supposed to be a real-time application, and I am aware of the charge created by the writing and the reading of the disc). Just stick with me on this one.

So my problem occurs concerning the second loop. This loop is responsible to write the data be queued (produced in the loop 'Acquisition') on the disk. The problem is also, feeds on a queue to the loop of "reading disc". This configuration causes a few obstacles. The main obstacle arising from the nature of queues of LabVIEW. The loop "write to disk" writes only a part of the queue of the 'Acquisition' at the same time. This general is not really a problem, until you consider that this loop also determines the execution of the loop of "reading disc", with the use of queues. As a result, this loop determines the rate of the next loop and was therefore likely to slow demand and leave a large number of items in the queue. In addition, you must keep in mind, I'm only queueing about 7 MB of data per element, and my HARD drive has a write speed average of 60 MB with a 64 MB cache. Therefore, my installation I can only write one item at a time, therefore making me use only 7 / 60MB of bandwidth from my drive.

My question is; It be possible to have the loop "write to disk" write several items in the queue at the same time. I hope that I can write simultaneously enough items that I can use my bandwidth 60MO together writing and speed up execution of any sub routines that depend on data written to disk.

I know there is probably best architecture for this application, but for the moment, I am limited to this architecture. If you have any suggestions for other architectures, I'm more willing to listen to, but coming back I am looking for a way to improvise simultaneous tail reads and then write them to disk with my current structure.

Thank you all, thank you for the help.
Taylor S. Amarel
Learning is alive.

You can put your element Dequeue function in a loop For and set N to a number so that you get several items from the queue at a given time.  Turn on indexing and you will have a table of data.  Write the table in its entirety on the disc.  This should speed things up a bit.  Don't forget to use shift registers for the sons of the error and the reference to the queue in the loop For and also put a little delay in the loop to stop 100 percent CPU usage.

Tags: NI Software

Similar Questions

  • Writing in the spreadsheet with the queue

    Hello

    I am a beginner with queues and I have a few questions.  I have attached a simple example of code that I wrote to better implement a consumer who can queue data and write on a worksheet after running the code.

    First of all, I noticed that the queue still has residual remaining after the code ends.  It then writes this element to the file to run the vi.  I can't figure how to get rid of this element.

    Second, anyone have any suggestions to improve this code?  I've been playing with it for quite some time and I finally got to work like that, but it is certainly configured differently from the other examples I've seen.

    Thirdly, I am reading the number of items in the queue, but the two in the loop of the producer and the consumer, told me that there is no element.  How can this be?  My output file seems to work and I certainly put items in the queue.

    Finally, in the future I'll use data from the queue in two places.  Here I've implemented a notifier to do the job.  This is the best method?

    Thanks for your help!

    Jason

    The reason why you do not get the last element of the queue (at least not until you restart the VI) is that you have your automatic indexation tunnel that collects all the data to send to the writing on file SS service cable for moving to register.  So this last piece of data from the queue to get into the shift register, but it is not getting into the 2-D chart by the tunnel of automatic indexing up to the next iteration of the loop.  When you rerun the VI, as the shift register is not initialized, it is already there and became the first point of your next data execution.

    Why did you put the register shift in?  Just remove and just use the tunnel of automatic indexation.

    I don't know what you really want to do with the 2nd loop to say if the Notifier is correct or not.  But if you do not want to lose data in the other loop, then you need to use a second queue and have your producer loop enqueue data in the two queues, a queue for each consumer loop.

    With regard to the elements draws in the queue, seeing how your code is configured, the queue will almost always empty because the dequeue function will be ready to pull out the element immediately after the enqueue function puts in.  Unless you have your loop producer much faster than your consumer loop running, you will not see a build up of the elements.  (Try putting an expectation of more of 100 msec in your loop of consumer.  Then you will see elements accumulate in the queue.)

    I don't know why you put the spreadsheet feature writing after the loop.  Normal use for queues in an architecture of producer/consumer must transmit the data to a separate loop that contains the functions write file.  This way he can work at his own pace, but write the data and make sure that you do not lose it.  As you have now, if your code runs a long time, you may run out of memory when at the tunnel of automatic indexing table becomes too large.  And if your application crashes before you complete it with your stop button, then all data are lost because you did not it writes the file.

  • 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.

  • Too much time in the queue empty in the loop of consumption

    I'm working on a VI used to screen analog converters above temperatures from room temperature to 175 C.  I have it set in place with a producer and a consumer loop.  The loop of producer makes all the measures, while consumer loop allows you to write tests that all measures in a spreadsheet file. There are 23 steps taken and recorded every second.  The test is run for about 60 minutes.

    Initially, I had trouble with data in the queue being lost when I stopped the VI.  I fixed that by ensuring that the queue was completely empty before you stop the VI.  Now my VI will continue to work long after I pressed the stop button.  I let it run for up to an hour and finally abandoned the operation and still lost a large number of measures on the end of the queue.  From my reading on the forums, it's because of the overload to write to a file of measure.  Opening and closing of the file every second is any slowdown.

    I've seen examples of creating a table of measured data and only writing every 100 samples or more.  Can someone help me see how I could implement something like this in my code?  Is there another reason, it takes so long to write all my test data?

    Thank you

    Matt

    You must use the real file i/o functions.  That made the express VI to write files to measure opens the file, writing the data and then close it.  When you do this several times, you get a really slow performance.  If you must open the file before you consumer loop and close it after the loop.  You will then be able to write as much as you want inside the loop.  But now, you need to format the data yourself.

  • Best practices using clusters to create the queue/notifier/bundles?

    I'm in a block diagram, a queue, the notifier and several instances of cluster of bundle

    that all use the same data structure.   There is a typedef of cluster for the data structure.

    Of course, each of these objects (define the queue, set notifier, bundle)

    you want to know how do you define the cluster.

    What is considered best practices?

    (1) create a dummy instance of the cluster across data structure

    definition is necessary (and hide all on the public Service)

    (2) create only one instance and son at all places, it is necessary

    But there is no stream on this thread: it's only the cluster * definition *.

    which is used, so this seems to clutter the comic.

    (3) create only one instance of the cluster control and use local variables

    everywhere else the definition of cluster is required.  It's _value_ is never

    assigned or given read-so no problem with race conditions.

    (4) another way?

    If you were to clean up someone else's code, how do you expect

    See this Treaty?

    It occurred to me during this writing that here where I

    "unbundle...... code bundle" I could wire the original beam to the

    the two "unbundle" and "bundle" - but that would be too complicated

    and the size of the comics with useless thread?

    Thank you and best regards,

    -- J.

    Hi Jeff,

    I think that this question is about "sharing" the typedef and not how share data (?)  If the cluster control is registered as a typedef (or a strict typedef) but NOT SIMPLY as a CONTROL, then when a Diagram-constant of the typedef is created, it will be updated when you update the .ctl typedef!  (and there is no FP control to hide )  Of course if the typdef is already available "close" if necessary, you will be able to use instead - save a spacer of diagram.

    See you soon.

  • effectiveness of the queue

    So, I'm working on improving the efficiency and speed of my system of producer-consumer. I have two producers and a consumer (which, among other things, writes files to disk). I currently have two producers supplying the a queue which is then processed by my currently single consumer. Each item in the queue is a grouping of several types of data and contains everything you need to "consume." There are some cases where more complex queue items placed which take longer to treat and slow the process of consumption. I add a second consumer loop to run in parallel with the first to take the weight off the loop so to speak. My question is, it would be more effective to have both made consumers in the same queue, or would it be more effective to have each producer to feed its own queue. For the sake of the exercise assumes that I can guarantee you that the elements of the queue complex will come only from a particular producer.

    It is difficult to give a good answer without really knowing what is happening in your loop of consumer.  Order matter?  Some of these processes can actually be done in parallel?

    My first suggestion would be to make another loop (and corresponding queue) just for writing the disk.  Because that tends to be a "slow" process anyway, it should help releive your loop of consumption at least a part.  But, still, I do not know what that your orders 'complex' need you.

  • IPCC Express, option for the appellants out of the queue and leave a message.

    We are running 4.0 (5) IPCC Express improved. I need to configure our current ICD script so that when the appellants are held in the queue, they can press 0, out of the queue and leave a voice message. The ICD script we use is an exact copy of the script icd.aef by default on the system, it has just been copied and renamed. My question is, what are the steps I need to use the script to enable this feature?

    Two options. Option 1: Use the IPCC completely to save messages and manage messages as you seem to did so. Option 2: Transfer the caller to your voicemail number pilot and use your voice mail system to record the message.

    Steps to Option 1:

    1 early on in the script, use the step to read the Contact information call to capture the called number and save it as a variable.

    2. use the step to get a string to allow the caller to press 0 to leave a message. On the Filter tab, allow only the key 0 be hurry.

    3. in the leg successful step to get a string of digits, add the following steps.

    a. contact Dequeue step.

    b. reading quick step that contains a prompt that asks the caller to record a message after the tone.

    c. step recording, which records the message saved in a Variable of type "Invite".

    d. use the Terminate step to end communication with the appellant (you can add a quick step before that game if you want to tell the caller that the message has been saved).

    e. at this point, you can either use writing document step to record voice messages in a folder on the server of the IPCC, or you can use a series of other steps to place a call to the queue and play the message the following agent that meets, or you can attach it to an email and send it it make the address email of your choice (or a combination).

    I have this HUGE warning. I had several problems with what I've been able to overcome, but it requires a bit of diligence.

    -L' registration step requires a termination character (# or *). If the caller hangs just straight up, the script returns an exception and drop dead. You can manage the 'contactinactiveexception' using a step on the Exception and have it go to a label that you can put it as the first step under the leg successful registration step. In this way, if the user hangs up, the script handles the exception by going directly to the successful step. You can clear the exception just after that.

    -You will also want to handle this exception before Terminate step. If the caller hangs up and you try to put an end to this contact when he is no longer active, the script will always die, and the remaining steps will not run.

    We use the option to place a call in the queue. In itself, this requires a lot of thinking to make sure that the script is not die when an exception occurs. I ended up putting some exceptions in place where if there is a problem and that the recorded message never makes it to an agent, a log file is stored on the server as well as messages stored in a .wav file. Then, an email is sent to the contractor with these attachments also.

    Thus, it is as effective as make you it. Try to keep things simple at first, and then build on that to improve the experience of the appellants.

    Steps for Option 2:

    1. use the step to get a string to allow the caller to press 0 to leave a message. On the Filter tab, allow only the key 0 be hurry.

    2. in the leg successful step to get a string of digits, add the following steps.

    a. contact Dequeue step.

    b. call no redirection to the number voicemail pilot.

    I have not used this option, so I can't say with certainty how Callmanager will handle this call. The voicemail system will need to see the call as transmitted from a number that has a voice mail on the system account. If this does not work, you can use a dummy CTI Port with a fake extension that is configured to transfer to voicemail, then the voicemail box must be associated with the wrong extension. If you use Cisco Unity, you will also be able to use a routing rule to force the IPCC calls to a particular mailbox. Call the Viewer from the unity tools depot allows you to see the way in which the appeal is made to the unit.

    I hope that helps you and that it is not too verbose.

  • don't print from firefox, file is automatically removed from the queue

    I try to print from the web browser firefox or a pdf document and files will not be not print and are removed from the queue after about 30 seconds. I tried the browser google chrome and they print well from there. This problem just started today.

    Make sure that you do not print in a file selected and the correct printer is selected. You can see these settings in the "native print dialog" window when you do {Ctrl + P}.

  • have the icon to download helper with video up, I have until it clicks, dosnt download or convert a number appears next to the icon and its listed in the queue draft.exe

    I was able to load videos 26 then he stopped down. I checked the preferences, the version is 4.9.24, I can see that the video is listed next to the icon, when I drag the mouse over it.

    I support download icon, when the video is running. I click next to the icon and choose the game I want, on fast download I see it loads, but no dwhelper. dosnt download or convert a number appears next to the icon and its listed in the queue draft.exe

    There is a problem with DownloadHelper Firefox 36. They are working on a new version, you can download and help test this discussion page:

    https://groups.Google.com/Forum/#! Forum/video-video downloadhelper-5

  • E HP Envy 7640 All-in-One-Sanchez: now, I have my documents stuck in the queue and I can get out. Help! I hate this printer...

    Whenever I change the paper (photo paper) when I get back to paper ordinary, it is immediately past offline or it gets stuck in the queue.  Now it is stuck in the queue.  Is it possible to get this printer to print without all these problems.  I am extremely illiterate on computers and this crazy.

    You helped me with "off connection" now can help you with this problem.  Thanks for the help, I really appreciate it.

    Hello @Sam141, greetings!

    Welcome to the HP support forums. I'd love to help you with your printing problems with your printer Envy 7640.

    I understand that you are a new user with this printer, that's why I suggest using an automated tool to correct this and many other common printer related issues.

    Go to http://hp.care/2bZ9w2q to download and install HP print and scan the doctor. This tool will be quickly and automatically perform several tasks resolution known problems for this problem. You can save this for future issues you can still.

    Please let me know if that solves the problem, or if you need assistance.

    See you soon

    Please click on 'acceptable' on the post that solves your problem to help others to find the solution. To show gratitude for my help, please click the 'Thumbs Up icon' below!

  • How to cancel print jobs in the queue? Model: HP Laserjet 3055

    I wanted to print a book of 200 pages of my laptop, so I pluged in the printer to the computer laptop and hurry to print on laptop. Then immediately decided not to print it, then I pressed cancel on the printer. But labour has not at all been cancelled. Whenever I try to print something it always starts with the work that I wanted to cancel initially. And on the laptop, the message block asking you if I want to add to the print queue.

    I would like to cancel the work that is placed into the queue of the printer for good, if someone can advise please help me, very desperate!

    Thank you

    Martine

    Hi John,.

    Open the Printers folder, and then double-click the printer. Click on the printer and then cancel all documents.

  • I'm unable to delete obsolete email addresses of mail. When I change a card email address Contacts outdated address appears at the top of the queue. Is it a problem of Contacts or a mail problem. How to solve this problem?

    I'm unable to delete obsolete email addresses of mail. When I change a card email address Contacts outdated address appears at the top of the queue. Is it a problem of Contacts or a mail problem. How to solve this problem?

    Have you tried to go to the recipients of mail/window/previous and delete e-mail addresses it?

  • Cannot clean up the queue and print the new document

    All of a sudden in trouble with my C6180 all-in-One. It didn't print a document remaining queues. Tried everything to clean up the queue. But nope. Document is in the list. Document status information: deletion. And never remove the ends. Right now my printer is not a printer. Can anyone help?

    Hello

    In Control Panel, open administrative tools and select abuse.  Scroll down to the print spooler service, right click and select Properties, then click the Stop button.  Now search for C:\Windows\System32\Spool\PRINTERS, then delete the tasks within this folder - you may need to click a command prompt to get the authority to open the PRINTERS folder.

    Restart the computer and you should find that the documents have been deleted.

    Kind regards

    DP - K

  • HP8100 print job stuck in the queue

    I have a print job stuck in the queue of my HP Officejet Pro 8100.  I tried to delete the file, but it's been blocked for a day and I can't print anything else, it seems as if the job locked up in the queue stops other jobs.

    I did the following:

    tried to delete the file-will not remove status said "deletion" for more than a day.

    power cycle

    connection direct USB printer

    power cycle - unplug the power cable, the power button for 1 minute - leaving only machine for 30 minutes.

    Nothing has worked so far.

    Help, please.

    Thank you

    DITT

    Hello

    Try the following.

    From the desktop, hold down the Windows key and press R.  In the run window, type services.msc and press to enter.  Scroll down to the print spooler service, right click and select Properties, then click the Stop button.  Now search for C:\Windows\System32\Spool\PRINTERS, then delete the work inside this folder - you may need to click a command prompt to get the authority to open the PRINTERS folder.

    Restart the computer and you should find that the document has been deleted.

    Kind regards

    DP - K

  • HP Officejet Pro X476dw: Printer will print-elements are sitting in the queue, but the unit stops before printing

    The printer starts as it will print but then stops. The elements are sitting in the queue, so they are sent to the printer. I turned on and out and unplugged to reset. No error message. Connection to the local network.

    Hello

    Download and run the utility HP Print and Scan Dr. link below to solve the problem.

    www.HP.com/go/Tools

Maybe you are looking for