LabVIEW APIs Discussions

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/17
8,374件の閲覧回数

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 件の賞賛
メッセージ2/17
4,920件の閲覧回数

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

0 件の賞賛
メッセージ3/17
4,920件の閲覧回数

You can simplly use Case structure..!!

Greeting from India,
Malhar
0 件の賞賛
メッセージ4/17
4,920件の閲覧回数

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 件の賞賛
メッセージ5/17
4,920件の閲覧回数

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 件の賞賛
メッセージ6/17
4,920件の閲覧回数

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 件の賞賛
メッセージ7/17
4,920件の閲覧回数

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 件の賞賛
メッセージ8/17
4,920件の閲覧回数

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 件の賞賛
メッセージ9/17
4,920件の閲覧回数

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 件の賞賛
メッセージ10/17
4,920件の閲覧回数