LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Diagram : Programatically select enabled frame

Does anyone know of a way to set which frame of a disabled diagram structure is the enabled frame using scripting?

0 Kudos
Message 1 of 17
(7,114 Views)

I have not tried it, but there is an ActiveFrame property which should do the job.

ActiveFrame.png

Note that the diagram disable structure normally switches on environment variables.  Approach with caution.

0 Kudos
Message 2 of 17
(3,660 Views)

Thank you! That works. I tried this before posting the questing and it didn't seem to work but it does...DOH!

0 Kudos
Message 3 of 17
(3,660 Views)

You can simplly use Case structure..!!

Greeting from India,
Malhar
0 Kudos
Message 4 of 17
(3,660 Views)

I'd like to use nested disable diagram structures instead of a case structure such that certain code doesn't compile. I've run into a new problem and I'll ask here while I'm searching, but does anyone know a way to get a reference to a disable diagram structure within a disable diagram structure? The BD.Nodes property doesn't recursively return nodes within nodes.

0 Kudos
Message 5 of 17
(3,660 Views)

You have two options.

  1. Get the reference the normal way, but wire the owner refnum with the frame or diagram refnum of the frame in the top level conditional disable the lower level conditional disable is in.
  2. Use Traverse to return all the conditional disable references, then select the one you need.  Custom labels are your friend here.
0 Kudos
Message 6 of 17
(3,660 Views)

Thanks DFGray, but I did it a different way. I cast the disable diagram reference to a structure reference and then used the Diagrams[] property and then searched the Nodes[] property of that for a disable diagram structure.

0 Kudos
Message 7 of 17
(3,660 Views)

sgregor249 wrote:

I'd like to use nested disable diagram structures instead of a case structure such that certain code doesn't compile.

Couldn't you simply use Conditional Disable Structure and define disable symbols within the project? That is exactly what it is for...

0 Kudos
Message 8 of 17
(3,660 Views)

Conditional disable only operates on a logical combination of platform / processor bitness (32 vs 64) / envorinment (dev/executable/etc.). If i want certain code to not compile based on other conditions I can use nested disable diagram structures or the call by reference node.

0 Kudos
Message 9 of 17
(3,660 Views)

sgregor249 wrote:

Conditional disable only operates on a logical combination of platform / processor bitness (32 vs 64) / envorinment (dev/executable/etc.). If i want certain code to not compile based on other conditions I can use nested disable diagram structures or the call by reference node.

No, you can create any symbol (variable) and assign it any integer value. Yo can do it with Project->Properties->Conditional Disable Symbols. Then for each frame of Conditional Disable Structure you can define an expression using these symbols.

0 Kudos
Message 10 of 17
(3,660 Views)