LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add and Remove data from Multi-columns system table

Hi Everyone,

 

I'm working on different SubVIs at the same time and one of my SubVIs, called Admin.

 

I want from this SubVIs to be able to add new element to the multicolumns system table. 

 

I created a String System Array called (New Element), whatever I'm adding to this array should be placed in the table accordingly. 

 

Also if i needed to remove a line from this table I should marked it and delete it. 

 

However, I'm finding problems in both functions. 

 

 

1- when i'm adding new elements, the table will add my new data but if i changed the data and wanted to enter another one, the next following data will be the previous one then the new data will entered. so I have a problem with clearing the memory of the array (i guess). 

 

2- when I stop the program and try to run it again and enter another data, the old data won't save, they'll disappear. 

 

3- when i'm trying to delete data, the program delete the last line (row) then delete the whole table at once. 

 

4- the stop button is not working with me, the VI won't stop until i stop it from the abort execution icon. 

 

 

so how can i fix my problems please. 

 

1- clearing the memory every time after entering the new data.

2- saving my old data to be kept inside the table.

3- deleting only the selected row.

4- how should i connect the stop button in right way

 

 

please check the picture of my VI.

 

 

Thanks for your help.

Download All
0 Kudos
Message 1 of 14
(4,524 Views)

Please don't attach "pictures" of your VI -- attach the actual VI (the file with the extension ".VI").  In LabVIEW, "A VI is worth 1000 pictures".

 

With a VI, we might be able to see and understand what you mean by a "multi-columns system table", how you make it, what it looks like, is it an Array or a LabVIEW Table, etc.  We might be able to suggest a better way of saving/displaying/organizing/etc. these data.

 

Bob Schor

0 Kudos
Message 2 of 14
(4,481 Views)

Hi Bob, 

 

here's the VI, can you please check it and let me know the problem.

 

 

 

Thank you

0 Kudos
Message 3 of 14
(4,478 Views)

Firstly you should create an Event for the stop button as your event structure does not timeout.

Then, as "add" button is latched it is autoreset when read. Therefore the case structure within the add Event case is superficial.

The same applies for the "remove" button.

The Zero constant must no be wired to the "insert Array" function it is the default.

The remove Event case and the view Event case insert Initial values into the shift register which is equal to deleting all the contents of the listbox.

The "user table" control should reside within the while Loop on the right Hand side and should be wired with the current value of the shift Register instead of using local vars .

Then probably everything turns out to be ok.

 

0 Kudos
Message 4 of 14
(4,469 Views)

I meant superfluous instead of superficial.sorry

 

0 Kudos
Message 5 of 14
(4,465 Views)

Hi  Labuser16383

 

thanks for your reply, literally i check my VI after what you mentioned and i notice exactly what you just said about the event cases. 

 

can you tell me please how to make it an accurate one. 

 

initially i want to add once at a time

delete the selected row.

and the view is viewing another SubVI. however, i noticed that when i click on view the data in the table will disappear. 

 

do you have any good tips or some kind of solution. eventually i'm learning myself from internet and learned about event cases before few days.

 

 

Thanks anyway. 

 

 

 

 

 

0 Kudos
Message 6 of 14
(4,460 Views)

With regards to your 4th point, you should create an additional event case for the 'Stop' value change, and pass the value (or a true constant) out to the while loop stop. It will set the tunnel to use the default when unwired, which will do what you want.

 

In several event cases, you haven't wired the array all the way through - in any case where the wire is not connected, default values will be set.

 

You should remove the for loop (I think - maybe it does something else I don't know) because it means that the value added is that of the previous click (not the current values). If this is the intention, I guess it's working fine. If you don't remove it, you'll need to set the stop button's wire out to the while loop stop as 'last value' rather than 'autoindexing'.

 

 


GCentral
0 Kudos
Message 7 of 14
(4,436 Views)

Hello mate,

 

regarding the for loop, I tried this option and my problem still the same. when i add a new element it duplicate before seeing the new one.

 

regarding the delete option, first delete the last raw then the whole table. 

 

the view work properly. 

 

stop button, already added a new case which i forgot in the beginning and now work properly. 

 

just my head scrambled today with this two buttons 

 

 

 

 

Thanks for your reply though 

0 Kudos
Message 8 of 14
(4,432 Views)

I meant something like this - maybe my explanation wasn't so good! It works on this computer (as far as I can tell) but perhaps you want it to do something else. Let me know if that's the case


GCentral
0 Kudos
Message 9 of 14
(4,427 Views)

I forgot which version you used but this is back-saved to 2013. Hope this also works.


GCentral
0 Kudos
Message 10 of 14
(4,425 Views)