LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

communicating between subpanel using main vi

Hi all,

I have three VIs. One main VI and another two VIs that I load the into the subpanels in main VI. The main VI is used to handle communicating between these two VIs that load into subpanels. I used queue method to communnicate between VIs. I want to add data from Panel - Add Data.vi when I click Add button into multicolumn listbox in Panel - List.vi. When I run both VIs, the Add button can transfer data into multicolumn listbox, but it doesn't work when I load them into subpanels in Main.vi. Can somebody help me to solve this problem.

Thanks in advance.
0 Kudos
Message 1 of 4
(2,939 Views)

Hi DUE,

you read on two places from the same queue. If you use a queue you can dequeue the element only ones. Why do you use global variables? You can send the new data which shall be added to the listbox with the queue. Change you program in that way, that only one of your two vi´s read the queue. I think you need in your "Add" vi only the function "Obtain Queue", "Enqueue Element" and "Release Queue" or do you want to send data in both directions?

Hope it helps.

Mike

0 Kudos
Message 2 of 4
(2,922 Views)
Hi MikeS81;

Actually, at this moment I only want to add data (by using Add button in Panel - Add Data.vi) into listbox in Panel - List.vi. Because both of VIs are load into subpanels in main VI, I used global variables to make it easier, and the important thing that I don't have an idea how to do that. Can you give me a simple examples to do that because to add data into listbox, it uses a ItemNames property which for me it is very dificult... For your second question, later I may be want to send data in both directions.

Thanks for your answer.
0 Kudos
Message 3 of 4
(2,914 Views)
Hi DUE,

MikeS81 has given you the ideal answer. Take a look at the example called Queue Basics.vi. There are also other examples on queuing that is worth taking a look at.
Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(2,887 Views)