12-01-2015 10:09 AM
Hello all,
I have an application where user creates a "monitoring layout" by dragging the desired data from a tree. In the front panel, I will have several subpanels to allow users to drag&drop data to anywhere they desire. Attached vi's indicates similar stuff.
But, when dropping the data, I cannot filter which subpanel should be used (In the attached vi, I am trying to drop data on both subpanels but even couldn't manage to succeed that either) What should be used to determine which subpanel should show the subVI (in this case it is a waveform graph)? Mouse filter events? If I use mouse enter, I cannot use drop filter event with that at the same time.
How can I feed the data, which is being generated inside second while loop, into these subvi's that I loaded to the subpanels? I have to do that in timeout event I assume, but how can I reach the subvi's from there then?
Please ask if you need further questions. Sorry for any possible incomprehensible sentences above 🙂
BR, Palazzo
Solved! Go to Solution.
12-01-2015 10:51 AM
You can figure out which control the Drop happened on using the control reference. Like this:
The ControlRef value from the event should match up to one of the controls, so you run an Equal? operation, find the True, and index your subpanels to match.
I attached the edited VI here as well.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
12-01-2015 11:00 AM
Hello James,
Thanks for the reply. This should do the work. Do you have any comments on the other matter?
Cheers,
Palazzo
12-01-2015 11:07 AM - edited 12-01-2015 11:14 AM
Yup, there are a lot of different options for passing data to the loaded subVI. At some point you need to store the reference to the loaded VI and use that reference to manipulate the VI. Here's a quick easy way to do it using an array local variable:
This isn't very scaleable and it definitely has one downside right off the bat. That array will always grow and never get smaller, so you will have overlapping VI references. It should still work but if you kept dragging and dropping you would eventually have a memory issue. With some tweaking you could fix this issue (maybe designate specific array indices for each subpanel, so you always clear the current reference in that specific array location before loading the subpanel).
FYI, your 1ms Waits are too small. Ain't nobody got CPU for that.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
12-01-2015 02:26 PM
P.S. Another way to pass data to your loaded subVIs would be to create queues that you can use to communicate with them. You would need to create a queue for each instance and just pass the references to each loop. This way would work the best if you plan on passing a lot of different info around instead of just a single plot.
Please mark the solution when you get a chance, so that someone else can find their solution if they have a similar problem.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
12-02-2015 11:55 AM
Hello James,
Thanks for the update, I see your point with referances. I will try to use queues, since there will be more channels-data with higher sampling rates. But this will be my first try. Let me dig some examples...
I will post my code here ASAP. But I would like to hear your thoughts on this strict type calling. Is this right approach for such application? What if I created the analysis process, FFT for instance, inside the SubVI and feed the acquired data to it? In that case I assume I'll not need referencing the graphs since I will directly see what is going on the front panel of the subvi. Another approach might be doing analysis inside the main vi, in second loop, and showing that on the graphs by referencing. Do you have some tips to advise?
Thanks for the support so far. I will immediately mark this topic as solved, but maybe I'll ask couple of more things 🙂
Cheers,
Palazzo