LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use TypeDefs for control AND indicator?

I'm an old hand at LabVIEW, but fairly new at using TypeDefs. They have really made my life easier on my current project, but now I've run into something I can't quite figure out.

In stuck on LV 7.0, but I don't think that matters; I don't see anything different in 8.0

My policy is for numeric indicators to be BOLD text, and be transparent (no frame, no background). Numeric controls, have the default frame around them, and plain text. I think this makes for a pleasing appearance.

I use STRICT typedefs when possible, but I understand there are times when it is not.

I have a certain cluster (TypeDef) which is arranged to be good looking. It's always been an indicator, so I TypeDefed (is that a word?) it with transparent frame and bold text. It works fine.

Now, I need to make the same cluster into a control, so the user can edit it. So, my question is, how can I use the typedef I have, yet change it to be a different-looking control? I realize that I can make it a non-strict typedef. But then every instance has to be customized. If I add or remove an itme from the master, all the CONTROL instances lose their frames, which I don't want to happen. If I make the master a CONTROL, then all the INDICATOR instances gain their frames, which I also do not want.

I've read this thread, but the advice doesn't work:

1... You can't use a typedef within a typedef unless you change it somehow: put it inside a cluster or array.
2... Even when you do that, if you change the master, one or the other of the slaves gets clobbered.

I suppose the only way is to make TWO typedefs, one fro controls and one for indicators, and add or remove items to BOTH. But that's against the purpose of typedefs.

Any other way out?

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 4
(4,632 Views)
If you have a strict control, it can never become an indicator unless the same strict rules apply to the control as well as indicator. I think your only way out is to create both strict type control as well as another strict type indicator. You're just going to have to keep track of them yourself. I think you might be trying to defeat the purpose of the strict typedef trying to do both.

PaulG.
7.1 with 8.2 "in the mail". Smiley Tongue
PaulG.
Retired
0 Kudos
Message 2 of 4
(4,628 Views)
I think you might be trying to defeat the purpose of the strict typedef trying to do both.

Well, the STRICT aspect is not a requirement. It's not the STRICT aspect that's the stumbling block, as far as I can see.

If I could make it work with NON-STRICT typedefs, I would do that. But I don't see how.

I suppose it's a fundamental oxymoron: I want the typedef to force these things to be the same, but they have to be different.

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 3 of 4
(4,623 Views)

Hi CMB,

While this isn't an answer to your question (which it looks like you figured out) - it is related to managing cluster-type-defs where there's a need to have a Strictly-typed GUI representation.

If you continue using type-defs, you'll probably come to a point where a GUI-friendly representation isn't program friendly.  For instance, it may be nice to manage some data as an array of clusters, but present the data to the user in a multi-column list box.  Or maybe the program-representation is an Enum, but you want the user to have a Menu Ring.  I'll sometimes keep a program-friendly version of clusters and when these clusters need to be presented to the user, a translator-VI converts the program-friendly non-strict representation to (and from) a Strictly-typed GUI representation.

It's probably over-kill in this case - but someday you may find yourself sacrificing an elegant-diagram because the data-representation is [only] GUI friendly!

Cheers.

 

Message Edited by tbd on 08-12-2006 11:36 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 4
(4,607 Views)