LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster Typ-Def Constant Reset

Solved!
Go to solution

Hi all,

 

Ahhhhhh....  I have a typ-def cluster array with many elements in each cluster.  I created a vi, in which I delcared a 20 elements with specified values (a vi that contain constant values).  I made a minor change in my typ-def, and all the values that I keyed in got reset.  How do I avoid that in the future?  Thx!

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 5
(3,162 Views)
Solution
Accepted by topic author jyang72211

One thing you can do is create an "initialize" sub-VI for your typedef, which wires the default values you want (specified as constants on the subVI's block diagram) into the appropriate places.  The output of the subVI would be your typedef, containing the default values.

 

Did that make any sense?

 

Here's a picture...

 

constants wired to typedef.PNG

That's what your "initialize" subVI would contain.

Message Edited by DianeS on 03-15-2010 04:35 PM
Message 2 of 5
(3,158 Views)
Diane's suggestion is the only to solve your problem. Defaults values do not carry over from a typedef. The one thing you can do is save the defaults values you want in your typedef and recreate the constant. New constants created will pick up the current default values. However once you change the typedef all the constants you have will get reset.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 5
(3,148 Views)

See attachment for what I am doing. 

 

Diane's way will work fine.  I will just put it in my loop for all my elements in the array.  thanks!

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 5
(3,142 Views)
You don't need the loop. You can use the Initialize Array VI to do this.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 5 of 5
(3,131 Views)