LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop a cluster constant typedef from resizing when the typedef is changed?

Using LabVIEW 7.1...
 
I've been using cluster typedefs to make make constants on the block diagram.  I usually resize them so they are nearly the size of a few characters.  When the typedef is updated the constant expands to full size.  Usually I can just resize it again but if the constant is inside a structure things get rather messy.  To stop the structures from resizing I've been leaving the constants outside of them.  Is there any way to stop the resizing?  I've ensured that autosize is set to None for both the typedef and the constant on the block diagram.
 
0 Kudos
Message 1 of 13
(4,238 Views)
Simply put, No. You can't not stop the resizing. One option you have is to use a hidden front panel control instead of the constant.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 13
(4,224 Views)
Mike is correct here. Just thought I'd put in a link to this previous discussion that's similar to this topic. It involves having global constants, which isn't what you're exactly talking about, but has some tips and techniques that could benefit you anyway.
Jarrod S.
National Instruments
Message 3 of 13
(4,217 Views)
Basically, the safest way is using a subVI with the typedef as an output, as mentioned in the previously linked thread, but this is annoying because you have to manage an extra VI for each typedef. It would have been nice if we could set typedef'ed constants to appear as icons, but that would create some ambiguity about whether you changed any values in the constant (which you shouldn't, because updating the typedef could revert the values to their default).

___________________
Try to take over the world!
Message 4 of 13
(4,211 Views)
I became acustomed to sizing them very small since this technique was done in the programs I edited while learning LabVIEW. 
 
It initially frustrated me because I had no idea what these "little pink boxes" were if IIRC the help dialog says "no information," not something useful like "constant."
 
I'll read through the past discussion, thanks all.
 
David
 
0 Kudos
Message 5 of 13
(4,190 Views)

Hi David,

I have to second tst suggestion and I wrote on this subject in one of my nuggets.

This behaviour is even more dire if you have "auto-grow" (auto-explode) enabled on the structures.

This occurs because LV actually goes through all of the code and removes the old and inserts the new difinitio.

I believe this is how NI's internal developers handle this situation.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 13
(4,171 Views)

I found the NI example that makes tst point.

In the "Palette API" (that was developed by an NI Developer and recently posted to the LV Zone) shows how sub-VI's can be used to fix the "auto-explode" diagram issue.

See image below.

BTW: It also lets you document the data through the documention of the sub-VI.

Ben

Message Edited by Ben on 06-13-2007 03:12 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 13
(4,157 Views)
Hello,

I am using LabVIEW 8.5 and there still is a problem with the TypeDefs resizing but not as much as in LV 7.1. I use a Strict TypeDef in my Queue Based State Machine architecture. This Strict TypeDef is a Cluster containing an Strick TypeDef Enumerated Command and a Variant that can contain any type of data and if needed, converted to a value that can be used for the specified command.  So all I have in the control is 2 items. In the Strick TypeDef, I set the cluster resize option to "None". When I put the control on the block diagram, the resize option is switched to "Size to Fit". But the fun doesn't stop there, whenever I change the Strict TypeDef Enumerated Command and save it, it updates my Strick TypeDef Cluster all over the place. Not too good if I have numerous command steps. If I set each of the TyepDef clusters resize option to "None" then the clusters do not resize but the command shifts to the right and the variant to the left. Sometimes I cannot read the command. So, NI, any plans to improve LV and its interaction with Strick TypeDef Clusters?

Thanks,

Michael Froehlich
 



0 Kudos
Message 8 of 13
(3,876 Views)

I did have the same problem in the past and never found a good solution. At this time I am updating a cluster typedef I use at many places with contants and this goes horribly wrong....

 

Using the 'typedef-vi' concept I can solve multiple problems at once:

- The resize

- Constant definition

- Better diagram for large clusters

 

I can even inlude 'GLI' like features in the vi. I think the attached image speaks for itself

 

---

25+ years long fan of LabVIEW. Be aware that NI changed their business model with great impact .
0 Kudos
Message 9 of 13
(3,791 Views)

I have come to the conclusion that I just bundle my own clusters together as needed without the vi to do the bundling. The cluster contains a command and a variant. The variant can be anything or nothing so I could use about 5 or so different VIs to do the work or I just bundle as I go. I used the later so that I do not have to even have 1 sizing problem.

 

Michael

0 Kudos
Message 10 of 13
(3,751 Views)