From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-29-2009 03:39 PM
When you create a new control in the Control Editor, you have three choices for the Control Type you're creating--Control, Type Def, and Strict Type Def. Each control type is saved as a .ctl file on disk, but there are different situations where you would choose one type over another:
Control - Use the Control type when you are creating a user interface element that you want to distribute to more than one VI, but that the user can customize to his liking (check out Simon's ni.com controls for examples of the Control type). When using this type, there is no permanent linkage between the .ctl file and any instances of it on VI front panels. That's why you should never use this type for controls/indicators/constants whose data types you want to preserve across all instances of their use. To preserve the data type across all instances of the control, use one of the following two control types.
Type Def - The full name of this type is Type Definition. Use this control type whenever you want all instances of this control/indicator/constant to always have the same data type. For example, if you have a cluster of information that you are using throughout your application, you should make the cluster a Type Definition. That way, if you ever need to add, remove, or change any of the elements of the cluster, you can do it in a single place (specifically, by editing the type definition's .ctl file), and have that change propogated across your entire application. Specifically, I recommend making a type definition out ofevery cluster and every enum in your application. Trust me...it can be very painful to go through an entire app and make manual changes to every single instance of a particular data type because somebody did not type def it.
Strict Type Def - The only difference between Type Definition and Strict Type Definition is cosmetic. With a type definition, users can make pretty much any cosmetic change they wish to individual instances of the type definition within VIs. With a strict type definition, the only things you can change are the label and the description/tip. The important thing is that you cannot change the data type of individual instances of either type definitions or strict type definitions. Whether you select one vs. the other is mostly a discretionary choice...I tend to use only Strict Type Definitions because it's simply the habit I've gotten into over the years.
06-29-2009 05:01 PM
I always start out with STRICT typedefs.
I only demote them to non-strict if I have to.
Cases where I have to include: enabling/disabling items within a cluster at run time and where I need one layout for front panel usage and a different one for printing.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-30-2009 01:35 AM
I normally use Typedefs and in very little cases (pure cosmetic) I resort to strict typedefs.
Christina has posted a blog on customizing controls, and she mentions the difference between normal and strict typedefs.
Ton
06-30-2009 09:46 AM
Darren points out that "The only difference between Type Definition and Strict Type Definition is cosmetic." I'd like to emphasize that these cosmetic attributes can be quite powerful.
A Strict Type Def also preserves the data input ranges which can be extremely useful. Restricting the user input data to valid values is very nice with the data limits, but you can also validate input data from other sources (files, calculations) by obtaining the data limits via property nodes on the Strict Type Def and then using an In Range and Coerce.
Also, if you ever make a Ring control, you better make it a Strict Type Def! Otherwise changing the names in one place will not appear everywhere!
-D
06-30-2009 10:01 AM
06-30-2009 01:05 PM
here is a bike strict type def. that I made for a game for fun.
07-01-2009 07:27 AM
07-01-2009 07:55 AM - edited 07-01-2009 07:58 AM
07-02-2009 01:15 AM
D* wrote:
Also, if you ever make a Ring control, you better make it a Strict Type Def! Otherwise changing the names in one place will not appear everywhere!
Thats because a Typedef can reflect the changes made only to its (type)data in all its instances across the project.
For a Ring control, its Index values are its (type)data & NOT its names (aka strings/items).
07-02-2009 01:18 AM
K1200LT rider wrote:
In general, maybe save files for as early of a version as you can before posting. Thanks...
It is not eoungh for me since I dont have LV as of now, I m afraid...
Harold,
Can you pl post a snapshot of your Ctl file?