LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I get a case structure's panel?

Solved!
Go to solution

I am trying to place a boolean indicator within a case structure via LabVIEW scripting and am not having any luck.

I started with the following source code, which creates and populates a case structure from an array:

https://decibel.ni.com/content/docs/DOC-22703

 

So my code, rather than put an enum inside each case, creates some compound arithmetic and a mask for each case.  This is all working fine.  I now want to place boolean indicators on the front panel that correspond to each case, and this is where my problem is.  I can create the indicators, but when I look at the block diagram view, all of the indicators are located outside of the case structure, rather than the indicators being inside of each respective case.

 

I think the reason is that a boolean indicator is created by passing a reference to the front panel.  But the problem with this is that the VI panel reference does not indicate that the boolean should be placed inside the case structure, just on the panel, so when you view in block diagram mode, it's just thrown the indicators all outside the case structure and wired them up via tunnels.  I am getting the panel reference by accessing the OwningVI field of my CaseSel object.  I feel like there must be some field I should be able to access that indicates to put the block-diagram boolean inside of the respective case structure, but I can't find it.

 

I've attached a file with 3 pics in it.  One shows a pic of the code I'm using to create the indicators.  One shows the type of output I'm looking for.  One shows the type of output I'm getting.

 

 

 

0 Kudos
Message 1 of 3
(2,367 Views)
Solution
Accepted by topic author bmishoe

Before you connect the wire to the terminal, call the Move method on the indicator's terminal and use one of the case structure's Diagrams[] as the owner. This will move the terminal into the structure.


___________________
Try to take over the world!
Message 2 of 3
(2,358 Views)

That worked!!  Thank you so much....This was 5% of the last 10% I was having a problem with.  I have one more thing which I will post momentarily...thanks again!

0 Kudos
Message 3 of 3
(2,346 Views)