How Can I Programmatically Obtain the Size of a Cluster?

Updated Oct 21, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I don't want to manually count the byte size of a cluster in LabVIEW. How can I programmatically obtain the size of a cluster?

Solution

The byte size of a cluster can be obtained programmatically by using the Flatten To String and String Length functions, as you can see in the following snippet. The resulting numeric value indicates the number of bytes the cluster occupies. Also, It is same way to know the byte size of other data types.
 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.