01-27-2019 09:04 AM
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?
Solved! Go to Solution.
01-27-2019 10:42 AM
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.
01-27-2019 07:21 PM
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?
01-27-2019 07:49 PM
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.
01-27-2019 09:00 PM
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.
01-27-2019 09:48 PM
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.
01-28-2019 02:49 AM
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
01-28-2019 10:32 AM
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.
01-28-2019 11:56 AM
But his problem is that he can't find the actual typedef. So he can't browse to it.
01-28-2019 12:35 PM
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.