LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using existing typedef

Solved!
Go to solution
Highlighted

Newbie question:  Where can I find how to use a predefined typedef.  I have sample code that uses NI_LinSys_Data Typedefs.lvlib CD Time Info.ctl, so this exists somewhere.  I can see the lvlib file in the program directory.  I can create a cluster with the same info {t0,dt,tf}, and I can create a new Typedef from that cluster.  But how do I use the predefined type?  What tutorial covers this?

0 Kudos
Message 1 of 11
(742 Views)
Highlighted

I don't really understand your question.

 

If you want to use the existing typedef, drag and drop the .ctl file to your VI.  Or if it is something that is on the connector panel of a subVI, right click and pick Create Constant or Create Control.  Any of those will reference to the existing .ctl file.

0 Kudos
Message 2 of 11
(720 Views)
Highlighted

I'm working through the Bishop Control Systems Tutorial.  He often has a cluster of three doubles {t0 dt tf} called "Time Range".  Context Help shows the following:

[cluster] Time Range(typedef 'NI_LinSys_Data Typedefs.lvlib")

   [cluster] Time Range (cluster of 3)

 

I can make the cluster of 3 doubles and make that work, but can't find the predefined control.  I do have the specified lvlib file on my computer.  Nothing pops up searching for "Time Range".  How do I load it?  Where should it have been? 

0 Kudos
Message 3 of 11
(700 Views)
Highlighted

What are you hovering over to get that information in context help?

 

If it is a wire, right click on it.  If it is a subVI, right click on whatever node is giving you that info.  On the right click menu pick Create {Constant, Control, Indicator}  whichever is appropriate for what you are trying to do.  (My guess is a constant so that you can wire that into the top of a Bundle or Bundle by Name.)

 

That is defined somewhere as a .ctl file.  But you don't need to find the .ctl file if you follow the steps above.

0 Kudos
Message 4 of 11
(695 Views)
Highlighted

That's exactly what I did to get around the missing control/type.  I created a new cluster with the same 3 doubles, giving them the same names, and that did work.  I'm still curious how to find the one that is lurking in my LabVIEW installation.

0 Kudos
Message 5 of 11
(691 Views)
Highlighted
Solution
Accepted by topic author MaxYaffe

NO.  I didn't say create a new cluster.  It sounds like you dropped an empty cluster, then dropped in doubles with names.  Yes, that will work, but you do not have the typedef version of the cluster this way.

 

I said to right click on whatever exists in your diagram that is telling you there is this typedef'ed cluster.  In that right click menu, click the Create Constant or Create Control option.

 

If you are still confused, attach a screenshot of your block diagram and your context help window while you are doing whatever it is you are doing to get this cluster to show up in the context help.

0 Kudos
Message 6 of 11
(682 Views)
Highlighted

NI_LinSys_Data Typedefs.lvlib CD Time Info.ctl sounds like something from a LIN/CAN-library, is that what you're working with? Do you have that package installed?

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 11
(672 Views)
Highlighted
Solution
Accepted by topic author MaxYaffe

Right-click your front panel.  Chose "Select a Control...".  Browse to the typdef.

If you want a constant on your block diagram, right-click the block diagram.  Choose "Select a VI...".  Browse to the typdef.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 11
(658 Views)
Highlighted

But his problem is that he can't find the actual typedef.  So he can't browse to it.

0 Kudos
Message 9 of 11
(652 Views)
Highlighted

Thanks for you help, all of you.  Here's what did work:

Method A) Ask the function  (Requires fine motor skills)

1) Highlight terminal Time Range on CD Step Response.vi

2) Right click and select Create|Constant

3) the constant object of the correct type appears

Method B) Scout the installation directory (Requires detective skills)

1) find all I can from the sample

2) go to program install directory:  C:\Program Files (x86)\National Instruments\LabVIEW 2015

3) use File manager to search for NI_LinSys_Data Typedefs.lvlib.  

    it exists at .\vi.lib\addons\Control Design\_Model Construction

4) go back to block diagram, Right Click for the function menu

5) click Select a VI and a Select the VI to open dialog shows up.

6) path to the location just found.  The lvlib doesn't show up but CD_Data Typedefs.lib does.  Open this

7)  Select CD Time Info.ctl  - I still haven't found CD Time Info on the function menu but it might be there somewhere.

😎 plop the control on the diagram.

Method C) Create a new cluster with the same characteristics as the one in the example, {double t0,dt,tf}.

1) I won't bore you with this.  It just worked.

0 Kudos
Message 10 of 11
(648 Views)