LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create 2D array with 3 rows and unlimit column?

how to create 2D array with 3 rows and unlimit column?
0 Kudos
Message 1 of 16
(35,788 Views)

Actually, there are no set limits to the quantity of rows and colums with 2-D arrays... Although there is a finite limit to the length due to memory / addressing.  I can't remember what that value is. 

However, it is better to pre-allocate the size of the array in order to have better code performance. Otherwise, everytime you grow the array, it will need to re-allocate memory and as the size increases, so does the time to do this.

Concerning the 3 rows, it is simply a matter of indexing.  Make sure you index where you want the values properly and you should hav a 2D array of 3 by n, where n is the length of you column.  A good place to look for info on indexing is to use the Context Help (under Help Menu or click on question mark at top right of block diagram)

RayR

Message 2 of 16
(35,783 Views)
Hi ha noi,

in LabView you can change array sizes easily in runtime. That's wha arrays are only limited by memory!
how to create 2D array with 3 rows and unlimit column:
Use an "initialize array" function, wire 3 to the first index input, wire 0 to the 2nd input. Now you have an 2D array with 3 rows and no columns. You can add columns by using "build array".
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 16
(35,783 Views)
I tried to put 0 at 2nd input. but my graph didn't work. I would like to make X auto scale, and show graph until stop program. In my program, you can see X limited with 50 point. If X >50, the graph doesn't work. I haven't know to fix it.
0 Kudos
Message 4 of 16
(35,778 Views)
Hi ha noi,

can you save a LV8.2 version?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 16
(35,772 Views)
Sorry, i'm using 8.5 demo, i don't have 8.2 version.
0 Kudos
Message 6 of 16
(35,771 Views)
Hi ha noi,

no "save for previous" in the demo version? What about showing a pic of block diagram?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 16
(35,770 Views)
Here are images of what I described in my previous post
 
 


Message Edited by JoeLabView on 11-14-2007 07:56 AM
Download All
Message 8 of 16
(35,762 Views)

I purposely showed the greyout elements in the top array to demonstrate that the array has 3 rows.  In the example, it has 10 columns.  The surrounded grey-out values are uninitialized, so the array is 3 by 10.

I couldn't open your code either because I do not have LV8.5 installed on this machine..

I'll add a graph to my code and show the image of it.  Back in a couple of minutes. 😉



Message Edited by JoeLabView on 11-14-2007 08:00 AM
Message 9 of 16
(35,758 Views)
Here is my diagram!
0 Kudos
Message 10 of 16
(35,755 Views)