03-23-2012 01:21 PM
I don't have much experience using drag and drop. I am thinking about using a tree control that pops up in a sub VI with a list of channel names. I would like to drag the channel name onto an indicator on my main front panel. There will be some code involved after that to get the data from that channel into the indicator that was chosen, but I'm not sure how to start the process of dragging between VIs. Does the subVI with the tree control have to have an event structure? Do I need an FG operating between the two VIs?
Solved! Go to Solution.
03-24-2012 01:08 AM
Hi deskpilot,
Checkout the attached example. THis must help you. Run Both the VIs and try dragging from the list box and dropping in the VISA control
Regards,
NitzZ
(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved;))
03-24-2012 02:52 AM - edited 03-24-2012 02:53 AM
May be I can provide you a very good example program which I developed sometime back. I hope its useful to you.
open main.vi in front panels folder
Don't forget to give kudos if you really like it 🙂
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
03-24-2012 06:36 PM
NitzZ:
Your vis give a good simple example for drag and drop.
However there are a few things that might mislead a LabVIEW newcomer.
1) Never hook up a Boolean directly to the while loop conditional terminal when you have an event structure
The Stop control should be handled in an event.
If you don't do this you are forced to create a way to constantly read the control (i.e.. Polling).
One of the benefits of an Event structure is to eliminate polling.
2) Unnecessary timeout (you have a 10 ms timeout that does nothing)
Because of issue #1 you need to do this or your vi would not stop.
3) A timer function in an Event structure loop (Wait for Next Millisecond Multiple)
This has no benefit other than to slightly slow the response of the event structure
Not meaning to nitpick here. Just some helpful comments on an otherwise good example.
steve
03-26-2012 12:39 AM
Steve,
Thanks for pointing these mistakes out. These are the points which I ignored by mistake while posting the example in a hurry. I had modified a template with a while loop and Stop button to create this example and was concentrating just on the drag and drop 🙂 But you are right, for a newcomer this must be a misleading vi. Appreciate your efforts Steve.
Regards,
Nitz
03-26-2012 02:46 PM
Nitz, that looks like exactly what I needed. I'm not sure I understand the Drag/Drop data though. I can eliminate the change to variant and everything still works (after modifying the other structure to accept string data), but the build array must be there. I guess thats just a requirement of Drag/Drop event cases? Thanks again for the help.