LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a table to my code

Solved!
Go to solution

I have the following code attached but I am having trouble trying to figure out how to attach a table to it. I would like for my result to give me a graph, as it does, as well as a table. I have been reading a lot and going over many examples but can't seem to figure this one out. Can anyone help? Thanks

 

 

0 Kudos
Message 1 of 19
(4,236 Views)
Solution
Accepted by jenifr2g@cox.net

First, your images are on your hard drive and obviously we have no access to that. Attach them to the post.

 

Your problem is fairly simple. An XY graph is a bundle of an x array and a y array. A table is a 2D array of strings. You can use the Build Array to create a 2D array from your x and y data and then convert to strings with the Number to Decimal String. In the image below, I also inserted a Transpose 2D array so that the x data would be in one column and the y data in another. If you want it displayed in rows, don't transpose.

 

Message Edited by Dennis Knutson on 12-12-2008 11:49 AM
Message 2 of 19
(4,229 Views)
Hi, I answered your question here.
Cory K
Message 3 of 19
(4,220 Views)

Dennis Knutson wrote:

... then convert to strings with the Number to Decimal String


Hey Dennis, just out of curiosity, what is the purpose of converting the numbers to decimal strings? Cant you have an array of numbers?

Cory K
Message 4 of 19
(4,218 Views)

That's because the Table only accepts string type arrays , no numeric can be used

Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
Message 5 of 19
(4,214 Views)

Hmmm. I thought that a table could have only 1 type, but it could be numeric or string type, just not both.

Could someone explain why that is not correct?

 

Message Edited by Cory K on 12-12-2008 01:24 PM
Cory K
Message 6 of 19
(4,208 Views)
Because an array is not the same thing as a table.  A table is a special front panel object that only accepts 2-Dstring arrays, it is not an array in itself.
Message 7 of 19
(4,203 Views)

Array constants are not the same thing as a table. Look at the help for a table and see:

 

Using Tables

A table is a 2D array of strings. Use the String functions to manipulate tables.

Each cell in a table is a string, and each cell resides in a column and a row. You enter headings when you add the table to the front panel, and you can change them using the Labeling tool or Operating tool. The row and column headings of a table are not part of the table data. Table headings are separate pieces of data that you can read and set using Property Nodes.

The index display at the upper left corner of the table indicates which cell is visible. You can operate these indexes just as you do on an array.

Message 8 of 19
(4,201 Views)

Ahhh, then I was misunderstanding what Dennis was doing.
So if you wanted to keep everything as numbers, couldnt you just make an array indicator?

What is the benefit of having a table instead of array indicator?

Cory K
Message 9 of 19
(4,198 Views)
Yes you can use an array indicator if you want.  But they are pretty limited in appearance and only allow a certain amount of customization.  Tables allow you to present the data in a bit more compact way.  It allows you to change colors of individual cells.  Allows header rows and columns to be distinctive from the data the table contains.  It gives you flexibility in the way you present data to the user.
Message 10 of 19
(4,195 Views)