Jump to content

How do I use the function "New VI Object" ?


sand of time

Recommended Posts

Hi

I want to add controls when the vi is running , so I download some OpenG Packages that included the function "New VI Object" , can I use it to build a control on front panel ?

There is no help document about it , is there anybody can help me ?

Thanks very much !

Bin Wu

Adding a new control to a front panel is considered to be editing a VI and is not possible while the VI is running. The "New VI Object" function can add controls to the front panel, but only on VIs that are in edit mode.

Link to comment

You can, however, "simulate" addition of new controls, assuming that you want to add several instances of the same type of control, you make them ahead of time, say 10 (or 20, whatever) then hide them and/or keep them off screen, then as your user requests them, move them into position and unhide. To the user it will look like the control was made. The downside is trying to set a reasonable limit on how many to premake. Are you making some type of GUI layout editor? What is your end application?

Another possibility is to use the picture control for your editing canvas, using images of controls, then create a copy of a VI off to the side from a template and then add the controls using New Object. The copy would not be running and therefore you could add the controls.

YMMV

Link to comment
You can, however, "simulate" addition of new controls, assuming that you want to add several instances of the same type of control, you make them ahead of time, say 10 (or 20, whatever) then hide them and/or keep them off screen, then as your user requests them, move them into position and unhide. To the user it will look like the control was made. The downside is trying to set a reasonable limit on how many to premake. Are you making some type of GUI layout editor? What is your end application?

Another possibility is to use the picture control for your editing canvas, using images of controls, then create a copy of a VI off to the side from a template and then add the controls using New Object. The copy would not be running and therefore you could add the controls.

YMMV

Thank you!

But it can not creat controls dynamically, because the number of controls is certain.

I think I have made a mistake, my opinion does not accord with logic.

Thanks for your helps, I learn a lot in this forums.

Bin Wu :thumbup:

Link to comment
Thank you!

But it can not creat controls dynamically, because the number of controls is certain.

I think I have made a mistake, my opinion does not accord with logic.

Thanks for your helps, I learn a lot in this forums.

Bin Wu :thumbup:

Yes and no. You cannot add controls dynamically to a VI that is running or to the creating VI (yet), but you can use and editor VI to create another VI (that is not running) and then at the end of the edit process, run the new VI.

What is your application? What are you trying to do? Perhaps if we knew that we could suggest alternatives.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.