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.

Tags: NI Software

Similar Questions

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

  • 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

  • How can I control the writing-data-to - spreadsheet.vi to save the data?

    Hi all

    I tried to draw a wave and save the data to excel. Now, I want to control the writing-data-to - spreadsheet.vi to save data when I want which means that the vi records nothing until I have send a command to it. How can I make this happen or do I need any other screws?

    Nicky

    Hello

    Maybe this wat you are trying to do... Let me know if it helps...

    Kind regards

    amine31

    (Kudos are always welcome)

  • Problem with the queues

    I have two sensors on a conveyor that will determine whether an object should be rejected or not. Another sensor is located at 80 cm distance where the object will be launched the conveyor. I learned to use the queues, but have had no luck so far. Could someone explain to me how they work and if possible, post an example of code pretty much my conveyor system? Thank you!

    Think of a queue as a line in the film. People come, they get online. When the person who sells tickets is ready they get the first person online and sell a ticket. Like many arive, they will get at the end of the line. This process will continue until there is nobody left online. The ticket seller will always be the person at the front of the line and new people will be placed at the end of the line.

    There are provided with LabVIEW examples that illustrate the use of queues. Use the finder of the example and the search for queues.

    With regard to your situation in more detail would be necessary in order to give the best advice.

  • VISA resources between the loops with the queue

    Hi all

    I am just be familiar with the queues and the producer/consumer model, and I am facing difficulties to pass data between the loops using queues, including data of the type "VISA Resource Name.

    Indeed, it seems impossible to cable "VISA Resource Name" as an entry of the item in the queue, as an output of the Dequeue item.

    These screws can I always try to convert something of this type can accept? Or should I take a different approach and that one?

    Thank you very much for your help.

    Florian


  • HP officejet pro 8600: printer will not be used with the document in the queue

    Hi people,

    can someone help me please?

    I tried all the solutions proposed-

    Check connectivity

    restarted print queue

    Remove and then reconnect the printer

    Power reset

    Cancel job again.

    I had this problem before, but something so tinkering with the queue got fine but nothing works all the time.

    I just changed the cartridges...

    No matter what other dieas welcome please

    Ashoka

    Ash,

    I could be wrong, of course; Mac is not liable for the same way as the Windows environment.

    The printer can print when the print queue of the printer is on, ready to accept a job.  If the queue of work, i.e. the service on the printer running print jobs does not print to the printer, the printer will not print the work.

    If the printer on the computer service is not to blame, then you might indeed want to accuse the printer to not receive the work.

    You can check the communication between the printer and the rest of the installation between the printer and the service that sends the work to the printer:

    You could try to put everything back once more - to include your router.

    I hope this helps.

    Maybe someone with a Mac experience can shed light on the issue.

    Click on the Thumbs - Up Kudos to show that you appreciate the help.

    I am happy to provide assistance on behalf of HP. I do not work for HP.

    Click on accept as Solution when the answer provides a fix or a workaround!

  • Jobs FRUSTRATED stuck in the queue on Officejet 6500 with IP printing

    I'm especially frustrated because I just typed in many details, and when I click on "Preview" my text disappeared. Thank you, HP!

    Like others, I have an Officejet 6500 E709n. Print a test page, the diagnosis, the HP printer utility page, I cannot print any document. "They simply wander in the queue with the message host ' 192.168.2.6 network ' is busy. retrying in 10 seconds... forever. Yes, I tried to delete and add the printer again and he gets found very well.

    I can print with USB.

    I can print with Hello (but which is slow, so I turned off)

    It's okay if my OS X 10.5.8 laptop is connected wirelessly or through ethernet.

    The printer is connected to the router Wireless Ethernet. At the present time, my mac is connected to the same router by ethernet. I just started the HP printer utility and printed page setup very well, showing the ink levels.

    I'm guessing that it is a problem of intellectual property, and that the HP printer utility uses a different protocol to connect to the printer. Yes?

    Fine, I can print from Windows 7 computer that is connected by ethernet on the same network. IP addresses are correctly reserved.

    Please, someone help. I have a forthcoming major surgery and won't be able to walk upstairs to the office, so I really want to be able to print wireless from below. I bet once wired print jobs, the wirelss go, too.

    Well well, thanks to the kind soul who wrote this:

    http://h30434.www3.HP.com/T5/Mac-printing-and-scanning/duplex-printing-with-HP-OfficeJet-6500-wireless/m-p/129735#M3716

    (useful text cited below)

    You can also modify an existing printer driver:

    (1) system preferences > Print & Fax

    2) click your printer

    3) click on the Options button & supplies

    4) click on the driver tab at the top

    (5) in 'print using... '. "drop-down, choose Select printer software...

    (6) locate HP OfficeJet Pro L7700 in the list

    I followed the instructions to turn my printer OfficeJet OfficeJet Pro L7700 6500n driver. Let the JetDirect Protocol.

    Now I can print when connected to the Ether - and I can print duplex. AND I can print wireless.

    To sum up: If your print jobs stuck in the queue to print on a HP OfficeJet 6500n, but you can ping the printer or you connect via the HP printer utility, the following workaround solution:

    Change the IP to JetDirect Protocol

    Change the 6500n to OfficeJet Pro L7700 OfficeJet printer driver.

    SOLVED.

  • Deleting printer with documents in the queue but cannot be connected to printer Win 7 64 bit

    There is a printer that appears in the devices and printers with documents in the queue, but I'm no longer connected to the printer.

    How do I remove the docs on hold so I can proceed to remove the printer?

    I am running Windows 7, 64 bit, completely up-to-date.

    Hi Linda,.

    Have you tried the steps in my previous answer?

    I suggest you to cancel all items in the print queue and check if the document is deleted.

    To cancel all the elements in a print queue:

    To cancel all the print jobs for a printer, you must have permission to manage documents on the printer.

    1. Go to Start , type Control Panel, select Control Panel, hardware and sound, and then click Printers.
    2. To open the print queue, double-click the printer you are using.
    3. Click the printer menu, and then click Cancel all Documents. Function of the printer, the printing element could finish, but the remaining items will be cancelled.

    Please let us know the results to get help.

  • Hi, I'm developing a simple mobile app in DW CC 2015 using JQuery Mobile. LIKE I need the list view with description of the product, functionality and image, I would like to connect with database instead of "writing" all the tables in the bearings inside

    Hi, I'm developing a simple mobile app in DW CC 2015 using JQuery Mobile. LIKE I need the list view with description of the product, functionality and image, I would like to connect with database instead of "writing" all the tables in the bearings inside the Jquery page. In the future I would also be able to add, to remove the DB records. Any help, tutorial... Thanks TG

    I would like to connect with the database instead of "writing" all the tables in the bearings inside the Jquery page

    This is usually done with a CMS (content management system). There are commercial products CMS like WordPress, Joomla and perch. You create one or several layouts and then create pages of these page layouts using the CMS. In this way, it is possible to have hundreds of pages, each with unique content, but a page layout that can be managed in a place of sharing.

    CMSs on shelf don't require programming skills. Otherwise, some of us write our own CMS with custom functions, but this requires back-end, as with PHP programming.

  • How can I change the depth of the queue with powercli 5.5?

    Hello

    I want to put the queue on my 5.5 ESXi Deth, can anyone help me?

    After I try:

    PowerCli 4.1 connect to ESXi 5.5 = OK with this transaction: Set-VMHostModule-Options "ql2xmaxqdepth = 32.

    5.5 PowerCli connect to ESXi 5.5 = error with: Set-VMHostModule-Options "ql2xmaxqdepth = 32.

    How can I change the depth of the queue of my QLogic card?

    Thank you

    Philippe

    Try to use the Get-EsxCli interface, see 3 Re: length of the queue  

  • Could not start the work with the specification of the queue

    Hello
    I'm trying to chain two jobs, job1 and job2, with job2 to be executed only if complete job1 / succeeds. I followed the steps mentioned in DBMS_Scheduler documentation (http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/scheduse008.htm#CHDHJEFI) and another post on this forum (programmer - work event but I never can job2 to start...)

    Here is the code snippet, I have:

    Start

    dbms_scheduler.add_event_queue_subscriber ('agent001');
    -create job1
    () dbms_scheduler.create_job
    job_name = > 'Task1.
    job_type = > 'EXECUTABLE. "
    job_action = > "mspaint.exe"
    start_date = > systimestamp to the time zone ' Asia/Calcutta. "
    ACTIVATED = > FALSE
    );

    dbms_scheduler.set_attribute (name = > "Task1")
    attribute = > "raise_events"
    value = > dbms_scheduler.job_started + dbms_scheduler.job_failed + dbms_scheduler.job_broken + dbms_scheduler.job_completed + dbms_scheduler.job_stopped
    );

    dbms_scheduler. Enable ('job1');

    -create job2
    () dbms_scheduler.create_job
    job_name = > "job2,"
    job_type = > 'EXECUTABLE. "
    job_action = > "calc.exe"
    -start_date = > systimestamp to the time zone ' Asia/Calcutta. "
    queue_spec = > "sys.scheduler$ _event_queue, agent001.
    Event_condition = > ' tab.user_data.object_name = "Task1" and
    Tab.USER_DATA.event_type IN ("JOB_SUCCEEDED", "JOB_FAILED", "JOB_STARTED", "JOB_STOPPED")',
    ENABLED = > true
    );

    END;
    /

    Job1 (that starts Microsoft Paint) starts fine, EM shows Job2 as expected. But never starts Job2... I am running as SYS (as SYSDBA), so I don't think that the user rights should be a problem. Suspecting a problem with the queue of the event, I tried this:

    Subscriber SYS. AQ$ _AGENT;

    -create the Subscriber...
    DBMS_AQADM. CREATE_AQ_AGENT (agent_name = > 'agent001');
    Subscriber: = SYS. AQ$ _AGENT ('agent001', NULL, NULL);
    DBMS_AQADM. () ADD_SUBSCRIBER
    queue_name = > "sys.scheduler$ _event_queue"
    Subscriber = > subscribed.
    rule = > NULL,
    processing = > NULL);

    That did not help either. I'm obviously missing something here, could someone help plz!

    Thank you
    GOPA

    Hello

    Thre is a typo in your example that can be the cause of the problem.

    If you create job1 like that the real name is "JOB1" since Oracle canonicalise it (Please enter it unless it is in quotes).

    If your state of health for the work of the event should be

    ' tab.user_data.object_name = "Task1" and
    Tab.USER_DATA.event_type IN ("JOB_SUCCEEDED", "JOB_FAILED", "JOB_STARTED", "JOB_STOPPED")'

    Hope this helps,
    Ravi.

  • Error to the element of the queue with simulated signal, but not with the DAQ hardware

    Hello.  I get an error code 1 when I run my VI in simulation mode, which is only 3 simulate subvis signal at different frequencies.  The block diagram shows jpg file and the probe is after I stop the VI.  Note that there is an invalid refnum.  I don't know why that is.  I am also including the watch of the probe after a few iterations, there is no error on the probe 64 until I stop the VI, and also noted that there have been no queue items.  This of course means that I don't get to remove the data in loop 2.  An interesting note is that the system works fine when I run the program in data acquisition mode, which is the other case behind the 'simulate signals. "  In this case, the only thing is the DAQ assistant and dynamic data of the tunnel cable.  Everyone can't see what I could do wrong?  Thank you.

    Thanks for looking at my post.  I thought about it about five minutes ago.  I didn't have a timeout on the handeler event, so it was not double check for new items in the queue.  I don't know yet why the probe shows showes that items have not put in the queue because they certainly were.  Maybe "queue items 0" means that there are no items saved in the queue. ?

    Your concern is interesting and deserves a check...  I just ran it without registration, and it seems that the release of the case (the default) record structure is just an empty DDT, a placeholder, I guess.

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

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

Maybe you are looking for

  • My macbook pro is very slow, and often stuck mode programs "not responding".

    MacBook Pro (13-inch, mid-2012) Intel Core i5 2.5 GHz processor 4 GB DDR3 memory at 100 MHz 500 GB of storage capacity SATA disk Operating system OS X El Capitan 10.11.3 It is very slow to start, in addition to open programs, for example, Mail, Safar

  • Tecra A10 - Setup of BIOS password remotely

    I need to set the BIOS password on each machone on my network! Is it possible that I can do this via sccm remotley or something to save me going around each machine and do it manually? Thanks in advance

  • I also dropped my phone in water

    .... I dropped my phone in the water yesterday. I could not find a question previously posted with my particular problem but then there it goes. the phone was completely submerged. The screen was not at the time, and after having disconnected from th

  • firmware K3 note update

    I just 85 MB update, app lock does not work

  • MSDaRT50Eval.msi ERD5.0

    Where can I download MSDaRT50Eval.msi?  I have a box of Windows XP that we lost the administrator password for... I can't get with the guest account.  I have a Technet subscription, but could not find the Diagnostics and Recovery Toolkit.