LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D array not populating

Solved!
Go to solution

Hi GerdW,

 

Since the topic is similar, i though I can add my queries here. Sorry about that.

I have an appended array with time string and certain values.

I have initialized a 2D array named Output Array In.

If I run this I get the continuous value only in the first row of the 2D array.

 

My requirement is I need to get (2011/10/28 10:26:18.155) (00) (09) (22 00 00 00 00 00 00 00) in 1st row

                                              (2011/10/28 10:26:19.155) (00) (09) (22 00 00 00 00 00 00 00) in 2nd row

                                              (2011/10/28 10:26:20.155) (00) (09) (22 00 00 00 00 00 00 00) in 3rd row... and so on in the 2D array.

 

Working version is LV7.1

 

Thanks

KB29

0 Kudos
Message 11 of 16
(900 Views)

Hi KB,

 

you need to learn about shift registers or feedback nodes:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 16
(895 Views)

Hi,

 

I have an another query. Now this while loop comes inside a main vi which runs in a while loop i.e. this is now a while loop inside a while loop. I need the output as:

 

1) The main loop will run and call the inner while loop.

2) The inner while loop should run once and give the value with the timestamp(10/11/2011 10:00:00; 11 00 00 00 00 00 00 00) and come out automatically (is it possible without pressing the Stop button)

3) The inner loop value should be updated in the indicator which will be present in the outer while loop.

4) Again the outer while loop will call the inner while loop after 1 second.

5) The inner while loop should give the value as 10/11/2011 10:01:00; 11 00 00 00 00 00 00 00)

 

In case of any change in the value, it should get updated.

Hope I am clear with the query.

 

Thanks

KB

 

 

0 Kudos
Message 13 of 16
(882 Views)

KB29 wrote:

Hope I am clear with the query.



No, your description makes no sense at all!

 


KB29 wrote:

1) The main loop will run and call the inner while loop.

2) The inner while loop should run once and give the value with the timestamp(10/11/2011 10:00:00; 11 00 00 00 00 00 00 00) and come out automatically (is it possible without pressing the Stop button)

3) The inner loop value should be updated in the indicator which will be present in the outer while loop.

4) Again the outer while loop will call the inner while loop after 1 second.

5) The inner while loop should give the value as 10/11/2011 10:01:00; 11 00 00 00 00 00 00 00)

 

In case of any change in the value, it should get updated.


 

  1. OK
  2. Well, if it should not loop, why do you need an inner loop at all???
  3. You have four indicators in the inner loop and one in the outer loop. Which one should update and with what?
  4. Then place a 1 second wait on the outer loop, right?
  5. Why would the time stamp be one minute later after one second (10:01:00 vs. 10:00:00). That makes no sense at all.
  6. What determines the value in the control name "string"? How ofter does it change?
  7. What is the purpose of the "output array" controls? What determines it's contents?
0 Kudos
Message 14 of 16
(878 Views)

I had just tried out different methods so I had put it over there. It is justa sample program.

Output array In is the initialized array.

I want the output array to be giving the values as 2011/11/10 10:00:00   00   09   Value

                                                                               2011/11/10 10:00:01   00   09   Value

                                                                               2011/11/10 10:00:02   00   09   Value

So I just tried with Insert into Array and Build Array via shift registers.

 

Thanks

KB

0 Kudos
Message 15 of 16
(875 Views)

You still make no sense. In what way is Gerds's example above not what you need?

 

Your problem is are the two stacked loops. Since you initialize the shift regsiter in the inner loop, it will not survive the next iteration of the outer loop, but will get reinitialized over and over.

0 Kudos
Message 16 of 16
(869 Views)