Sharon_ Posted October 14, 2009 Report Share Posted October 14, 2009 Hi, I am new to Labview. I would like to know whether it is possible to place objects programmatically. For instance, assume that there is variable 'a'. If the value of a is 5 , I need to place 5 ring objects on front panel.If it is 6....6 objects on the front panel. Thanks for your time..!!! -Sharon Quote Link to comment
asbo Posted October 14, 2009 Report Share Posted October 14, 2009 You'll need to use scripting to create controls at run-time - unless there's an upper limit to how many you'll need. If that's the case, you can hide/show controls as you need. Either way, that page has a few examples to show you how scripting works. Quote Link to comment
Sharon_ Posted October 14, 2009 Author Report Share Posted October 14, 2009 You'll need to use scripting to create controls at run-time - unless there's an upper limit to how many you'll need. If that's the case, you can hide/show controls as you need. Either way, that page has a few examples to show you how scripting works. Hi Asbo, Thanks for the reply. I will try scripting to generate some objects. Thanks and regards, Sharon Quote Link to comment
jcarmody Posted October 14, 2009 Report Share Posted October 14, 2009 Hi Asbo, Thanks for the reply. I will try scripting to generate some objects. Sharon, it's important to note that you won't be able to build an executable with your scripted VI. This is fine if you're just making a tool to make development easier. If this is what you're doing, consider making it into a plugin for the JKI Right-Click Framework. There's more information to help you get started scripting here and here. Quote Link to comment
PaulG. Posted October 14, 2009 Report Share Posted October 14, 2009 As was said before, you can't use scripting in an executable. If you know the upper limit to the number of objects you will need on your front panel the simplest approach would be to create that number of objects on the front panel and make them visible/invisible with property nodes in your program, depending on the value of your 'a' variable. Quote Link to comment
Black Pearl Posted October 14, 2009 Report Share Posted October 14, 2009 If I remember correctly, there is a dynamic list code with XControls on ni.com. If you are familiar with advanced coding techniques, this might give you the highest flexibility. Another simple option to manage runtime 'creation' of controls it is to use an array. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.