Producer consumer

How the attached VI may make use of the producer consumer loop?

The operation will be done in a single loop and get the data which is write in the .csv file, how can it be done?

Have you read how a consumer product model can work for you?

http://www.NI.com/white-paper/3023/en

Tags: NI Software

Similar Questions

  • Master/slave producer/consumer Feeback?

    We know that in the models of master/slave and producer/consumer can send information of the master loop or a producer to the loop of the slave or the consumer.  But what to get information of the loop of the slave/consumer back to the master/producer loop?  I think it may return some sort of output or a message saying something like "I finished my work successfully.  This can be done with local variables, but is it really a good idea?  Is there another better way?   In addition, in this case can I just use a sub - vi?    I don't know that I always get the PARALLEL treatment offerred by master/slave and producer/consumer with a sub - vi.

    You can use a notifier to send a return message.  You can use a local variable, but unless you know what you are doing, you might encounter problems with race conditions.

    Sub - VI have nothing to do with producer/consumer architectures.  You can do a p/c with or without sub - VI.  Sub - VI is a way to break the code in significant functional blocks.

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

    Hello

    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 (http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Split-second-lag-when-controlling-two-instrum... and was advised to try the producer consumer Architecture.) I found the documentation on the website (http://www.ni.com/white-paper/3023/en/, https://decibel.ni.com/content/docs/DOC-2431), 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).

  • Producer / consumer set loop of dynamic data item type

    Hey all,.

    I do a simple exercise of producer / consumer in a loop. In my loop of producer I audio Aqcuerir and in the loop of consumer I'm projecting on a chart

    Everything works as I had in mind, the only thing that bothers me is the way that I had to set the type of the element to the block "Get the tail" at the beginning.

    I knew no better way to get the kind of data that I used to just take an another "acquire its" Express VI and which hang. But that may not be the only way to get there, right?

    Note: I know that I might not need to use a producer / consumer design tend to do, but I need to get hold of technology for school work so I came with this exercise just to get a hang of it.

    Thanks in advance,

    Al.

    Al,

    You just need to feed the correct data type in this entry, which you did by getting the output of a second acquire its Express VI.

    You can also use the "Convert to Dynamic Data" function to do this.  When you drop to the bottom of the function, you will be asked to give the input type.  Tests I've done, it seems not to matter, but for example if you chose the entry to a single scalar type, you need to feed a digital constant (change to double type) in the entrance and use the output of dynamic data such as line item data.

    I don't like the dynamic data type because it is not very clear as to what it is.  Another thing you could do would be to use the "Convert from Dynamic Data" function to change the output of the VI of its acquisition to a different data type for more or less to avoid the original problem all together.

  • Architecture feature producer consumer

    I was wondering if the loop of consumer in a producer consumer architecture works only when the loop of producer send him something, or he still works, even if it receives nothing from the loop of the producer?

    It depends on how you put in place. If you do not have a timeout on the dequeue, he'll sleep until he gets a message. If you have a time-out, it will run if the value of timeout is reached.

  • IMAQ Vision: Is not an Image error when using producer/consumer

    Hi any person

    I used the Vision Express to solve the problem of Patern Machine.

    I want to put Assistant and Aquistion in 2 loop parallel. So I used the producer/consumer to transfer data

    After running VI, I pressed the Stop button and I encountered this error

    I think that getting the queue has a problem. I changed Image to Contant control and connect it to the data type of element. I think that this path is correct.

    So, in case of error, it addressed to Coppy IMAQ in Assistant. So I think that I used the Comunication of the queue is not correct.

    How can I solve this problem

    Thank you

    You can see more detail in the following video: https://www.youtube.com/watch?v=i6FOQ2jypXc&feature=youtu.be

    Try this:

    You should put the image process in the loop of the consumer and release it properly.

  • Programmatically change the number of producers in an architecture of producer/consumer

    Hi all

    I've got 3 momo SoMat I am streaming of data to 10 Hz. I plan on 3 producer loops and loop a consumer to treat.

    I am pretty sure when I show my customer that they want to increase the number of devices. This scuppers then the producer/consumer model unless I change by programming the number of producers and the rest of the architecture associated.

    Is there a way to do this or a better architecture?

    Phil

    As long as there is an ID any in your command of the queue, I do not see why your consumer cannot handle the producers as much as you need.  I would turn the producer code in a Subvi.  Make sure reentrant Subvi.  Then, you can call dynamically that VI as many times as you need, one for each instrument.

  • export to spreadsheet - data 2 channels appear in alternation with loop of producer/consumer

    Hello

    I'm having trouble with the function "Export the waveform to the worksheet" - but it is not clear to me if the problem is with how I use the export feature or if I am wrong concatenating two waveforms of different modules of the series prior to export, or if my queue is wired incorrectly for producer-consumer loops.

    I use a hunts SMU-1073 with SMU-6361 and 4330 modules (tension and strain). I tried to change the example of the "entry analog cross synch" for use with a structure of producer-consumer (see VI below).

    The output of the worksheet contains a large part of the data in the string tension, followed by a smaller piece of data (with timestamp) strain, after which the alternate output data between data of tension and strain.

    Can anyone suggest where I could go wrong, or how I could solve this?

    Attachments do not work, so I'll try to post in an empty message directly after this post.

    Thank you

    Claire.

    That's what I thought.

    A number of wire.  -1 gives all the samples available in the buffer (which can be zero for some reason any).  A number will expect that there are many examples.  If the two readings can wait until they have both the amount of data requested.  This way, they will also have the same number of samples and be better aligned in the text file.

    Your loop will continue to run until you press stop or get an error.

  • call Subvi producer/consumer using vi main to gain the image capture

    Hello world

    I don't know if I get the notion of producer/consumer harm. I tried to write a producer/consumer Subvi that simulate continually grab get the image. When I call the Subvi hand while loop with a main vi, it seems to face an infinite loop. I wonder what someone knows how can I activate a Subvi producer/consumer using primary vi? Thanks in advance.

    Kind regards

    Han Yen

    Bettter use this one.  The one above has a 'small' mistake

  • What is the fastest method producer consumer. Queue, RT-FIFO, event

    Hi all

    Another question completed for the pro:

    I recently inherited the labview code that uses RT-FIFO for the transfer mechanism in the architecture of the producer consumer.

    The code was first written in 3-4 years and is currently in LV8.6. It is possible that the reasons for the architectural decision no longer exists.

    I am qualified using a producer consumer queued architecture,

    I understand the RT-FIFO Architecture.

    I started using an architecture based on events from the user.

    (I have attached samples of each)

    I also see the existence of a priority queue

    Each method has its own capabilities and gaps, that hand, nobody knows the relative performance of each method.

    (Assuming that the only process)

    I would expect RT-FIFO to be faster, there seems to be a version of low characteristic of a standard queue.

    What is the perfornace hit to use a coding user-friendly queue more

    RT-FIFO description talks about commications between the time-critical and lower priority threads.

    Until today, I thought that the queues had the same capacity.

    I've included an event method that I commonly use for review by peers and help from other users...

    It allows to:

    1. several producers with different types of data

    2. process 37 production order.

    3 allows asynchronous verification of functional notifiers such as stop, start and abort.

    4. in a system not real-time, it can include interactions of façade.

    What I do not understand on this subject, that's what are overhead or thread priority changes that may occur using this architecture (it solves a lot of problems for me).

    Thanks in advance,

    Hi Timmar,

    Here's a KB article on some frequently asked questions about the RT FIFO: http://digital.ni.com/public.nsf/allkb/7AE7075AF1B2C58486256AED006A029F?OpenDocument

    The more relevant question is #4, I posted below.

    What is the difference between RT FIFO and queues? 
    Functionally, RT FIFO and LabVIEW queues are two pads of first in, first out. However, here are the main differences between them:

    • RT FIFOs run deterministically in LabVIEW and evanescent code queues are not. This comes from the fact that queues use block calls during read/write to the resource shared, while RT FIFOs use non-blocking calls.
    • RT FIFO are fixed size while queues develop when items are added to them.
    • RT FIFOs will execute the code, even if there are input errors. They can (and will) produce new errors and spread the existing errors.
    • Queues work with any type of data, while the data types that can be used with RT FIFOs are limited. Generally any type of data involving allocations of extra memory can be used with RT FIFOs to preserve determinism.

    Let us know if you have persistent questions!

    Ryan

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

  • Funky producer/consumer behavior

    If it's a weird thing...

    I have a loop of producer/consumer taken (especially) of the labview model is based.

    For some reason when I click on the button stop to stop the program, instead he wants to run through the case of default (shown in picture) a second time.  That is, I run the program, that my event, the event takes place through, I click the button stop, then the event goes smoothly once again and finally stops.

    In addition, there are 2 times in my program where I record data, in the beginning where I implemented headers, and after all the data is taken.  If I have the program stops after clicking on the stop button, but before the event through even once (there that while loop which is idling until I click on 'accept the level') if I abandon execution, then the previous run data not saved.  (Although the 1st write to spreadsheet.vi may be overwriting the previous run data, which might be the reason why he is absent).

    What I've done wrong, what makes my program run it twice?

    If you are relying on the destruction of the reference of the queue to stop the loop at the bottom, wrap the structure from the bottom case with another structure of case that starts on the Dequeue elements error - use cases existing in the State without error and any special in the case of the error and discontinuing treatment.

  • measure and order through producer/consumer

    Hello people,

    IAM trying to conduct a projekt automated, to test an actuator.

    It must measure signals, process them and also has to create the actuator control signals.

    So far no problem... But it must also operate 3 ditch or several rounds of tests that each has different ControlSignals.

    (example: Test1 - enter: 40VSin (40 Hz), Test2 - entry: Triangle, Test 3 - input: 100Vsin (100 Hz))

    It seems always not difficult enough, but as a beginner of LabView, I m having a lot of trouble to find the right Structure to achieve all this. normally I use SPS systems, but this time to Labview

    Had a few trys a hav downloaded to them.

    But the Structure of producer/consumer makes problems. It does not give all the ProducerLoop signals. :/

    Is there a way to outher Labview programming more effective on this problem?

    4 I'm sorry the bad English

    Greetings

    State machine...

  • Is the reference of the register of necessary shift in architecture of producer/consumer?

    Hi guys,.

    I was just wondering if the producer/consumer architecture is necessary register wired shift to the reference of the queue or the notifier. Is this necessary?

    I think that it isn't, because it's quite a tunnel but could anyone who thinks that the shift register is necessary, explain to me why it is necessary?

    In each of the samples I found the reference to the queue or the Notifier is connected to a shift register, I tried to wire it to a tunnel and it works well, then, what is the best implementation?

    Thank you in advance.

    Thank you guys for your quick responses...

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

    Florian

    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.

  • Error of timing architecture producer/consumer

    Hello

    I use architecture of producer/consumer for the acquisition of measures of constraint by using several channels. Also, I am interested to write data all 1 minute given that the program should be run for a month. Currently, I get a 200279 error whenever I increase the time of 10 sec. To control the execution of the loop of producer, I use 'weight up to the next multiple ms' function. According to the error message, I tried to fix the samples to read without increasing the frequency of data acquisition, but I still get the same error.

    Thank you

    Piyush

    Your test3.vi was not included, so we do not know what is happening there.

    What is the rate of acquisition for your data acquisition task?  DAQ hardware do you use?

    Have you tried to increase the size of the buffer?  There is a property node that can define it.

Maybe you are looking for

  • ? symbol in the Windows Live Mail response messages

    When I reply to a message in Windows mail, my typical answer is always preceded by the? symbol.  For example.  If I type and send the "thank you" message, it is sent and received '? Thank you' still the? symbol precedes my messages.

  • Photosmart B110 usb - wireless connection.

    Hello I use a laptop HP tries to print with HP Photosmart B110 which is a wireless printer, however my wireless of the University is not strong enough to make it work in my room, so I bought a usb connector which does not connect to my computer, it m

  • Photo screensaver lags when you try to wake the computer

    When I move the mouse to close the photo screen saver, it lags and takes some time.  Sometimes dry 3, sometimes dry and sometimes almost a minute 10.  I tried Win 7 Photo screen saver and Windows Live photos screen saver.  Both are defined to mix and

  • Outlook Print PDF

    I have Acrobat Reader installed. When you use outlook, I try to print an e-mail message to a file, but I don't see any print to PDF option. What I have to install a paid for version of Acrobat, if yes which? So how to fix Outlook to recognize it, the

  • I can not install PS on my mac.

    Hey everybody...I tried to install the CS6 PS on my mac, but wen I click on 'install' appears a messaga saying "the installation program does not start, please download Adobe Support Advisor" but when I click on the link given there's nothing happens