First try the producer consumer Architecture: continuous play and dynamically update settings.


I am currently working with two instruments; an Agilent E3646A and a NI 6212 BNC. My goal is to have the 6212 continuously take measures according to predefined parameters while the E3646A parameters can be continuously updated. This combination simple instrument aims to help me learn the manual architecture; continuous measurement, output dynamic controls and instruments more will be added in the future.

I've already posted on a similar, but more complicated configuration ( and was advised to try the producer consumer Architecture.) I found the documentation on the website (,, searched the forums and built my own VI. While my first attempt at a producer consumer Architecture has solved some of the problems I had when I posted on the subject, however, new questions have been raised regarding the reading and adoption of the VI.

I am currently able to run the VI and update the settings on the device. Previously, I'd get a freeze while the instrument has been updated and could not switch settings until it was done. This has been resolved, although that reading updates only when a parameter has been updated, although it is outside the structure of the event. In addition, the Stop button does not in any context. I also got occasional mistakes on the part of Deqeue, but the major part of the sentence is error-200279 'A tried to read samples that are no longer available' to DAQmx Read. I realize that there is a problem in my loop of producer but have not been able to find a way to solve it.

This is my first attempt at a producer consumer Architecture and already I can see that it is a powerful tool. I read as much as I could and looked at examples, but should have some problems at the beginning. Would be very grateful of any advice so I can take full advantage of the architecture.

Hope to hear from you,

Yusif Nurizade

You're going to overflow this buffer, unless the events are generated faster than "sample rate/number of samples.   Period.  Nothing could be simpler.

You don't need a local to stop your curls.

Try something like this attachment.  I simply moved the structure of the event in its own loop dedicated since it had nothing to do with acquiring data at all.

Data acquisition loop stops very well when you destroy the task and destrying the stops of power queue (sending the default values of the queue for the power control) for EXAMPLE, to ADD a group of setting 'Safe shutdown' to a 'package' and it wire to the Center terminal (Prototype).

Tags: NI Hardware

Similar Questions

  • overflow memory for the producer consumer

    I'm trying to save data from 4 ports to 40.96 Mhz. using a producer consumer architecture and a PCIe NI 6527 B using an external clock.

    I inherited code which works for 2 ports.  I tried to add additional ports and changed the size of the data to the queue and data.  Launch the program several times, reach conflicting error messages after less than 2 seconds from the beginning:

    Error 200284: Some or all of the requested samples are not yet acquired.  [...] To make available samples more quickly, increase your sampling rate

    200361 error: Overflow memory device on board.  Due to the limitations of system and/or the bandwidth of the bus, the driver could not read the device fast enough to follow the flow of the unit.  Reduce your sampling rate.

    What is a race condition between the error messages, a problem of timing of start or something else?

    I approach, how to debug these types of problems?  How can I determine what is causing the error?  I can't single step through because I'm at the wheel of sampling with an external clock.

    Running on labview 2012 Windows XP on the machine who's 3.17 GB of ram.

    Try to reduce the size of your buffer.  In fact, simply leave the calendar DAQmx unwired.  The size of the buffer must be large enough by default.  And then also try to read less data at a time, as data instead of data 500ms 10ms.  What I suspect here, it's that the DAQmx buffer is too large and therefore must use the hard drive for part of the buffer, to slow things down a lot.

    Other notes here:

    1. do not use the time-out to stop your loop of consumer.  Your producer should send an order of a certain type to your consumption by telling it to stop.  In this case, I would use an empty array.  And then, you must release the queue after the loop of the consumer.

    2. you want a constant FALSE to Append Array/String input size of the binary file write.  This will remove the 2 I32s at the beginning of each table that you write.  Eelle are here to tell the size of the table being written.  But since you are just data flow, I doubt that you care about those.

    3. instead of the entire setup of producer/consumer, have you considered using just the DAQmx Configure Logging VI do DAQmx stream directly to a TDMS file for you?  Makes things much faster and much easier on you.

  • Trigger consumer in a producer consumer architecture

    I want to trigger the loop of consumer in a producer consumer architecture, so that it can do what it should do, until he receives something new producer loop.

    Can someone tell me please how to do this?

    Thanks in advance!

    If the Dequeue-1 item timeout entry turns off the timeout.  That means he'll stay there forever until the data is available in the queue.

  • Data types in the design for the producer consumer model

    Is it possible for me to use any type of data in a model of design producer consumer, without specifying specific data type?

    what I mean is if there is a way to connect to a data type with which I can use any other type of data, not to mention that one that I have connected, and if not, how can I specify the data type for a number or any other data type, for use in a design of producer-consumer model?

    You can make a part of your cluster of data a Variant.  It will take any type of data.  A common architecture for the producer/consumer is a cluster which is an enum and a Variant.  The enum contains all possible "orders", you might want to send.  The variant contains data that could be of any type.

    Ungroup you in the consumer and get the enum and Variant.  Attach the enum to a case structure.  In the specific case, convert the variant type in a data type of regular LabVIEW and with it as you please.

  • Using the producer/consumer with GPIB/VISA model

    Hi all

    So I have a .VI I learned to communicate with my camera, I joined. I tried strip down as much as possible, just to understand the concept. It basically just takes a resource VISA name, use this open VISA, then uses the same resource VISA to write a command that reads the data from my machine (xall?) and then bed in 500 bytes and which prints. If it works, and it's good.

    I try to use producer/consumer model for doing essentially exactly what this guy. I have a RLC, I want to press a button that starts my measure, I want him to taste several times per second, save the data in a text file or .csv and then stop when I press the stop button. Thus, he will be given indefinitely potentially.

    I would like to have the data in a format something like:

    Time C R

    0 5.0 4.3

    ... etc.

    I read the link of model p/c above, but my LabView knowledge is still low. Currently, my plan is to take the part of read/write of my attached VI, which are a sub - VI and then put that in the pink box in the VI for the producer/consumer above page that is labeled "produce data to be placed in the queue":

    What prevents me to do this, it's that I can't get the piece of read/write to work properly as a standalone Subvi.

    What is the right way to go about this?

    Thank you!

    I put if you actually found data of your instrument.  Your instrument is not made to take new measures or just send you the last reading, she did.

    Insofar as the file IO, I recommend that you learn to use the palette for the file IO functions.  You need to create your file before your loop, write in a text file inside and then close after the loop.  I don't do the thing the comment on the express VI entry will do what you want.

  • Cannot terminate everything in a loop to the producer/consumer

    I have attached a simple vi which was built from the producer/consumer (events) model.  In vi I set up a counter.  I want to be able to complete the meter when you press the stop button.  This does not work as expected.  The meter goes to its full count before the program stops.  The vi works as expected when run in execution to highlight mode.  Cannot understand it.

    Thanks in advance.

    Race condition.  No matter what time something behaves differently with that highlight run it at full speed, and suspect it is a problem of synchronization due to a race condition.

    As soon as your producer loop has the command queued up, she is ready to handle the next event.  If you press the stop button, it is ready to deal quickly and the stem while the ends of the loop and Stop immediately gets back to false.  This probably happens before the loop of consumer has the opportunity to read the local variable of the button stop in the moment, it's true.  Have your consumer while loop redefine the Stop button to false instead ensuring consumer loop has a chance to see if it is true.

  • Convert single while loop with variable Timing literal to the producer consumer

    I have a controller for a biological system that updates every n minutes or every minute 2n, under certain conditions. My app has a synchronization controller calculates if the current iteration is n or 2n and feeds the output of this calculation in a loop of "Timing" VI in my all. If I understand correctly, this is similar to the issuance of an order of sleep() in a language similar to C and should be avoided. I'm refactoring my code and I heard that they are well suited for this kind of things. Here's how it should work:

    1. Loop begins at the time T, T is saved.
    2. Schedule controller runs and calculates if loop will get minutes 2n or n minutes. This controller will take a number of milliseconds to complete, so we are is more to time T.
    3. Now that the update interval (n or 2n, let's call it u) is known, the loop must until T +u fill.
    4. The PDC is executed, but a number of milliseconds to execute.
    5. The rest of the time until the next iteration of loop should produce the CPU for other processes.

    It sounds to me like it's the kind of a real-time system, although as long as we are in the minute of the original deadline, there will be nothing wrong.

    What the producer-consumer loop would look like? Assumed that the synchronization and the main order controller are separate from the VI.

  • My commputer won't allow updates. When I try the blue bar just continues to run. I tried to run Powershell, but it stops and says error has occurred.

    Original title: Powershell

    My commputer won't allow updates.  When I try the blue bar just continues to run.  I tried to run Powershell, but it stops and says error has occurred.  What should I do


    1 - what you mean that you can not install Windows Update? If Yes, then the updates?

    2 are. what Powershell you referring?

    3. you receive an error message? If so, then post back the exact error message.

    Answering these questions that could help us help you better. The following article could be useful if you are referring to the Windows updates.

    Problems with installing updates

  • Installed InDesign free 30 trial but realized that it wasn't the app required so I cancelled. Now try installing Acrobat X 1 Pro and can not go beyond the "Please close the following applications to continue:-SafariNotification' and the button to learn mo

    Today, I signed into Adobe Creative Cloud and installed free 30 days than indesign test but it was not the app required so I cancelled. I am now trying to install Acrobat X 1 Pro and cannot go beyond a box stating "Please close the following applications to continue:-Safari and - SafariNotificati 'n' help not the button read more." I can connect on Safari and I checked my email address but when I press retry the box back again! Any ideas, anyone please?

    Please see

  • Hi, I am told by a website mFirefox is out of date so I can't get all the features. I continue to download an update, but it continues still to be. Could you please help me. Thank you.

    Hi, I am told by a website mFirefox is out of date so I can't get all the features. I continue to download an update, but it continues still to be. Could you please help me. Thank you.

    Download the latest version of Firefox to:

    Uninstalling Firefox

    Install Firefox on Windows

    Check and tell if its working.

  • How is it when videos play my computer don't know the songs or videos. It produces noise weird then plays and continues until the song or video is more

    It sounds like a voice of an alien on the part of the video and then the regular voice will play and then it continues at this rate and I can't get the videos work properly without the charger which sucks.


    1. What is the operating system installed on your computer

    2. don't you make changes before the show?

    3. this happens with all or specific files?

    4. have you tried to play these files in another software?

    5. What is the file extension of the file that you are playing?

    6. using windows media player?

    Please provide more information about the problem you are experiencing in order to help you better.

    Please see the link below.

  • State machine in queue with the producer consumer


    I am trying to build a VI where the user allows some Boolean controls on the front panel.
    VI uses a producer consumer in which based on Boolean values clicked architecture.
    some States are queued one recorded in a table.
    After the user is done by selecting, Boolean values should get disabled and the table of States
    should be indexed one after the other.
    It is an attempt to solve the review model car wash.
    However, the VI does not generate the required results.
    Can someone help me please understand what is the correct way to this implementation.

    Thank you

    Its because you have wired the consumer while loop the first stop. Remove and in your loop of consumer, make a comparison of the States that you receive and if it is equal to stop, stop the loop of the consumer.

  • error 1 to queue in a producer/consumer architecture

    Hi all

    I use an architecture-based on producer/consumer queue, as shown in the screenshot below (which is a simplified diagram of what I want to do).

    As you can see:

    1 / in the producer of the loop, I read data from two LV2: map Wafer and HAD current

    2 / in the loop of producer, these LV2 are used as output of a sub - VI, called 'Wafer map change. The Subvi, allows the user to change the 'Wafer map' picture indicator located in the loop of consumption, by double clicking it.

    3 / when the Subvi has run, it displays the picture indicator updated (Wafer card) and the new 'Course DUT' coordinates.

    4 / the two variables are grouped and transformed into a Variant.

    5 / the variant is then enqueud in the queue of the 'hand '.

    6 / this variant is converted from inside the loop of consumption, and photo indicator is unbundled.

    7 / Finally, the map LV2 Wafer is written and the modified photo indicator.

    This type of data flow worked earlier, but now I am facing the following error (it's my french translation):

    Error 1 occurred: Add an element at the end of the queue in of automatic Test Bench

    Possible reasons:

    LabVIEW: An input parameter is not valid. For example, if an entry is a path, it may contain a character that is prohibited by the operating system, as? or @.

    NOR-488: The command requires a PDC GPIB controller.

    I have no idea how it appeared. But now I'm stuck, and I would be grateful if someone can help me with it.

    Thank you.

    Kind regards


    Your method to allow the judgment seems suspicious.  Say that there is an error in the loop of consumption.  This stops the loop of consumption and the stop button set to TRUE.  But the value of the stop button will not be read until the next iteration of the loop of producer.  So if you decide to hit the button on the Insert, the queue was already destroyed, then you will get your error.  And all these local variables just shouts "RACE CONDITION" for me.

    Get a mechanical action of the Stop button latch when out.  It is the default setting for a button.  Then place the terminal inside the event (which you already have).  A REAL outside this case, wire OR with wire error to stop the loop of the producer.

    You need to do is create a command to stop the loop of the consumer.  This order will be sent in the case of changing value of stop button.  You should probably send this command after the loop of producer, just in case where the loop of producer created an error.

    You can also use a node property of the button stop to set the Value property (signs).  This will cause the structure of the event to raise.  This will cause the producer loop stop if the consumer has an error.

  • Instead of using the structure of the event with the producer consumer?

    I used the architecture of producer-consumer in the past to control a state machine with the structures of the event.  I'm working now with the basic version of LV that does not include the structure of the event.  Can anyone recommend alternatives to the use of the same architecture in this case?  Thank you, David

    Before the introduction of the structure of the event, the only option was the election.  Control terminals are in a time loop (the producer) with shift registers and a wait, usually about 100ms.  At each iteration of the loop, the control's current value is compared to the previous value.  If it has changed, and then take appropriate action.  Andrey suggested, queues are a good way to pass information between the loops.

    It works for the equivalent of the value change events.  Things like mouse to top or filter events were much more difficult or not possible.


  • Getting errors on the 3 Windows updates: 2699988, 270162, 2685939. On the first try error codes were 0 x 80246007 and 0x8007010B

    Getting errors on the 3 Windows updates: 2699988, 270162, 2685939.  On the first try error codes have been 0 x 80246007 for all 3, try subsequent was 0x8007010B.

    Configuration is Windows XP SP3 with MSIE6 (test the system reads old browser).  Any suggestions?

    Original title: get errors on the 3 Windows updates


    When you try to install the updates on the Windows Update Web site or the Microsoft Update Web site, you may receive a "0 x 80246007" error code

Maybe you are looking for