LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do we have technique to creat a new control at run time?

Hi ,
      I want to creat a new control (add) at run time and also i want to perform darg and drop.
      waiting......................
0 Kudos
Message 1 of 11
(3,094 Views)
I am not entirely sure but I think you will need scripting functionality (generate code automatically e.g. DAQmx uses it) to do it.  I know that NI does not provide the scripting functionality to users.

Vikas
0 Kudos
Message 2 of 11
(3,081 Views)
You need to provide a better explanation of what you're trying to accomplish. Why do you need to create a control dynamically? A better alternative is to have the control already there, but to change its visibility programmatically.

Also, what kind of drag and drop operation are you trying to do? There's lots of different kinds of drag and drop operations.
0 Kudos
Message 3 of 11
(3,069 Views)
Actualy in my application no of controls are not defined , its depend on user.It is a sort of GIS ,so that user can creat control anywhere in the front panel and he can easily drag it to any other location .I dont want to use picture control or any other platform in labview.
waiting...............
0 Kudos
Message 4 of 11
(3,047 Views)
Why don't you want to use the picture control? It seems to me that this is the best way to do what you want. By saying you don't want to use it you've basically pinned yourself into a box.

To dynamically create controls you need to use scripting. In LabVIEW 7 scripting could be turned on, but it was not documented or supported by NI. For LabVIEW 8 you need to buy a license to use scripting.

To use the mouse to move a control you essentially have to use an event structure and respond to the mouse down and mouse move events on the controls, moving the control as you move the mouse.
0 Kudos
Message 5 of 11
(3,027 Views)
The easiest way to do this is to create "enough" controls (50, 100, 200, etc.) and display and move them using property nodes. If you know what you're doing, this is relatively simple. Of course, I'm assuming your controls don't actually do anything.

___________________
Try to take over the world!
0 Kudos
Message 6 of 11
(3,010 Views)
Thanks for replies,but i have never used scripting in labview, can anybody tell me how to perform it.

I dont want to use picture control because after drawing a picture i am unalbe to drag it to the new position at run time,if anybody knows this plz reply.


waiting....................
0 Kudos
Message 7 of 11
(2,986 Views)


D.S wrote:

I dont want to use picture control because after drawing a picture i am unalbe to drag it to the new position at run time,if anybody knows this plz reply.

You should not drag the picture control around, the entire front panel (or suitable part) will be the picture indicator, which is stationary. Your code will parse mouse events and draw objects on the picture area, e.g. something that looks like a control.
 
Still, you can easily move any FP object using a few simple events. Here's an example to move around a picture indicator. (LabVIEW 8.2).
 
I would stay away from scripting, it will not be that easy. Remember, even if you can create a new control with scripting, you still need to hook it up to suitable code to make it functional.
 

 
MovePicture.vi ‏1 KB
0 Kudos
Message 8 of 11
(2,971 Views)

Hi Deepak,

      This seems like an interesing project, though it's still not clear to me the effect you're after.  The "create annotation" of XY graphs (in LV8.2) provides a dynamic creation with dragging effect.  The attached VI uses a transparent XY graph together with tst's idea of having a "cache" of controls - in this case boolean.  The controls appear and dissappear with the annotations...?

Cheers.



Message Edited by tbd on 02-22-2008 04:16 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Download All
0 Kudos
Message 9 of 11
(2,955 Views)
Hi , thanks for your replies..
                                            TBD::: I am unable to open the VI attached by you.
                                             Ok, i again want to explain my post.I am working on a gis type project where user can creat a predefined control by its own , on anywhere on the front panel.After creating that control user should be able to move it anywhere on the front panel.And in next step a new VI will open when user will click on the created Control or image(Predefined)

Everything should happent at run time , without stoping the application
And after finalising the architecture user shuld be able to rearchitect his/her design(user can delete created control).

waiting...................................
0 Kudos
Message 10 of 11
(2,920 Views)