10.1. Type DefΒΆ

A Type Def gives definition to a data element. They are often used with clusters and enumerators. Defining a Type Def results in a file with extension ctl being created. Thus, a Type Def can be used multiple times and in more than one VI and when the Type Def is changed, the change is reflected wherever it is used.

  1. Add a Cluster Constant to the block diagram.

  2. Select the Cluster Constant and from the right mouse button menu, select Make Type Def. You will notice that a small triangle is added to the upper right corner of the box.

  3. From the right mouse button menu, select Open Type Def.


    This loads a window that look like a front panel. The Cluster Constant is shown as a grey box. You may resize the cluster box as needed and add indicators or controls to it. I added two numeric controls for the left and right distance movement of the robot.

  4. You may also want to edit the Type Def’s icon to tell what the Type Def defines.

  5. Save the Type Def. On the block diagram, you may select to view it as an icon to see the icon showing what it defines. Note that the icon for a Type Def (both for an Enumerator and Cluster) appear on the block diagram with a small black triangle in the upper left corner.

  6. Use the Type Def to define the element data type for the queue and to bundle the cluster data.