Jump to content

Native table controls


JoeQ

Recommended Posts

I am looking for a way to make a table in Labview similar to MS Excel. I want to be able to edit cells in the table using the standard Windows key strokes and mouse selections.

 

I have tried all of the native controls with little success.  The problem when using the table control is that it has very poor performance as the window size is increased.   It also seems that every feature would need to be coded rather than having the editing support native in the widget. 

 

I am very interested in seeing a way to make something work using the standard Labview controls. 

cells_selected.vi

Table6.vi

Link to comment

I've done some work on tables to make them more user friendly.  Things like Tab, Enter, Shift+Tab, or Enter, formatting of cells to accept strings, or numbers or drop downs. 

 

All of these things are a manual process.  LabVIEW gives you the controls to be able to do what ever you want, if you don't mind spending the time getting it right.

 

I think some of the slowness you are seeing is because of custom cell formatting on each cell that you have.  LabVIEW had a few functions for coloring an entire column, or row a specific color and that helps with performance, but having each cell individually colored is more difficult for LabVIEW.  It even struggles with cells that aren't being shown.  So if you have 10000 rows with custom formatting it doesn't matter that you only see 5 rows at a time.

 

There are a few techniques to help with this, things like a virtual table that only shows 5 rows at a time, and it loads the data and formatting from some other location.

 

Also in 2013 there were many improvements to tables and multicolumn listboxes to be able to handle this data a little smoother.

 

It looks like you are on the right track, but unfortunately there aren't many native controls for what you want.

 

I'm not sure your application but you could try to do some ActiveX and actually insert an Excel table in a LabVIEW front panel.  I've experimented with this and had decent results, even with the free Excel for web pages can be inserted, but with limited functionality.

Link to comment

If you run my example, pressing setup will set the table to roughly the size I am needing. I would like to be able to see all of the cells on one screen as well as be able to work with multiple cells at one time.  You will see me +/- shift+/- for inc/dec on multiple selected adjacent cells.

 

Once the table is full size, just dragging the mouse across cells and selecting gets very slow.   At that time, the program is not doing anything until it sees the mouse button release. I suspect that Labview has some amount of editing functions built-in. For example, when editing a constant array, normal Windows functions like insert/overwrite do not work.  The editing features are not standard across all controls. I believe this is where the poor performance comes from.

 

I don't want to require a third party tool unless that tool is Visual Studio.  :cool:

 

I was hoping the newer versions of Labview would have better editing support for all of their controls.  It appears at least with 2011, little has been improved. 

 

I noticed NI has some sort of engine controls prototype support now (http://www.ni.com/powertrain-controls/).  I have to believe they are working with tables as well but I have not checked into it. The table I am showing shows engine RPM versus throttle position. It's very common to work with tables like this. I wonder if they have some sort of add-on control that could be used.  

Link to comment

I looked at adding some sort of arrow and home key support.   There are no bounds checks etc. but should give an idea what it would take to make it work.  

 

If anyone is using a beta copy of 2014 or the latest version,  let me know if the there is some basic Windows like editing support for tables, arrays or list boxes.

 

cells_color.vi

Table8.vi

Link to comment
If anyone is using a beta copy of 2014 or the latest version,  let me know if the there is some basic Windows like editing support for tables, arrays or list boxes.    

I'm not apart of the beta, but if I was I think I wouldn't be allowed to answer that.  I can say 2013 SPI doesn't have the type of functionality built in that you are looking for.

Link to comment
  • 2 weeks later...

Looks like if you set the table to transparent, then place an array of color boxes under the table you can get some fair performance.  I could not find a property for the color box size and if you set it manually, it appears to be off by 1 pixel in both directions compared with the table size.  

 

I was thinking for the best perfromance, you may need to overlay the array of color boxes with a matrix and a table.  Use the table to get the editor to sort of work for data selection, use the matrix to display the data, then the color box to add the color.   A total nightmare, but seems like this may be the best way to get a table working using the standard libs. 

 

I am not sure how you would get the whole mess to align on all PC combos. 

Link to comment

That's not too bad (450mS). On my newer PC it was taking wall over a second. Before dropping the property and using the color box, I removed the selected cell background color and then only update the changed cells (basically remove as many property calls as possible). You are right, this was better, until you edited large blocks of cells. The array of color boxes was much faster but again, I am not sure how to make it work with the properties that are available across all PCs. 

Link to comment

You can also, BTW, take the property-node-in-array sections and put them in a subVI set to run in the UI thread.  Running your VI in the UI thread reduced to “Grad” update time from 450 to 250ms (this is because property nodes run in the UI thread, and thread switching is part of the performance problem with property nodes).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.