LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert row into empty table control behavior

Hello,

 

   For reasons I do not understand "Insert Array" does not insert the table value when the first action the user does is to use the application menu to insert a row into a empty table. If the user does not insert a row into a empty table "Insert array" works, I can insert data into the table value.

  So what does the right click application meu actually insert into the empty table control that stops "Insert array from working?

Regards,


Kaspar
0 Kudos
Message 1 of 7
(4,301 Views)

Hello,

 

   Stopped using "Insert Array" and changed over to "Build Array" to add data (rows) to a table. So far everything is fine.

Regards,


Kaspar
0 Kudos
Message 2 of 7
(4,275 Views)
Can you show some code? Otherwise we are sort of shooting in the dark.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 7
(4,260 Views)

Hello,

 

   I have a code snippet where I found the issue. I use  a property node to read the value of the table, I was using "Insert Array" to add another array (a row) to the data and put it back in the table control with a property node.

In order for me to get the code to work reliably had to change the "Insert Array" to a "Build Array" (which is in the code snippet) . The issues with using "Insert array" would happen it the user used the "Insert Row" option from the "right click menu" of the Table control. When this happened "Insert Array" could no longer add another row to the end of the data. So when I changed to "Build Array", the code always worked.

 

Here is a portion of the text from "Insert Array"

 

When you wire an array to this function, the function resizes automatically to display index inputs for each dimension in the array. If you do not wire any index inputs, the function appends the new element or subarray to the end of the n-dim array. If the index input is larger than the array size, the function does not insert anything into the input array. 

 

  The underlined text above is how I was using Insert array and expected it to always work that way

 
For reasons I do not understand "something" gets inserted into the table control data with a "right click insert row" that results in "Insert Row" not being able to add data to the end of the array., I have probed the inputs and outputs, the table data comes out as a empty array from the property node, but the output from Insert array is alway empty if a row was inserted with "right click insert row"

 

 

 

2015-06-17_6-50-45.png

Regards,


Kaspar
0 Kudos
Message 4 of 7
(4,232 Views)
If you are using the right click function, you don't need any code. The right click function does what it says, it adds a blank row. You likely have a race condition where you are adding a row and then immediately overwriting it with what you think should be there.

What does your complete application look like? There is more going on here that we can't see through that tiny snippet.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(4,221 Views)

Hello,

 

   Due to the size of the code and the nature of its use I cannot put all of the code in this forum. I was probing the output from the property node and never saw a blank row.  However ever since I changed from "Insert Array" to "Build Array" array the code works all of the time. So I guess "by observation" I will use "build array" in place of "Insert Array" whenever I need to add to the end of a Array.

Regards,


Kaspar
0 Kudos
Message 6 of 7
(4,213 Views)
Well it's your choice, but just know that while it may seem to be working at the moment, the code is not "fixed" -- which means it will break again.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(4,205 Views)