LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which one is more efficient - custom control, typedef or strict typedef?

I am using a custom control in one of my VIs. Are there any performance (memory, speed, etc.) tradeoffs when selecting between custom controls, typedefs and strict typedefs? Since I am creating multiple instances of the custom control, I am inclined towards using typedefs. But if this would slow down my VI, I would rather use it as a custom control without the strict biniding of the typedef.
Thanks. 
0 Kudos
Message 1 of 4
(3,526 Views)

There should be no performance hit when using a typedef.  The general rule is, when you use the term "multiple instances" when describing your use of a custom control, it better be a typedef.  🙂  As far as regular vs. strict, if you ever anticipate modifying the appearance of different instances of the control to be different than each other, use a typedef.  Otherwise use a strict typedef.  Personally, none of my typedefs are ever seen by an end user (since my typedefs are data structures, generally), so I always use strict typedefs.

-D

Message 2 of 4
(3,523 Views)
I am using an enum, so I guess I should use a strict typedef. Thanks for the help.
0 Kudos
Message 3 of 4
(3,515 Views)

Yup, definitely typedef an enum.  One of my teammates actually advocates typedefing any enum, even if you're *sure* you'll only use it in one place.  Because inevitably, you'll need it somewhere else.  😉

-D

0 Kudos
Message 4 of 4
(3,507 Views)