Classic Producer/Consumer question

All,
I've a straightforward (hopefully) question regarding the producer consumer thread example. While I get the entire picture - I have a question about the lines in the code :
               sleep((int)(Math.random() 100));*
in the Producer. WITHOUT this line, the output goes haywire (with Producer and Consumers putting/getting values randomly)- while with it, the producers and consumers start behaving normally (ie Producer Puts and Consumer Gets like clockwork)
Why is it necessary to put this line in? What's it trying to put to sleep anyways and for what reason?
public class DerTest {
     public static void main(String...argv) throws Exception {
          Holder holder = new Holder();
          Producer producer = new Producer(holder);
          Consumer consumer = new Consumer(holder);
          producer.start();
          consumer.start();
class Holder {
     private int i;
     private boolean hasPut;
     public synchronized void put(int i) throws Exception {
          while(this.hasPut == true) {
               wait();
          this.i = i;
          this.hasPut = true;
          notifyAll();
     public synchronized int get() throws Exception {
          while(this.hasPut == false) {
               wait();
          this.hasPut = false;
          notifyAll();
          return this.i;
class Producer extends Thread {
     private Holder holder;
     public Producer(Holder holder) {
          this.holder = holder;
     public void run() {
          int i = 0;
          try {
               while(true) {
                    this.holder.put(i);
                    System.out.println("Putting : "+i);
                    i++;
                    sleep((int)(Math.random() * 100));
          } catch(Exception e) {
               e.printStackTrace();
class Consumer extends Thread {
     private Holder holder;
     public Consumer(Holder holder) {
          this.holder = holder;
     public void run() {
          try {
               while(true) {
                    int i = this.holder.get();
                    System.out.println("Getting : "+i);
          } catch(Exception e) {
               e.printStackTrace();
}

because the printlns are not synchronized with the get/put calls. put those printlns inside of the get/put methods and you will see the output you expect.

Similar Messages

  • Producer/consumer question

    Hi everyone
    I am stucked with a problem using the producer/consumer VI.
    My VI continuously acquires data from the DAQ using a producer/consumer VI.
    In the maintime, I would like to introduce and save some notes that can help me to identify the acquired data in a separate file without stopping the acquisition.... but  I don't know how to do it or modify the producer/consumer scheme.
    Any suggestion?
    Thanks for the reply
    matomato
    Solved!
    Go to Solution.
    Attachments:
    ProducerConsumerData_time_Y_Sim_Start_13.vi ‏70 KB

    matomato wrote:
    Hi Smercurio_fc
    The purpose of the code with the Write to Spreadsheet File on the left is to save some comments without stopping the acquisition.
    The problem with it is that it only runs once at the beginning of the program.
    ...The new one should be be to introduce and save his details without stopping the acquisition.
    Save where? In this secondary file, or in the measurement file as a comment?
    Technically, I don't know how to modify the producer/consumer scheme to introduce the new loop with the case structure maintaining the data acquisition as the main loop.
    Hope to have answered your question, if not let me know.
    I'm not sure I understand what you are asking. Are you saying you don't know how to add another loop to the code? Or are you saying you don't know how to use the event structure?

  • Old Producer/Consumer Example question

    how would I take this code, the old producer/consumer example, and make it for 2 consumers and 1 producer?
    basically, like this:
    Producer put 1
    Consumer #1 got 1
    Consumer #2 got 1
    Producer put 2
    Consumer #1 got 2
    Consumer #2 got 2
    etc.....
    ***********Producer.java***************
    public class Producer extends Thread {
    private CubbyHole cubbyhole;
    private int number;
    public Producer(CubbyHole c, int number) {
    cubbyhole = c;
    this.number = number;
    public void run() {
    for (int i = 0; i < 10; i++) {
    cubbyhole.put(i);
    System.out.println("Producer #" + this.number
    + " put: " + i);
    try {
    sleep((int)(Math.random() * 100));
    } catch (InterruptedException e) { }
    ***********Consumer.java***********
    public class Consumer extends Thread {
    private CubbyHole cubbyhole;
    private int number;
    public Consumer(CubbyHole c, int number) {
    cubbyhole = c;
    this.number = number;
    public void run() {
    int value = 0;
    for (int i = 0; i < 10; i++) {
    value = cubbyhole.get();
    System.out.println("Consumer #" + this.number
    + " got: " + value);
    ***********CubbyHole.java***********
    public class CubbyHole {
    private int contents;
    private boolean available = false;
    public synchronized int get() {
    while (available == false) {
    try {
    wait();
    } catch (InterruptedException e) { }
    available = false;
    notifyAll();
    return contents;
    public synchronized void put(int value) {
    while (available == true) {
    try {
    wait();
    } catch (InterruptedException e) { }
    contents = value;
    available = true;
    notifyAll();
    ***********ProducerConsumerTest.java***********
    public class ProducerConsumerTest {
    public static void main(String[] args) {
    CubbyHole c = new CubbyHole();
    Producer p1 = new Producer(c, 1);
    Consumer c1 = new Consumer(c, 1);
    p1.start();
    c1.start();

    instantiate another consumer.
    public class ProducerConsumerTest {
    public static void main(String[] args) {
    CubbyHole c = new CubbyHole();
    Producer p1 = new Producer(c, 1);
    Consumer c1 = new Consumer(c, 1);
    Consumer c2 = new Consumer(c, 2);
    p1.start();
    c1.start();
    c2.start();
    but then modify CubbyHole so that it checks that it has been consumed twice (as thats what you want, you said). Instead of using boolean available, use an integer flag that counts how many times its been consumed, and then reset the flag when it gets to 2. Something like that. Is this a college question? Do your homework. ha ha.

  • How to change the transmissi​on rate of data flow in producer/ consumer pattern

    Hi All
    I am new to labview and trying to design a application to transfer image data in different rates, that means I can change the transfer rate in the transmission process. In fact,I refer to the the Queue Basic.vi to achieve this function by Changing the delay value of dequeue and enqueue.The program is divided into three parts:
    The first part is the sender in vc used to split and send image data.Data size is 226kb and each time we send a 1kb packet;
    The second is labview rate-change part,use producer/ consumer pattern and queue to transfer data;
    The third one is the receiver in vc,receive data in sequence and synthetic images.
    The entire transfer process is: image data was sent from the sender to producer loop through DLL, then enqueue--dequeue in consumer loop--DLL--receiver.The sleep time in vc sender is equal to the delay value in producer loop and this makes it look like the data generated as in the loop.
    Now this is where my dilemma is:
    When transferring data, if the producer loop and consumer loop delay value are equal(both 20ms), I can see image synthesis at a constant speed and no data lose; if I change the consumer loop delay value and make it greater than the producer delay(one is still 20ms and another is 50ms),that means receive in a lower rate and store data in queue. I can see Elements in Queue
    increase but the image data randomly lost, and the image synthesis speed is not reduced.
    My question is why image data loss and I can't see the image synthesis speed reduced when change the delay value in consumer loop?
    Do anyone know how to solve the problem? Are there any examples I can refer to? Any suggestions are greatly appreciated!
    Attachments:
    image1.JPG ‏56 KB

    thisoldman,
    I don't have '/usr/lib/modules/3.17.3-1-ARCH/build/Documentation/VGA-softcursor.txt' on my file system. Does it contain the info about changing the blinking speed?
    P.S. The other two links I found yet before starting this thread. I only found in them the recommendations about changing "the color and shape of the cursor and turning blinking on/off" (as I mentioned in the original question). Did I miss the info about the blinking speed?
    PPS: I found the vga-softcursor.txt here: https://www.kernel.org/doc/Documentatio … cursor.txt
    But that file doesn't tell about changing the blink rate either.
    Last edited by nbd (2014-11-23 20:55:41)

  • Input and output on same device, producer/consumer structure

    Hello interested people,
    I have a question about using the same device for both digital inputs
    and outputs.  I have written a simple program of one while loop
    that continuously polls the device, processes, and requests.  I
    have addressed the device using two DAQmx Asst. and I have attached
    them with their error in/out cluster terminals to provide data flow and
    eliminate the chance of addressing the devices at the same time (which
    produces an error).  Now I want to change this program structure
    to a producer/consumer loop foundation with state machine.  
    In this design, I will have the DI in the producer loop and the DO in
    the consumer loop, under one of the states.  I can't simply
    connect the error in/out ports in this configuration, so my question is
    how to avoid the error caused by addressing the same device
    simultaneously with two different tasks (input and output)?  I
    have attached two VI's, the "One Loop" vi is the original configuration
    (simplified), and the Producer-Consumer vi is a NONSENSICAL program
    that simply represents the desired configuration.  (I don't need
    any comments on the programming of this vi, it is only an example for
    illustration of the problem). 
    I am thinking about bundling the input data and the error cluster, both
    from the PXI 6528 DI, into one cluster, queueing that up, and
    unbundling the de-queued elements for some kind of data flow between
    the producer loop and the "Request" state of the consumer loop. 
    Is this the right approach, or am I barking up the wrong tree?
    Thanks
    Attachments:
    One Loop DO DI.vi ‏102 KB
    Producer-Consumer DI-DO.vi ‏106 KB

    Hello,
    It sounds to me like you really have two modes:
    1. user interface actions determine execution
    2. user interface is locked, and execution is automated.
    I think it would make sense to use the producer consumer for an architecture.  Basically you would do the following:
    1. program the producer to handle the user interface as you normally would.
    2. provide one additional event case in the producer which would be your "automated handling" case.  In that case, you could put a state machine which could run until whatever conditions were met to put your program back in "user interface mode".
    Keep in mind that you can use custom USER EVENTS to programmatically generate events ie. you can trigger the start of your "automated handling" form anywhere in your code at virtually any time.
    I think this would allow you to take advantage of the producer consumer architecture in its intended spirit, while integrating an automated routine.
    I hope this helps!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Producer consumer vs state machine

    Hi there,
    I have been on and around for quite a while to understand how can I re-design an application, which was originally built using a mix of sequence structure, while loops and event structures. And now I am making a newer version of the same application, for research purposes, while learning the LabVIEW techniques. Earlier I used LabVIEW versions 5 and 6 to make simple programs for fuzzy logic and neural networks. And that's not a good reference.
    Ok, after learning that Producer Consumer (PC) and Standard State Machines (SSM or SM) are two new approaches for a better (scalable, flexible and efficient) coding as suggest by veterans, in one thread where I asked about another issue, I have started digging into this topic and now I am on a point where I have to implement it finally (spent pretty much time in the learning phase).
    I have several questions.
    To start the discussion, I would give a brief description of my application.
    It's a networked application, where the network communication happens using DataSocket (one reason to use LabVIEW as the environment).
    We are talking about the client application, which communicates with other applications on remote computer, via Internet.
    User interface involves a tab control, with several pages-
    On startup, the controls/indicators (now onwards referred as controls only), are initialized, datasocket connection is checked (rather internet is checked, and a connection established with the remote datasocket server) (page 1)
    If connected to the datasocket server, the user selects Login/Registration (page 2)
    Login and/or Registration happen on page 3/4
    Then the user sees a table of remote users to connect to (page 5)
    Upon selection of a remote user, and after clicking on "connect", the user will see a video indicator, with a lot of other controls. (page 6)
    On this page with video indicator and controls, the user has a lot of activities, in which many messages are sent and received to/from the remote machine.
    the user may disconnect and go back to page 5, and log out and go back to page 2 and so on.
    I hope this is clear.
    I have thought about two different ways to do this application. Using PS or by SSM.
    In the attachments, I have given a diagram (with errors, of course, because of unlinked controls), for each of the approach, plus the original application's diagram.
    I hope this is sufficient for anybody to understand my case and give suggestions.
    I am looking for suggestions about which is a better model for my type of case. I have been to discussions like this one and saw that there are many issues regarding dequeue in PC model. So I am curious to know if SSM is a better and latest model or it's more primitive? Which looks better for my application's performance?
    Thanks ahead!
    Vaibhav
    Attachments:
    OldDesign.vi ‏41 KB
    PCDesign.vi ‏42 KB
    SSMDesign.vi ‏46 KB

    Vaibhav wrote:
    @ Harold
    Thanks. Any suggestion how can I start and stop that loop in parallel with other loops? Like, if some event occurs, the loop should start execution, and keep on moving, while other events are being traced and executed.
    In those examples where you had a while loop inside a case structure, that bit of code will only execute one time.  It will immediately read the boolean at the start of the program, if the value was true before the porgram started, then the while loop will run.  Once that while loop stops, the case structure will end.  It will never execute again unless you completely stop and restart your program.  If the boolean is false before the program starts, the false case will execute immediately.  Nothing happens since it is empty and it is done, never to run again (unless you stop and restart your VI)  You should turn the structure around.  Put the case structure in the while loop.  Make sure you put a small wait statement in the loop so that it doesn't run full speed eating up CPU cycles just polling the status of the boolean.
    @ Ravens
    Thanks for the detailed comment.
    One thing I would clarify. The user will not be able to switch between the pages using the tab control. The program will direct appropriate page to the user. I kept the tabs visible just for your idea of the pages. Sorry, I didn't mention that.
    Do you think it's still a bad design?
    If the tabs will be hidden or disabled, you will probably be okay.  I wouldn't call it a bad design.  I wouldn't do it that way.  But as long as you understand the possibility of problems and prevent that.  Especially some time down the road when you modify the program in some other way that could lead to a problem because you forgot about the dependencies of the event structures on the state of the state machine. 
    Yes, I agree about only one event structure to handle all the events. But since the user will not be able to click somewhere else, other than those possible controls, I thought to keep it like this.
    I thought the events are captured only if we are in that case. I think I am wrong, right? Events are captured at any time, even if the case has never executed before, or will never execute.  Ok, The events will be captured, but will not be executed until in that case.
    And that's the reason why I have two separate event structures, in two separate phases of the program.
    Because, prior to page 6, the events will occur sequencially. The user will click somewhere, then some message will be transmitted over DataSocket, then some message may come , then again some user action and so on. But, when the user starts using page 6, there will be parallel process of user controls events and actions, and incoming messages and corresponding actions. For this, in the page 6, I need a different kind of execution. So I separated the two event structures.
    At first I thought to have SSM, and then I thought to PC, just because I can have two separate parallel processes - one for user events, and another for messages (because that way I can take maximum advantage of message tracking). But looking at other complexities, I find SSM more appropriate. Can you please tell me how can I have my message loop and events loop parallel to each other and just one event structure?
    You can have a dequeue function in your state machine loop and have it be a consumer loop.  Use a timeout on the Dequeue.  If there is a timeout, have the statemachine execute normally after that perhaps just passing the enum wire straight into the case structure of the state machine.  If it doesn't timeout meaning you got a message, then look at the message that is dequeued and act on it.  Perhaps it means ignoring the enum coming in from the shift register and changing the enum to something else to feed into the case structure of the state machine.  Attached is an example
    Attachments:
    PCDesign[1]_BD.png ‏6 KB

  • Producer Consumer Issues

    Hi all,
    I'm creating my first producer-consumer program, and I've run into a few problems.  I have two producer loops (one is a pressure controller and the other is power reading loop).  I've used queues to pass data into the consumer loop which records the data (at a much slower rate).  The problem is that the producer loop (the pressure controller) contains the stop signal for the program.  So I've had problems shutting down all 3 loops.
    My questions are......Do I have to shut down the consumer loop first, then the producers?  What is the best way to pass stop signals (local variables, booleans in a queue, etc)?   Also when I try to use the producer loop to stop the other loops I get the attached error.  Anyone have any recommendations for making an efficient stopping procedure?  The wait inside the consumer loop is quite long (5 min), so I'd like the minimize the stopping time, if possible.
    I've attached two versions that I've been working with.  They use version 8.5.
    Thanks in advance - Dan
    Attachments:
    Final Controller No Inputs.vi ‏274 KB
    Final Controller Other.vi ‏274 KB
    error.JPG ‏19 KB

    I like to stop the program in the producer loop, and wire the error output of the dequeue element function to the stop of the consumer loop (when the producer loop stops the dequeue element function will generate an error, the error out will cary this to the stop and the loop will stop).  Hope this helps!
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.

  • Producer/consumer inside producer/consumer

    Hello all,  I am using a producer/consumer event structure within a producer/consumer....not sure if this is the best approach.  The main vi is setup to perform several different tests based on the user input.  It does an initialize, setup, and read a pressure controller.  The main vi continues to read the pressure controller until the user presses a button to perform a particular test. When the test is complete, it goes back to the main vi and monitors the pressure controller.  The user can perform another test or stop the program operation.  My question is......In the individual tests I use an enqueue element which sends it back to the monitor pressure controller in the main vi.  Is this the best approach?  THANKS in advance!
    Alma

    So the subVI is a popup window?  And nobody will be able to manipulate the main VI while the popup is there?  If so, I don't see much wrong with this.  But if you need to change things in the main VI while this subVI is running, it won't really work well since your main's consumer loop will not be iterating until the subVI is complete.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Producer/consumer architecture - timing

    Hello.
    I have some question about producer consumer pattern.
    People say that consumer shound NOT add elements into producer queue. Lets say that some states in in consumer need to stay active for eg 5 minutes. We also should be able to pause/resume state execution and exit program in any time. 
    I ve used functional global timer but consumer adds elements into queue and this should be avoided.
    How to solve timing problem? Some people have written about creating another thread - watchdog or asynchornous calls to vi...
    Could someone explain this to me?  :

    People have consumers add to their own queue all the time.  It is usually in a Queued State Machine though.  If you have a process that just needs to run for so long, then have the consumer run another while loop until the time is up.  It can then process the next item in the queue.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Producer/consumer architecture over network variables with Real-Time target.

    Hi all,
    I am maintaining a producer/consumer data acquisition program to be deployed on a real-time target. The main code is deployed to and run on the real-time target during experiments, but was having trouble because the program was originally designed to write all experimental data to disk on the real time during acquisition, which puts the whole experiment at the mercy of the hard drive. I am now trying to rework the code so that the host takes care of logging, so that my time-critical loops don't have to wait.
    I am currently using LabVIEW 8.5
    I have two questions:
    First, how can I programmatically call the data-logging subvi on the host so that it runs in parallel with the main vi which runs the experiment and collects data on the real-time? I have attached the test code that I have been working with to figure this out, but it does not run the logging vi continuously in the background. I am aware that there is better functionality for this in newer versions of LabVIEW, but I would prefer not to upgrade unless there is no other option. I would like to be able to run my data-generating vi and have it start the data logging remotely.
    Second, is there a way in the host VI to read values off the network variable using an event structure rather than polling it for updates?
    Any help would be sincerely appreciated!
    Attachments:
    testRemoteLogging.zip ‏124 KB

    VI server
    Mark the target VI as served on the machine on which it will execute and use VI server Call by reference to invoke the served VI.
    This used to be taught as THE way to communicate syncronously with an RT app.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How does the DAQmx read.vi work in producer/consumer mode

    Dear all,
    I have one question: how does the DAQmx read.vi work in producer/consumer mode ? 
    I mean if i set the acquisition samples quantity is 5000,(see the enclosed picture), how does the DAQmx read.vi acquire the samples ?
    5000 samples one time ?
    And how does the write. vi work ? Also 5000 samples one time ?
    Look forward to your reply.
    Thank you.
    Attachments:
    producer consumer mode.png ‏28 KB

    It will read 5000 samples per channel.
    The Write Measurement File just writes whatever you give it.  It you send it 5000 data points, it will write the 5000 data points.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • XY graph in producer/consumer structure

    Hey there,
    this is my first shot at setting up a producer/consumer structure to operate a power supply (I've posted several questions about it here, but since this is more a Labview programming specific question, I thought this might interest more people). Seems to be working fine when using simple controls. But I also want to display the voltage plotted against time. To get the voltage, I have to send a control to the power supply to get the measurements in answer, get the voltage from there and put it in the graph. Since I can only send one control at a time, I've chosen to queue the "read" state behind every control (so for example, when queuing (or queueing?) "Run", I send "Read" immediatly afterwards so as to start the reading). But of course, every time I send a new control (change parameters for example), the graph is set back to zero. Does anyone know a way around this?
    This is just a tryout, no error handling or even closing of VISA sessions.
    Attachments:
    Producer consumer tryout.vi ‏37 KB

    crossrulz wrote :
    Not really.  Your waits are in parallel, so the delays do not simply add up.  You really should get rid of the 150ms wait that is outside of the case structure.  If you need to introduce any delays, they should be in the specific cases that will need them.
    Well, the power supply doesn't accept commands that come in at a faster rate, so I was thinking that by putting the wait function there, I would manage the queue in a way that it only sends commands at this specific rate. It's only the read function that needs to be executed at specific intervals. All the others don't need to. So I would still delete de 150 ms and put it inside every other command case?
    crossrulz wrote :
    One more comment on your code.  If you have something that needs to constantly happen, I just use the Timeout ability of the queue.  You could just set your timeout to be 500ms and then on timeout it performs a read.  This would eliminate the need to enqueue the Read command at all.
    You mean the timeout abilty of the queue? How would I go about this, create a separate "enqueue element", wire a constant of 500 to the timeout and the read state to the element input, then wire it to the Master Queue? I was thinking of using the timeout ability of the event structure. But I guess that wouldn't be ideal if I have more than one producer loop... Anyways, you Sir, are a genius.

  • Producer Consumer Subpanels, User events and DAQ

    Hello All,
    I am working on a Producer Consumer application and have beed looking at subpanels for user navigation. The application needs to be capable of responding to user generated events but also manage data received from attached data acquisition and control hardware. This is a 2 part question.
    I need to implement about 15 screens in this application and have started integrating subpanels. I need to be able to navigate from one subpanel vi to another using subvi buttons but dont understand how to build this functionality. Can I build functionlaity so that when I click on a subpanel loaded vi's button it will load the vi referenced by that button and the original dissappears.
    I have a 3 loop producer event template consisting of (1)data acquisition producer, (2) user event producer and (3) consumer loop but theres not much detail, are there any reasonable templates out there? I have seen the data- consumer and user-consumer but no mix of all 3.
    Advice appreciated
    Chris

    I use subpanels to host my display vi's and control them dynamically.  I would have a loop or vi process that manages your subpanel.  You could use user events, queues or notifiers to send messages to this subpanel manager to perform the basic functions such as loading a vi into a subpanel, removing a vi from subpanel (you can remove and stop the vi or keep the vi running in the background or even make it a floating vi.)  A subpanel button can create a local event which in turn could trigger a user event or message to the subpanel manager.  I have attached my subpanel manager to give you some ideas...
    Attachments:
    Subpanel Manager.vi ‏39 KB

  • Best way to handle this producer-consumer situation

    This is, i'm sure a common thing, however, I never really thought about it before. I can't post my VI so a description will have to do. It should go without saying, but I will repeat it's producer-consumer architecture. Let's say you have a signal generator and all the controls for it are in a cluster. A value changes, fires an event in the producer loop and you compare new and old values to determine which button changed. Cool, all good. So then I queue up a read front panel state in my prodcuer loop which is dequeued in my consumer loop. The read front panel state loads all the new values into a cluster which then is fed into a shift register to be accessed from anywhere in my code (see here).
    Now my question is, what should my next state be that I queue up? If I have a single "send commands to sig gen" state, in my consumer loop I again have to determine which value changed in order to know which command to send (because the original determination of what changed was in the producer loop). However, if I have an individual state for each command I want to send, my case structure will get very big, very fast.
    Final option is have one send command state and just write all data on a single control's value change, whether it's new or not (this seems overkill).
    Suggestions please?
    CLA, LabVIEW Versions 2010-2013
    Solved!
    Go to Solution.

    For situations like this I would not send a "state" to the consumer.  I send a "command."   When the consumer receives a command, it determines whether that command is executed immediately or whether it completes the task in process and then handles the new command.
    Along with the command I send a parameter or parameters.  For your signal generator the parameters would probably be something like a cluster of "control ID" and "value."  The control ID would probably be a typedefed enum and the value a DBL.
    What ever you decide, think about it, plan it, and document it before you code it.
    Lynn

  • LV producer consumer and TestStand

    In the TestStand process model, I've replaced the original Get UUT Serial Number dialog with a custom dialog that has some additional fields, and will (eventually) allow the operator to BarCode scan the serial number.
    I'm thinking about using LabVIEW's template for Producer/Consumer.  I basically want to allow the user to hang out at this dialog until the click on either "START" or "CANCEL".  They can tab to the different fields, and Scan in the serial number if desired.  What types of 'events' would I want to capture?  Is this even the right design pattern for this situation?
    Also, this dialog needs to be modal (in front of TestStand executive). 
    Thoughts?

    mrBean,
     By custom dialog do you mean a seperate VI that you open and show the front panel when the step executes?
    If that is the case the producer consumer might be overkill. From what I've seen one of the main reasons one would use this pattern is to seperate the acquisition loop from the data record loop. In that manner the data recording doesn't slow down the data acquisition. I've used a wedge type barcode scanner in the past and it is pretty easy to impliment.
    On a side note I really enjoy reading your posts on both of the forum boards. I too at some later date will be creating a custom operator interface using LabView and your questions have been really helpful in my formulation of a plan. Thanks
    Using LabVIEW 2010SP1 and TestStand 4.5

Maybe you are looking for