LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with recording data into the 1D array

Hi 

I'm begginer that's why I have lot of problems with this task. I have to add data to the array after pushing button. So I started with initializing counter with 1. When add button is pressed in case structure I have to increment the last index of the array and record data which respond to this index.

The problem is that the index of the array doesn't change.

 

problem.png

0 Kudos
Message 1 of 16
(3,389 Views)

Hi lubie,

 

well, when you need to "add data to an array" then why do you initialize the array with each button click?

 

Appending data to an array requires the BuildArray function. The array should be stored in a shift register.

Start again… 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(3,379 Views)

Hi GerdW

 

Thanks for your tip. Unfortunately English is not my native language, so could you describe it more clearly for me.

I can't imagine how to fix it, because after pushing button the index of the array must increment. Using Build Array function i can't see the solution.

 

  

0 Kudos
Message 3 of 16
(3,367 Views)

Hello !

 

Send your diagram and I will to correct it to show you one solution Smiley Happy

0 Kudos
Message 4 of 16
(3,360 Views)

Hi Slate,

 

I've already send it. But I did some changes in diagram. 

 

Edit: The problem is that we have to declarate the size of the array before we use it. It's possible like for instance in c++ to use dynamic allocation  ?

0 Kudos
Message 5 of 16
(3,355 Views)

I don't understand really well your problem, can you explain us what do you want to do with this table ? 

For me your code works, when you push you button you have +1 in your indicator !

Why do you want to to know the size of your array ?

0 Kudos
Message 6 of 16
(3,246 Views)

Hi lubie,

 


The problem is that we have to declarate the size of the array before we use it.


Why? Who says so?

 


It's possible like for instance in c++ to use dynamic allocation  ?


That's standard for LabVIEW: arrays are dynamically sized…

 

Don't get me wrong: while you can work with dynamically sized arrays easily in LabVIEW it is recommended to have fixed sized arrays for larger data blocks!

 

As this is very basic LabVIEW knowledge I suggest you to take all those free online courses offered by NI: http://www.ni.com/gettingstarted/labviewbasics/

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 16
(3,326 Views)

Hi GerdW

 

Thanks, I better to see all of those free courses.

0 Kudos
Message 8 of 16
(3,318 Views)

Try this

 

Frans

 

0 Kudos
Message 9 of 16
(3,311 Views)

I can't. I have older Labview.

0 Kudos
Message 10 of 16
(3,301 Views)