LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

copy a queue ref control to a typedef control

Hi all

I am at the end of my knowledge

How can I copy via scripting a queue ref control from a front panel to a typedef control

Thanks

Jürgen

PS

LabVIEW 2010

0 Kudos
Message 1 of 9
(6,800 Views)

Use the Move method (on the reference to the queue ref) instead of copy/paste.  The owner will be the reference to the panel of the control.

Note that under scripting, controls are essentially VIs without block diagrams.  You create a new one with the New VI primitive.

0 Kudos
Message 2 of 9
(3,810 Views)

Hi

i trye but it is not working

Can you give me a example ?

JürgenTypeDef.png

0 Kudos
Message 3 of 9
(3,810 Views)

The owner needs to be the panel of the control, not the control itself.

I have attached the full sample code.  For some reason, I could not attach a snippet.

0 Kudos
Message 4 of 9
(3,810 Views)

Move doesn't work across VIs.

Do this: Get the type descriptor for the control then use the VI method "Create Control From Type" (or something like that) to actually create the control on the control VI.

0 Kudos
Message 5 of 9
(3,810 Views)

You can also use the VI's Create from Reference method and give it the reference to your original control. This RCF plugin has an example - https://decibel.ni.com/content/docs/DOC-5812


___________________
Try to take over the world!
0 Kudos
Message 6 of 9
(3,810 Views)

Hi

Thanks for the help

So here are some information what is my idea.

I am writing a tool to create a VI hierarchy.

For that I need the possibility to create a type def with different controls on it.

Write now it is working only for on element the second one i got this error

DFGray that works with the panel but then I got this error

[ The front panel contains extra controls that do not belong to the custom control. You must delete these extra controls.)

Jürgen

PS

I  like this scripting and I hope there will come also soon a API to Icon editor via scripting

0 Kudos
Message 7 of 9
(3,810 Views)

Specify the cluster as the owner instead of the panel and the control will be moved into the cluster instead of onto the panel.  This should take care of the error.

0 Kudos
Message 8 of 9
(3,810 Views)

Yes this works

Jürgen

0 Kudos
Message 9 of 9
(3,810 Views)