LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble shooting deleting items in Multi-column listbox.

Solved!
Go to solution

Hello Everyone,

 

I am developing a program to work with an instrument that is communicating by RS232.

 

I can communicate to the instrument fine and control it fine, my problem is when trying to delete data in the MCLB.  Attached is my entire .vi for reference, even though you won't be able to run it as it will try to communicate with instrument at startup as well as you will be missing several of the functional global .vi's.

 

When there is multiple items listed in the MCLB and I selecte the multiple items and click delete data it doesn't always work for me, sometime it will and sometimes it won't and I can't figure why.  This problem persists even if I select only 1 item.

 

Any ideas?

 

Thanks,

~Dan

0 Kudos
Message 1 of 5
(3,369 Views)
Solution
Accepted by Tera-Engineer

It seems like you update your listbox in multiple cases, this is a good way to make your code unpredictable. If I'd be you, I'd probe the string arrays wired to each of your ItemNames[] in your VI and play with your GUI to reproduce the case where it works and when it doesn't. You will find out where it does what you don't expect.

Message 2 of 5
(3,336 Views)

Unfortunately I have to update the MCLB in multiple places as I go, this is due to that there is multiple variations of how the program can run and the instrument to be used.  Is there another way?  Could I possibly add in an Event Case where after each operation it updates the MCLB before moving onto the next case in the queue? 

 

Is there a better way to do this operation?  If I am going to rip it up completely now is the time to do it.

 

Thank you again for the help!

0 Kudos
Message 3 of 5
(3,329 Views)

I also have tried this in probing the MCLB index being fed into the delete from array function and it reads out the indexes to delete, but for some reason it doesn't work all of the time.

0 Kudos
Message 4 of 5
(3,326 Views)

Thank you for your reply!!! This got my brain thinking in a different way!!! Instead of having each individual event case update the table, I will re-structure the program to update the FG and then  I will call an update table event after the needed cases.  I know it sounds simple to think that way but I am used to a simple recording even cast style program so it is only one case where data will be written to the file that I need to save.  I am not used to dealing with listening and looking for multple descrete cases that can all interact with the program.

 

Thank you again!

~Dan

0 Kudos
Message 5 of 5
(3,280 Views)