05-20-2011 05:30 PM
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?
Solved! Go to Solution.
05-21-2011 04:36 AM
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
05-23-2011 03:00 PM
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!
05-24-2011 12:50 PM
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.
05-25-2011 06:28 PM
Hello SnowMule
I just wanted to let you know that I am looking into this for you. Thank you for your patience.
05-26-2011 02:22 AM - edited 05-26-2011 02:23 AM
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...
05-27-2011 01:06 PM - edited 05-27-2011 01:06 PM
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.
05-27-2011 02:54 PM
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.
06-08-2011 05:13 PM
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!