LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to build an array using incoming stream of data?

Solved!
Go to solution

I am programming in VBAI but use LV as my Inspection Interface. The VBAI program will go in a finite loop (1000x) and feed the numeric indicator with dbl vaule in the front panel of LV. So the dbl value is in sequence.

 

In LV, how do I build an array (index 0 - 999) with this stream of data?

0 Kudos
Message 1 of 26
(3,015 Views)

Build Array

Shift Register

 

Search the forums and you'll see numerous examples.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 26
(3,012 Views)

Hi Raven,

could you please give me a simple vi code? Thanks..

0 Kudos
Message 3 of 26
(2,977 Views)

Since you know the exact final array size from the beginning, you should initialize an empty array with 1000 elements, then use "replace array subset" to fill the data as it arrives, keeping track of the insert point.

 

Can you explain what you mean by the VBAI program "feeds" data to a front panel indicator? How did you implement that? How does the LabVIEW program know when new data arrives? Is this called as a subVI?

Message 4 of 26
(2,976 Views)

array.png

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 5 of 26
(2,973 Views)

You can eliminate that useless FOR loop by using a globally initialized feedback node instead of a shift register.

You also need a mechanism to reset the shift register contents.

0 Kudos
Message 6 of 26
(2,970 Views)

@altenbach wrote:

You can eliminate that useless FOR loop by using a globally initialized feedback node instead of a shift register.

You also need a mechanism to reset the shift register contents.


What are you doing up at this hour?  Don't you sleep?  Per your advice.  The OP will still need to code in an initial state for the array.

 

array.png

 

 

 

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 26
(2,965 Views)

@MoReese wrote:
What are you doing up at this hour? 

Well, it was not even midnight on the west coast. 😄

0 Kudos
Message 8 of 26
(2,962 Views)

That's right, I forgot you live in CA.  I just remembered that but you beat me on the response.  It's 2am here.  Why am I not in bed?  Good night.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 9 of 26
(2,960 Views)

I am still up 😉

0 Kudos
Message 10 of 26
(2,958 Views)