LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Scripting Main Board

Does anyone know how to group and ungroup controls on the front panel? We have some VIs with DBL controls and the front panel. I want to be able to select a DBL terminal on the block diagram and have the control replaced with a string control. For controls that aren't grouped, everything is fine. I find the selected terminal on the BD, get a reference to the control associated to the terminal and call the replace method with a string control style. But, if the control is part of a group, LV either freezes or crashes hard (disappears).

Thanks,

Pat

0 Kudos
Message 51 of 171
(5,857 Views)

How do you move controls and indicators (and their labels) around on the block diagram?

I'm making a script to put a conditional disable shell around a VI so target-specific code can be disabled and simulated on a PC.

I have a feeling the best way to do it would be to create the conditional disable, place the subVI in it, and then place the controls outside of it and wire them through, but I'd really prefer to place the conditional disable structure around the subVI (so I can take advantage of auto-wiring).

Marshal Horn
0 Kudos
Message 52 of 171
(5,857 Views)

How can we disable the run-time shortcut menu of a control?

(the equivalent of : right clic on the control >> Advanced >> Run-Time Shortcut Menu >> Disable)

Cheers


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 53 of 171
(5,857 Views)

Kamocat wrote:

How do you move controls and indicators (and their labels) around on the block diagram?

I'm making a script to put a conditional disable shell around a VI so target-specific code can be disabled and simulated on a PC.

I have a feeling the best way to do it would be to create the conditional disable, place the subVI in it, and then place the controls outside of it and wire them through, but I'd really prefer to place the conditional disable structure around the subVI (so I can take advantage of auto-wiring).

It is currently not possible to drop a structure on a diagram "around" existing code.  You do have to drop the structure, then move objects inside of it.  Once the object is inside, however, you can use the Connect Wires method of the Terminal class to connect terminals of the subVI inside the structure with terminals outside the structure, and the tunnels will be automatically created for you.

-D

0 Kudos
Message 54 of 171
(5,857 Views)

This is one area of scripting that's really needed, IMO.  The work-around is pretty painful, since the scripting API for the Wire object is rather limited, too.

0 Kudos
Message 55 of 171
(5,857 Views)

From a logical standpoint, I think a good way to implement it would be to place the structure around the selected objects.

Perhaps you can define the selection by source-to-sink.  (a cluster of two arrays of references.  The first is an array of the references for objects that source the data, and the second is an array of references to objects that sink the data.)  By specifying the sources and sinks, them (and everything in between) can be selected.

Marshal Horn
0 Kudos
Message 56 of 171
(5,857 Views)

I've been having trouble finding a way to switch directly from a control on the front panel to its representation on the block diagram (or back).

I've been using "traverse", but it takes a second or two to find it.  Is there a more efficient method?

Marshal Horn
0 Kudos
Message 57 of 171
(5,857 Views)

If you have a control reference, you can use the Terminal property to get the BD reference (there are also property node and local variable properties).  From the block diagram, use the Control property of a control terminal.

0 Kudos
Message 58 of 171
(5,857 Views)

The best way I have found to do this is in your LabVIEW code.  Use the Mouse Down? event to toss right click events.  You can also use it to change the context menu.  See the LabVIEW help for details.

0 Kudos
Message 59 of 171
(5,857 Views)

Thank you!

I thought the terminal property was the terminal on the connector pane.

Marshal Horn
0 Kudos
Message 60 of 171
(5,857 Views)