03-30-2017 05:11 AM
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.
03-30-2017 07:23 AM
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
03-30-2017 07:39 AM
Hi Bob,
here's the VI, can you please check it and let me know the problem.
Thank you
03-30-2017 08:10 AM
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.
03-30-2017 08:11 AM
I meant superfluous instead of superficial.sorry
03-30-2017 08:32 AM
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.
03-30-2017 10:39 AM
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'.
03-30-2017 10:44 AM
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
03-30-2017 11:51 AM
03-30-2017 11:52 AM