LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

drag and drop between VIs

Solved!
Go to solution

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?

0 Kudos
Message 1 of 6
(4,228 Views)
Solution
Accepted by topic author deskpilot

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;))

Message 2 of 6
(4,216 Views)

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

 

Screenshot.png

 

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

Message 3 of 6
(4,210 Views)

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

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 4 of 6
(4,195 Views)

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 

0 Kudos
Message 5 of 6
(4,180 Views)

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.

0 Kudos
Message 6 of 6
(4,147 Views)