01-14-2010 10:57 AM
Solved! Go to Solution.
01-14-2010 11:04 AM
*.ctl (strict or not) are dedicated to define the type (i.e play with some properties) and not the values.
It's a waited fact that if you change value in a *.ctl all is instance are not updated.
01-14-2010 11:05 AM - edited 01-14-2010 11:08 AM
When you say you change what is in a string, do you mean you are writing to it somewhere, or going into the control editor and changing the value? If the later, are you doing a "make current values default" before saving? It is a selection in the tool bar under "Edit"
If it is the former, programmatically writing a value to one instance of a typedef, strict or not, won't have it propagate throughout the program. Typedefs, as the previous writer mentions, are just that type definitions, which define a data structure, not the data within. But, if you put values into it while editing, then make them the default values before saving, then those values should be the default values everywhere you use the control.
01-14-2010 11:13 AM
LV_Pro wrote:
When you say you change what is in a string, do you mean you are writing to it somewhere, or going into the control editor and changing the value? If the later, are you doing a "make current values default" before saving? It is a selection in the tool bar under "Edit"
That will affect newly droped instance but one already on the diagram.
As I wrote in my Type Def Nugget you can not count on that the default values to propgate to the block diagram instances and ever worse, if you edit those instances to put in values when the type-def is edited, you can loose those values when LV goes through and deltes the old version and replaces it with the new version. The method I use for values that will never change or will only change at edit time is to use a sub-VI as shown in this image from that Nugget
or... if the data can change at run time, I read it from file and pack it into the cluster/control.
Ben
01-14-2010 11:25 AM
01-14-2010 11:33 AM
Imagine a type def (strict or not) is a classical type as numeric for example.
You can use several numeric but you don't want that all numeric change if you change only one.
It's the same case for type def. Type def are only a mean to define a custom representation of data but not the content.
If you want propagate values between them, you must link them (control to indicator, to local variable, propoerty node, etc...)
01-14-2010 11:46 AM
What you are searching for is a method to get default values loaded into your type defs. There are many ways to do this. I'll guess that these two Nuggets may be a bit much but I'll share them in-case they give you some ideas that will work for you.
In My Nugget on Exploiting Control references I mentioned a number of ways of initializing data structures. I included some "out-there" code in that thread that demonstarates how to init from file and the inverse operation of writing it to file. THat example is based on an Action Engine design which alos may help you.
Just trying to help,
Ben