LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a multicolumn Listbox double-click event row into a subpanel

Solved!
Go to solution

What I've got is a top-level shell with the high-level equipment configuration, as well as common application functions like saving the test report and quit/close. 

 

In this top-level is a "Test Selection" multicolumn listbox.

 

When a device is chosen in the configuration, one of many subpanels will load depending on the chosen device.  When the subpanel is loaded, the test selection table on the top-level's front panel is populated with the items through a reference.  The items in that listbox differ depending on the subpanel that's loaded.

 

Normally what we do is use an event structure with the double-click event to change states in the program.  Since the states I want to change are states in the subpanel, and the listbox resides in the toplevel, I can't use an event structure to bring that double-clicked row into the subpanel.

 

What I'm currently looking at doing is a property read for the "Value" of that listbox in the subpanel in either the timeout case of an event structure or inside a parallel loop, then making the state decision based on that indicator's value change.  However, by doing this I lose the "queuing" effect of the test selection table (Can double-click a few line items and the event structure will queue those double-click events). 

 

Is there a more elegant way of passing that double-clicked row into the subpanel?

0 Kudos
Message 1 of 9
(6,052 Views)

If I understand correctly, you are currently trying to read the top-level listbox from the subpanel.

An alternative would be to do it the other way around and write to the subpanel from the top-level vi.

That help?

Ian

 

write to subpanel.png

0 Kudos
Message 2 of 9
(6,039 Views)

Hello SnowMule

 

Has the example that Ian has provided addressed your issue?  Please update me on the status of your issue.  Have you attempted anything so far?  Please feel free to upload your VI in question.  Thank you very much for your inquiry!

Sincerely,

Greg S.
0 Kudos
Message 3 of 9
(6,028 Views)

Passing values into or out of it isn't the problem, it's the events that occur in that table that I want available in the subpanel. 

 

I've attached two screenshots of the VI's I'm working with - first is the subpanel loader loop in the top level.  VI reinits all controls/indicators, then clears out and disables/grays out the test selection table.  A notification from the top level with a "Load Subpanel" and path to subpanel is issued and the subpanel loads.  Since this is in a parallel loop, an event structure in the main control loop (not pictured) will still execute.  Things like saving the test report and exiting are in this loop.

 

The other attachment is a basic subpanel.  Populates the line items and symbols in the test selection table and enters the while loop.  Reading the "Value" property in this example changes when the item is single-clicked (highlighted) in the table, not double-clicked. 

Download All
0 Kudos
Message 4 of 9
(6,016 Views)

Hello SnowMule


I just wanted to let you know that I am looking into this for you.  Thank you for your patience.

Sincerely,

Greg S.
0 Kudos
Message 5 of 9
(5,985 Views)

The path I'm taking right now is to put the test selection.doubleclick event in the while loop parallel to the subpanel loader loop.  I initialized that variable as -1 on startup, on double-click that indicator will change to the row that's double-clicked.  In the timeout case of the subpanel I'm reading that and seeing if it's -1 -- if not, enqueue a test step and reset it back to -1.

 

But if there's a better way to do this...

0 Kudos
Message 6 of 9
(5,982 Views)

Hello SnowMule

 

What would better assist me is if you could create the smallest possible sample VI where this behaviour is shown.  If you could upload this to this thread, it would really assist me in assisting you.  Thank you for your effort and patience.

Sincerely,

Greg S.
0 Kudos
Message 7 of 9
(5,967 Views)
Solution
Accepted by topic author SnowMule

It seems that you already pass a reference to the MC Listbox to the subVI.  You can use that to Dynamically register for the Double-Click event inside the subVI.

 

SubVI Events.png

Message 8 of 9
(5,957 Views)

Perfect... that's exactly what I was looking to do. 

 

Once I figured out that you gotta plug the reference into the "event" instead of the "event registration refnum" hole, everything worked swimmingly!

0 Kudos
Message 9 of 9
(5,933 Views)