LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem displaying array

Solved!
Go to solution

Hello. I have a project that is working as desired. The problem is that I had to add 6 columns to an array, in the middle of an existing array. This is to assist the person that is building the Excel shell that will created using the .csv from this array. On the tab labeled "Program Run", from the Vi, shows data on top, and data to the right, from this array. What I need to do is display only the columns for Serial Number, Voltage, Displacement, Set, Cs:, D:, Time, then Date. I thought about breaking this into 3 different arrays at first however, the headings are all written to the .csv file as soon as the Vi runs. I thought about indexing the array but I don't know how to index only those elements I want displayed. When I have indexed arrays in the past I must give a count of how many characters are in each element, and since elements 4-8 won't have any data, I don't know how to make that work. Thank you for your help. 

0 Kudos
Message 1 of 13
(3,129 Views)

@ceilingwalker wrote:

Hello. I have a project that is working as desired. The problem is that I had to add 6 columns to an array, in the middle of an existing array. This is to assist the person that is building the Excel shell that will created using the .csv from this array. On the tab labeled "Program Run", from the Vi, shows data on top, and data to the right, from this array. What I need to do is display only the columns for Serial Number, Voltage, Displacement, Set, Cs:, D:, Time, then Date. I thought about breaking this into 3 different arrays at first however, the headings are all written to the .csv file as soon as the Vi runs. I thought about indexing the array but I don't know how to index only those elements I want displayed. When I have indexed arrays in the past I must give a count of how many characters are in each element, and since elements 4-8 won't have any data, I don't know how to make that work. Thank you for your help. 


It would help if you post your VI.

Message 2 of 13
(3,125 Views)

Post your VI or at least a screenshot/sample of your data. 

 

You can very easily index out only certain elements/rows/columns of data from the array (you can expand a lot of the array functions) or even delete from array etc. but without seeing the format of your data it's difficult to help!


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 3 of 13
(3,123 Views)

Welcome back, ceilingwalker.

 

You might need to share the array that you're working with and give a little more detail about exactly what you're trying to do.

Are you trying to insert columns in to the actual CSV file? or in to the array that you read from the file? There's a VI called Insert Into Array, which can do just that with the array. TO edit the CSV, you would need to read the array, insert the columns, and then overwrite the previous CSV file data.

 

You can index an array columns 0-10 and remove 4-8 if you want. Just use the Delete From Array function.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 4 of 13
(3,121 Views)

@James.M wrote:

Welcome back, ceilingwalker.

 

You might need to share the array that you're working with and give a little more detail about exactly what you're trying to do.

Are you trying to insert columns in to the actual CSV file? or in to the array that you read from the file? There's a VI called Insert Into Array, which can do just that with the array. TO edit the CSV, you would need to read the array, insert the columns, and then overwrite the previous CSV file data.

 

You can index an array columns 0-10 and remove 4-8 if you want. Just use the Delete From Array function.


Sorry about that. Here it is.

0 Kudos
Message 5 of 13
(3,111 Views)

You attached just the project again, dude.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 6 of 13
(3,108 Views)

Use different arrays to save and display data.

Index 2D array function has input for the column and row. If you connect only column index, it will give you entire column. Then join these columns (for loop with autoindexed output tunnel or build array) and transpose.

Or use insert into array before saving data.

It is much easier to try on something simple first (3x2 array), then you will not have simple questions how array functions work.

Message 7 of 13
(3,083 Views)

@James.M wrote:

You attached just the project again, dude.


When I tried making a file with just a Vi, from the project, it kept giving me an "Alias File" that I wasn't able to open. I so hope this time I did it right. This is enough to test anyones patience. Sorry about that.

0 Kudos
Message 8 of 13
(3,081 Views)

Thanks for attaching that. It can't be run because of other missing VIs, but it gets the point across.

 

So you're saying you only want to display some of the columns, but not all? Are you trying to not display the empty "" columns?

 

The Array indicator will show whatever you write to it, so if you remove those columns before you write to the indicator, those columns won't show up. You could use a Delete From Array function inserted in to the wire after it branches to the Spreadsheet VI and before the indicator terminal.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 9 of 13
(3,074 Views)

@James.M wrote:

Thanks for attaching that. It can't be run because of other missing VIs, but it gets the point across.

 

So you're saying you only want to display some of the columns, but not all? Are you trying to not display the empty "" columns?

 

The Array indicator will show whatever you write to it, so if you remove those columns before you write to the indicator, those columns won't show up. You could use a Delete From Array function inserted in to the wire after it branches to the Spreadsheet VI and before the indicator terminal.


Yes Sir, I do not want to display the empty columns, which would be the elements numbers 4-9.

0 Kudos
Message 10 of 13
(3,063 Views)