LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Typedefs: Cluster Order with SubPanels Confusion

LV 2010

I'm new at using subpanels, but here's a situation where they solve my problem (since LV refuses to allow a TAB control within a cluster - arrgh).

 

I have a TypeDef.  It's a cluster with indicators and graphs, describing a page to be printed.

One section of that is an instance of another TypeDef. (call it "X")

Because this section changes, according to what kind of file I'm dealing with, I want to display one of about five sets of info here.

A tab control would do it, but I can't have one within a cluster.

According to the HELP about SubPanels:

you cannot create an array of subpanel controls, and you cannot create a type definition of a subpanel control. You can place a subpanel control in a cluster to group the subpanel control with other controls, but the cluster cannot contain only a subpanel control or controls.

--- So, I put a STRING and a STRING and a SUBPANEL in the X TypeDef.  I put an instance of X on a new front panel.

 

According to the HELP:

LabVIEW creates an Invoke Node on the block diagram with the Insert VI method selected.

 

Well, it doesn't do that if it's a TypeDef. Placing an instance of "X" on a panel doesn't do anything special.

 

So I get the CONTROLS[ ] property of the instance, select out item 2 (0, 1, 2), typecast it to a SubPanel reference, and then I can use the INSERT VI and it works.

 

But I want to have the subpanel be item #0, so that I can find it in multiple situations: In one case, I might have two strings and a subpanel, in another I might have three strings and a subpanel. If I adopted the convention that the subpanel was 0, then I could extract item 0 in either case and it would work.

 

But I can't do that. If I try to REORDER CONTROLS in CLUSTER for the TypeDef of X, the subpanel doesn't have a number. The strings are #0 and #1 - there is no #2.

 

So, is it a control, or isn't it?  If it is, why can't I re-order it?  If it isn't, why does it appear in the CONTROLS[ ] property of its parent?

 

Is it always going to be LAST in the CONTROLS[ ] array?  What if there are two subpanels in a cluster? Which one is more lastest?

 

What are the rules here?

 

If I make the TypeDef NON-STRICT, I can create a direct property node on the panel.  But I think that means I have to make the whole chain non-strict (A PAGE contains a BASIC PAGE + ADDITIONS, the ADDITIONS contains several SECTIONS, the SECTIONS contains X), and I don't want to do that.


Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 18
(3,365 Views)

A test shows that if "X" has a subpanel in it (subpanel A), and then I add subpanel B, then subpanel B is item 2 in the CONTROLS[ ] array, and subpanel A is item 3.

In other words, adding a subpanel puts it IN FRONT OF any other subpanels already there.

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 18
(3,360 Views)

A couple of possible solutions, neither of which I have tried, as I am in the middle of an upgrade...

 

 

  1. You can reorder a cluster by the order you put things into it.  Have you tried dragging everything out, dragging the subpanel in, then dragging everything else back in?
  2. You could use an X-Control instead of a strict typedef.  I know it is a lot more heavyweight, but may serve your needs better.
Good luck.  If neither of these work, let us know and I can make some inquiries.

 

0 Kudos
Message 3 of 18
(3,354 Views)

You can reorder a cluster by the order you put things into it.  Have you tried dragging everything out, dragging the subpanel in, then dragging everything else back in?

 

 

Yes. Start with an empty cluster.  Place a subpanel in it, then string A, then string B.  String A is item #0, String B is item #1, and in the CONTROLS[ ] array, the subpanel is item #2.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 18
(3,346 Views)

Looks like I made a mistake somewhere though.  You CAN create an INVOKE node for the subpanel, even though it's in a STRICT typedef (I tried earlier and couldn't, but perhaps I gorched something).

 

So maybe that's the answer for me.  It's not working yet, but I just now tried the first time.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 18
(3,345 Views)

It does work, I was looking in the wrong place.

 

You CAN create an INVOKE NODE to a subpanel, even if it's within a strict typedef within a strict typedef, within a strict typedef.

 

The other questions still stand as points of confusion, but not as obstacles now.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 18
(3,342 Views)

Hmm.  I can make an INVOKE NODE to the panel on my main page, even if the subpanel is in a typedef inside a typedef, etc.

 

However, if I go and EDIT that typedef, even moving the subpanel a single pixel, the INVOKE NODE just disappears, leaving a broken wire.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 18
(3,334 Views)

Hey Steve,

 

Can you attach the vi, and clarify what the remaining problem is?

 

Regards,

A. Zaatari

National Instruments
Applications Engineer
0 Kudos
Message 8 of 18
(3,314 Views)

I've made a small test thing which showed up ANOTHER issue.

 

Open the top-level VI in the attached LLB.

Notice descriptions on diagram.

 

#1.  Run it out of the box, as it is.  Why are the displays BLANK?  I am clearly executing the VI BEFORE it's inserted into the SubPanel. If you flip the switch, the displays react appropriately, so it's not caching anything.

 

#2:  Make a change to the typedef and POOF! the INVOKE NODE disappears.

 

#3 is a request for clarification of the rules.  If it's not a control, why is it in the CONTROLS array?  If it IS a control, why can't I REORDER it in the Typedef?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 18
(3,304 Views)

Hey Steve,

 

I was able to recreate the issue, and will get back to you on why this is going on.

 

Regards,

A. Zaatari

National Instruments
Applications Engineer
0 Kudos
Message 10 of 18
(3,288 Views)