Showing results for 
Search instead for 
Did you mean: 

Placing .CTL in a VI

Go to solution

Greetings.  i m a newbie to labview. I just went through  a program .In it they have created a .CTL file which only consists of only one Enum control. And in several other VIs in the project , they have called the .ctl file in the block diagram itself. I was searching for how to insert a .ctl file into a VI but found no solutions? So can anyone please explain how to insert a .ctl file into a VI?


Note: also can anyone explain what differentiates .ctl  file from other functions?

0 Kudos
Message 1 of 4
Accepted by topic author AVP2484

Just drag the ctl file from the project window or Windows Explorer onto the block diagram.


A ctl file just defines a default look for a control and/or a data type.  In the case of the enum, you should be defining a data type.  By defining the enum in a ctl file, if you need to add/remove items from the enum, everywhere that type def is used will get updated instead of you needing to go through all of your code and update the enums individually (which I did have to do when I was a LabVIEW newbie).


My general advice is that every enum and cluster should be a type def.  Granted, there are a lot of people here (myself included) who will argue that a type def cluster is usually better as a class, but that is an argument for another day.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4

Thnx crossrulz for the reply and it did work well..finally u have mentioned to use cluster as def.type instead of class..i can't get it??if u don't mind can u explain a little bit elaborately?

0 Kudos
Message 3 of 4

Actually, he said the opposite, but a complete discussion would probably be too much for a newbie.

Also, you should mark as a solution crossrulz's post, not yours.

LV 7.1, 2011, 2017, 2019
0 Kudos
Message 4 of 4