Discussion:
Type Definitions
(too old to reply)
BME genuis
2008-08-13 14:10:12 UTC
Permalink
I have a type definition called System Configuration Cluster.ctl.  This type def is used by a Global Systems Configuration VI.  Then this VI is called in my main VI.  The VI is used to establish values like my DAQ Scan Rate and file paths to write to.  Now, what is the purpose of type definitions?  Where do you input the value you want...in the type def or in the global VI?  In other words is the main VI reading the settings directly from the global VI or indirectly from the type def?  I ask because the type def cluster on my global VI front panel has different settings than when I look type def.ctl by itself.  Also, why do neither of these have block diagrams?
MikeS81
2008-08-13 19:10:13 UTC
Permalink
Hi BME genuis,the type def is to define a structure. If you often use this structure in your code you can make a typedef of it. If you want to change the typedef, add a new control or remove some controls, make it in the typedef and all other places where you use this strucutre will automatically be updated. You don&acute;t need a blockdiagram for it, because there is no logic in it, you only define the &quot;type&quot; :smileywink:. See also this link for more information <a href="http://http://digital.ni.com/public.nsf/allkb/453C79FC3BFABAF28625653F00789312" target="_blank">http://http://digital.ni.com/public.nsf/allkb/453C79FC3BFABAF28625653F00789312.</a> &nbsp;If you use global variables, i recommend to not use them, but if you do, you can insert your values there. If your read the global in your main vi, then you should get the values from the global. You don&acute;t need a blockdiagram in a global because it only stores the values. If you use typedefs, i recommend to not insert the values in a constant of the typedef, because if you update your strucutre you can lose your valuse.&nbsp;Hope it helps.Mike&nbsp;Message Edited by MikeS81 on 08-13-2008 09:05 PM
Loading...