ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I keep all the previous datas in the same array?

I have a problem with keeping the previous datas in my array. The problem is when the iteration loop is executed, I have one or two value(s) stored in the array. The second iteration I have either one or two values (depending on the condition) coming out, but it overwrites my previous value. I want to keep all my data in the same array as the loop is executed.PS. I have attached a simple vi along this message. If anyone can help me out with this, I really appreciate for the help.

Regards,

Sonny
0 Kudos
Message 1 of 7
(3,400 Views)
Attached file to the question " How can I keep all previous datas in the same array?
0 Kudos
Message 2 of 7
(3,400 Views)
I've modified your example, I think it should now do what you want.

Hope it helps!

Brian
Message 3 of 7
(3,400 Views)
I can't open the file you sent me. When I open up It gives me a waring saying:
"Resource not found.
An error occurred loading VI 'fixedexample[1].vi'
LabVIEW load error code 8: Could not load VI resource.

Would you mind sending me a copy of that again directly to my email address? I really appreciate for your help.
My email address is son09@yahoo.com

Regards,

Sonny
0 Kudos
Message 4 of 7
(3,400 Views)
Check your mail...

Brian
0 Kudos
Message 5 of 7
(3,400 Views)
If you iterate several times (N > 100) then I would suggest using the Initialize Array outside of the For Loop and then use the Replace Array Subset inside the Loop to populate the array. The reason for this is because the Build Array utility has to locate a new space in memory for the newly concatenated array -- the Replace Array Element utility uses the same memory space.

If you iterate just a few times with a small array then using the Build Array should be okay.

Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

Message 6 of 7
(3,400 Views)
Good point, I forgot to mention that in my previous post.
0 Kudos
Message 7 of 7
(3,400 Views)