LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to build a queue application?

Solved!
Go to solution

I want to make a queue application using labview. If I have a list of data for example 100,200,300,400,500,600 and 700 written onto table or array, then using a queue function it process the data one by one after each others. How could I do that?I am using labview 2009 and 2010.

0 Kudos
Message 1 of 8
(5,781 Views)
Solution
Accepted by chip86my

File >> New >>  VI >> From Template >> Framework >> Design Patterns >> Producer/Consumer Design Pattern (Data).  

 

Enqueue your array of data using a For Loop.

 

ProducerConsumerData 1_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 8
(5,775 Views)

thank you for your help. basically my program may use string so I have been change it to string and store it into table/array row by row.

 

What do you think if we have a list of data for example 012AB0105,013AB0106 and 014AB0102 and we want to sort it from higher last two digit to the lower last two digit of the data. For the moment I just can take a last two digit to display into array,how can I retrieve the whole data as a sorted data. The attachment show what I have done.

Download All
0 Kudos
Message 3 of 8
(5,723 Views)

Hi chip

 

Thank you for including your code so I could take a look, firstly I recommend setting up the queues using the producer consumer loop before going any further with the development as it will make data flow easier to understand and will structure the process. If you navigate to find examples in the help tab of LabVIEW and search for queues, then a number of examples are available to show the functionality of the queue functions.

 

I have noticed that there isn't much data flow set into your code, which at the moment is not causing you any problems, but the more you ask your code to do the more this will become an issue, I have edited your code and removed a number of the variables which were unnecessary, if you can avoid using them twice in the same loop it will help the speed of your program. I have included the code in LV 2010 in this post, for you to take a look at.

 

With regards to your searching question, one way of doing the sort would be to index the elements before sorting and then recall the index and hence the original string after the sorting. There are some examples on searching strings available online which should be helpful.

 

I will look to see if there are any other relevant examples and get back to you, if you would like any more information please ask.

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 4 of 8
(5,696 Views)

I have try to open the example that you gave but I could not run it because there is no run button at the program. Please help.

0 Kudos
Message 5 of 8
(5,653 Views)

The run button can be deactivated in the VI appearance properties, sounds like that has happened in your VI.

R-click the vi icon (top right of your VI) and look through VI properties for Window Appearance.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(5,635 Views)

Hi

 

I have just tried to open the vi, using the link on this page, and the run button is available in my LabVIEW.

 

The download may have been corrupted, if you haven't got it running yet, try to dowload it again, if the problem persists let me know and I will send it again.

 

And to remind you, there are some great examples on queues and data acquisition available in the LabVIEW help tab which are a great reference tool.

 

Thanks

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 7 of 8
(5,625 Views)
I don't want to state the obvious but you could simply iterate over the array with a for loop.
=====================
LabVIEW 2012


0 Kudos
Message 8 of 8
(5,597 Views)