From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data input to array

Solved!
Go to solution

Hello,

 

'Looping Table.vi" This VI generates random numbers and gets the real time to plot them into a table. After a certain amount of entries, say 10, the first entry gets deleted and so on...(like First in First out (FIFO)).

 

I would like the same concept but instead of a random number generator, i would like to control the input with a numeric slider and have the entries shown in an array, with after 10 entries the 1 first gets delted and the 11th entry gets inserted, like a queue.

 

Any help would be appreciated! 

Download All
0 Kudos
Message 1 of 6
(2,757 Views)
0 Kudos
Message 2 of 6
(2,752 Views)

Hello Thuba25,

 

You can make use of Array size, Build array and Replace array subset functions to achieve this. Try to draw a flowchart before implementing code this will give you idea where to use which finction.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
Message 3 of 6
(2,722 Views)

Hello Miraz,

 

Thank you for your tip! I have used what you suggested and come up with this new VI. However, my problem is that, if I move the slider out of the while loop ( to implement that external data is going into this sub while loop) then how can i do the same thign as before?

Moving the slider outside the loop will only register the same number over and over again, and will not update the new values.

 

0 Kudos
Message 4 of 6
(2,704 Views)

You need to learn dataflow.

 

If you acquire data externally, the acquisition needs to be inside the loop. Alternatively, the data can be read elsewhere and you could use a queue to read it in this loop.

You can right-click the slider to make it U8.

 

0 Kudos
Message 5 of 6
(2,700 Views)
Solution
Accepted by topic author Thuba25

Hello Thuba25,

 

I could not see your VI because I have LabVIEW 2010 and not 2013, however to answer your question, you can move the slider outside the while loop and then use a queue structure to acquire the data from it.

 

I think the problem you are trying to solve does not require the queue structure, your code will become unnecessary complex.

Please give a little more try, I am sure you will reach to solution else the forum will provide solution.

 

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
0 Kudos
Message 6 of 6
(2,663 Views)