LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert cluster to string

I have a cluster of:

3 Strings

a Timestamp

7 Doubles

a Boolean

2 Numerics

a Numeric array of 4 elements

a String

 

How would I convert these into a human readable string output?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 1 of 10
(5,909 Views)

Dear Paul,

Unbundle your cluster and use "Format into String" with "%d" as format string for numerics.

For boolean, first change them into "1 and 0" representaion and then use the above function as it is.
For the numeric array, use the same function but inside a For Loop so it indexes through each element and converts them. 

Regards. 


Message 2 of 10
(5,898 Views)

You may try something like this.

 

Cluster-String.png

 

I have shown only for Boolean type. You can expand this according to the data type and convert it to string seperately. Finally you can feed the array to a table.

-----

The best solution is the one you find it by yourself
Message 3 of 10
(5,882 Views)

Thanks P@Anand

 

Have you got the Vi the drag and drop isnt working?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 4 of 10
(5,871 Views)

This is a snippet and you should be able to pull it into a Block diagram if you have LV2013

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 10
(5,861 Views)

Hi PauldePaor,

I'd go for a generic subvi that you can reuse for any type of cluster. You'll have to make a case for each control you are using, just use the 'All Class ID's' array to see the ID numbers you have right now. Once you are done you can recycle the subvi for all sorts of neat property controls etc. For example, I use it to make all items in a any cluster a certain color.

 

Just use the reference as the subvi`s input, and the array of strings as output. Wire any cluster's reference to the input, and out comes the result.

 

Hope this helps.

manipulate cluster.jpg

0 Kudos
Message 6 of 10
(5,857 Views)

Wow, this is actively replied to; P@Anand beat me to it by far!

0 Kudos
Message 7 of 10
(5,850 Views)

When I drag the Vi Snippet it just drops the link to the forum

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 8 of 10
(5,837 Views)

Save the image and then pull the image to your BD.

 

Also you may use the snippet attached.

-----

The best solution is the one you find it by yourself
Message 9 of 10
(5,829 Views)

Hi all, there are open G VIs that could help you with this.

 

GetClusterValue.png

0 Kudos
Message 10 of 10
(3,273 Views)