01-15-2018 03:54 AM - edited 01-15-2018 03:55 AM
I'm currently trying to autofill string data from an Array into a table control in a certain column but I can't find a way to do it properly.
Can someone show me how to pull and insert data into specific columns/cells within a table control?
For example, I'm trying to put these string values into the second column of the control table but it's not working.
Solved! Go to Solution.
01-15-2018 04:34 AM
Hi Lu,
your VI is full of wrong array handling (and overuse of locals and sequence frames)…
Did you take the free beginner courses to learn LabVIEW?
Can someone show me how to pull and insert data into specific columns/cells within a table control?
A table just displays a 2D array of strings, so you need to put the string into the corresponding elements of your array!
For example, I'm trying to put these string values into the second column of the control table but it's not working.
Create an array with 2 columns and replace the elements in this array!
01-15-2018 11:46 PM
Indeed, I have not taken the free course yet. I am currently self learning at this point. Is the application for the course on here?
I do have a second question. Is it possible to append another control table to an existing control table by the last used column in the original table control?
01-16-2018 12:35 AM
I imagine that you want to later replace other rows with data, so easiest would be to keep the 2D array in a shift register and replace the empty string with new data as needed. Where does the data come from? How often does new data arrive? How many different rows do you expect to have at the end?
01-16-2018 12:39 AM
TeddyLu wrote:I do have a second question. Is it possible to append another control table to an existing control table by the last used column in the original table control?
I don't understand what that means.Tables are typically indicators, why do you call it a control? It seem you want to display several datasets in the same table. Yes, anything is easily possible.
01-16-2018 12:58 AM
@altenbach wrote:
TeddyLu wrote:I do have a second question. Is it possible to append another control table to an existing control table by the last used column in the original table control?
I don't understand what that means.Tables are typically indicators, why do you call it a control? It seem you want to display several datasets in the same table. Yes, anything is easily possible.
Yes, tables are typically indicators, but in this instance I'm adding more data into a single table as you have stated, therefore, using them as table controls with manual input values. I was able to add the tables together using "insert into array" without providing constants for the indexes. The additional data was added to the last row used of the original table instead of the last column used, which is my intended target
01-16-2018 01:36 PM
@TeddyLu wrote:
The additional data was added to the last row used of the original table instead of the last column used, which is my intended target
If the table is a control, you can edit any value you want directly into the table. Since these are string, you might want to add some validation if the entry should be numeric.
Keep the table data in a shift register. Just use an event structure and watch for "table:value changed", the validate and either update by keeping the new value or ignore the added entry by writing the old value via a local variable.
01-16-2018 03:44 PM
OK, here's a very rough example that show how you can mix programmatic and manual table entries.
Press any of the add buttons to fill the corresponding row with four random numbers, leaving the fifth column untouched. At any time, you can manually enter text to the fifth column. (if you try to edit in the first four column, it will be rejected).
See if this makes sense...
01-16-2018 06:35 PM
I do apologize, I guess I wasn't really clear on what I was trying to do.
Here is a mock example attached of what I'm trying to describe.
As you can see, with the help of the earlier posts, I was able to get the cluster boolean control values to be inputted into a specific column.
However, I do have an additional table control with the manual inputs that I need to add to the programmatic table that was created earlier.
The information is being added was appended to the bottom last used row in the programmatic table instead of the last used column
In other words, I'm trying to copy and paste what I have from the manual input table next to the values in the programmatic table
01-16-2018 07:16 PM
(posting by phone, cannot see your code)
The principle remains the same: keep a sufficiently sized 2D array of strings in a shift register and replace parts with new data using "replace array subset" as needed before updating the table again. ("Insert into array" is most often the wrong tool.)