09-29-2010 07:57 AM
If I convert a cluster into a variant and then view the variant on the front panel it provides a good summary of the contents of that cluster in a string format.
Is there any way I can obtain the front panel display string so I can use it in the Labview program?
This would be very useful for a situation where I have a variety of clusters and want to be able to convert the data into string format so I can dislpay it on an Excel chart.
09-29-2010
08:13 AM
- last edited on
09-17-2025
03:14 PM
by
Content Cleaner
I did find this: http://digital.ni.com/public.nsf/allkb/F6844F4999ED2BB1862576C00050360E
It suggested "Flatten to XML", which is now under "programming, string, xml"
I've had a look and that's sort of what I want to do. It would still be interesting to see if there's a way of accessing the front panel variant string.
09-29-2010 08:38 AM
[quote]
Create a VI that takes in a variant, and gets a
list of all data types contained within the variant. Use a case
structure to handle how to parse the data for every datatype that the
variant can possibly contain. Use the Variant to Data VI and Fomat into
String VI to convert the data from the source type to string.[/quote]
Any idea how I get a list of all data types within a variant?
09-29-2010 10:21 AM
There are a few VIs in the vi.lib\Utility\VariantDataType folder that you can use. These do not show up on the palette, so you have to navigate to the folder to use them on the block diagram. For example, the "GetClusterInfo" will return an array of variants for each cluster element. You can drive a for-loop to get information about each cluster element, such as by using the "GetTypeInfo" VI inside the loop.
OpenG also has a set of VIs to work with variants. You can install the "OpenG LabVIEW Data Tools" library.