06-28-2011 04:16 PM
Why does LabVIEW not have a "variant constant" on the Functions Palette? The easiest way I have found to create one is to
1. Drop a Convert To Variant function onto the block diagram
2. Create a variant constant off of the Convert To Variant input terminal
3. Delete the Convert To Variant function
OR
1. Create a variant control
2. Go to the block diagram and select Change to Constant
Just seems odd to me.
Craig
06-28-2011 04:29 PM
@craige wrote:
Why does LabVIEW not have a "variant constant" on the Functions Palette? The easiest way I have found to create one is to
1. Drop a Convert To Variant function onto the block diagram
2. Create a variant constant off of the Convert To Variant input terminal
3. Delete the Convert To Variant function
OR
1. Create a variant control
2. Go to the block diagram and select Change to Constant
Just seems odd to me.
Craig
OR
select a varaint control Drag to the BD Drop ( dropping any selected control on the BD creates a constant of that type- useful for Type Defs)
Sounds like a good proposal for the Idea Exchange
06-28-2011 04:41 PM
The input of the To Variant function is actually a cluster of 0 zero elements, you need to create a constant off of the output.
At one point I felt like it was an ommission, but I don't really know when I would use it in place of create constant. What uses for the constant do you have in mind? 9 times out of 10 I am using the constant to initialize a shift register, and I am only using the variant for its attributes. Very easy to right click the SR and create constant.
You should see this idea: