LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating new objects on the Front Panel at runtime.

Solved!
Go to solution

Hello, 

I am working on a drag and drop UI for defining a test sequence. I have some tiles (clusters) for each test that I create when the VI launches. The idea is that the user grabs a tile and drags it onto the timeline to define the test (this works fine, see image). My issue is that I define a finite number of clusters for each test and then stack them on top of each other. I would rather create a new instance of the cluster on the front panel each time the user grabs a tile and moves it to the timeline. 

 

My question; Is there a way to programmatically create a cluster object from a template (or typedef) on the front panel at runtime?   

 

Jay14159265_0-1690923542149.png

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 1 of 22
(1,765 Views)
You could have an array that changes size. Just out of curiosity, is this an executable or source code?
Message 2 of 22
(1,753 Views)

@Gregory wrote:
You could have an array that changes size. Just out of curiosity, is this an executable or source code?

Having an array is an interesting idea. Visually I don't want to have an array but I understand how I could make that work. I have done some UI work where I rolled every UI element from picture and draw object privatives but that is so much work. I'm trying not to go there for this one. This is source code. 

Jay14159265_0-1690929015111.png

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 3 of 22
(1,720 Views)

I'm imagining in my head that there may be some way to create a cluster from a typedef similar to how you would launch and load a .vit front panel by reference into sub panel at runtime.

 

If I have a reference to the typedef can I instantiate it an add it to the FP objects somehow? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 4 of 22
(1,696 Views)

With scripting, one VI can edit another VI, as long as the VI being edited is neither running, nor reserved for run.

Message 5 of 22
(1,686 Views)