LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fill up 1D array with values from vertical pointer slide control

I want to fill up a 1d array while adjusting a vertical pointer slide control. I tried using a user's solution here: forums.ni.com/t5/LabVIEW/build-1D-array-dynamically-with-data-from-for-loop/m-p/758715/highlight/true#M347601 but when I tried it, I only got the current values filling up the array. I want the past values to be just pushed once a new value comes from the slide control. Can anyone help me on this? Thanks.

0 Kudos
Message 1 of 5
(3,419 Views)

Hi Spectre,

 

as usual: show us, what you have done and we tell, what's wrong...

 

Hints:

Use a shift register and a BuildArray node...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(3,413 Views)

Hi GerdW! This is what I've done so far. I want this VI to be controlled in an "environment" VI, together with other VIs like a buck converter model VI and an algorithm VI that controls the converter. As I said what happens right now is that only the most recent value is filled in the array, what I want is past values to be stored in an array. For a shift register, I should use a while loop right?

 

Thanks

0 Kudos
Message 3 of 5
(3,399 Views)

Your VI creates a new 3D array with 100k points from scratch containing all identical elements, reshapes it to a 1D array, and then stops. There is no intereacticity. Are you using contiunous mode to run this? (Don't!)

 

First of all, you are creating way too many dimensions. You would get the same result if you would simply wire the scalar into the inner most loop and leave the initialize array out of the picture or initialize a 1D array of lenght 100k. No loops needed.

 

Yes, you need an outermost while loop containing a shift register. Initialize the shift register with a 1D array and append new data inside the looop as desired. 

0 Kudos
Message 4 of 5
(3,394 Views)

I'm sorry, but can you please explain how to initialize the shift register? Do I connect the vertical control to an initialize array, then connect it to the shift register in the while loop?

0 Kudos
Message 5 of 5
(3,328 Views)