LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change information in a table with combobox

Solved!
Go to solution

Hello,

 

I'm trying to use a combo box with each month of the year. When I select a month, it need open a text file with the information of that month, the code must be the same for all the months, it only have to change which file must be opened. I have the problem that I can't change the information in the table when the VI is running. Selecting another option in the combo box does not change the information. Can anybody help me?

 

Mocte117_1-1685681790964.png

This is the code (I inserted a case for combo box to try to change the open file, but it is not working as I expected)

Mocte117_0-1685681732167.png

The files:

Mocte117_2-1685682143321.png

 

 

0 Kudos
Message 1 of 9
(878 Views)

What I see from the picture is: You read the combo box and the file only once before the while loop. When the VI is running (in the while loop) the information can not be updated. 

 

You should create a 'Value Change' (or a 'Mouse Up') event in the event structure for the combo box, read the file in the event and update the array in the shift register.

 

Note: I can not see what is happening in the other cases of the event structure and I can not debug pictures. 

0 Kudos
Message 2 of 9
(867 Views)

 

When you say that i need to update the array in the shift register, how can i do that?, i have this:

Mocte117_1-1685776682043.png

 

0 Kudos
Message 3 of 9
(798 Views)

@Mocte117 wrote:

 

When you say that i need to update the array in the shift register, how can i do that?, i have this:

 

 


We can't really work with pictures. if you want help, attach your VI and some typical data files. Your shift regsiter contains an array, and there are plenty of array operations that can be suitable, depending on what you want to do (replace, append, etc.).

0 Kudos
Message 4 of 9
(794 Views)

This is the VI.

0 Kudos
Message 5 of 9
(763 Views)

Your code only reads the ComboBox one time, at the beginning of execution.

Take all the code that is outside the loop and put it inside the event case "Combo Box": Value Change.

0 Kudos
Message 6 of 9
(727 Views)

something like this?

Mocte117_1-1685934513456.png

 

0 Kudos
Message 7 of 9
(708 Views)
Solution
Accepted by topic author Mocte117

Update: It's fixed. There is an error when I try to save a modification, the VI opens a tab to manually save the file. But I can already see the list depending on the month 🙂

Mocte117_0-1685938502689.png

 

0 Kudos
Message 8 of 9
(699 Views)

@Mocte117 wrote:

Update: It's fixed. There is an error when I try to save a modification, the VI opens a tab to manually save the file. But I can already see the list depending on the month 🙂

Mocte117_0-1685938502689.png

 


Of course you shouldn't expect anyone to help you with that because you haven't included your code.  You've just put up a picture, and your picture doesn't even show the part of the code that you're complaining about.  No one here is psychic.

0 Kudos
Message 9 of 9
(678 Views)