Description
Description-Separate-1This example shows how the Producer/Consumer architecture can be used to take in and process user events. The outcome of the program is that the LabVIEW window will move onscreen based on user inputs.
This application has a user interface with four directional control buttons and a queue status indicator. The block diagram has one loop that collects user interface events and updates the queue indicator (Producer loop), and another loop that takes the user interface data and moves the window accordingly (Consumer loop). This example makes use of the buffered communication in Queue Operations functions
Description-Separate-2How to Use
How-Separate-1
-
Open the attached code Move-Window.vi.
-
Run the program.
-
Press the Up, Down, Left, and/or Right buttons.
-
Press the front panel buttons quickly.
-
Press Stop to complete the program.
-
In this program, Stop halts all window movements, and commands are left in the queue. It is possible to alter the program so that the queue is emptied (i.e. commands are executed) before the program stops running.
How-Separate-2