LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Cluster

Solved!
Go to solution

Hello everyone. I have the following problem that needs solution. I need to create a Cluster with containing lets say 3 strings. From there i need to convert the data from the cluster to variant data and then display the data for all the strings in the following format StringName1_Value 1. I don't know if the whole point of this exercise is to extract the data from a specific string from the cluster or display them all at once. Its basically what my teacher gave me as a task. Check the attached image for better understanding.

0 Kudos
Message 1 of 11
(4,434 Views)

Wow.  That's a very challenging task.  Where are you studying?  Who is your teacher?  What is the name of the course (sounds like "Advanced LabVIEW Programming")?  I'd love to get a syllabus for this course ...

 

Bob Schor

0 Kudos
Message 2 of 11
(4,403 Views)

Why would you attach 4MB+ of a monochrome image that has maybe 10kB of information? (I am out in the swamps with only cellular service, so making me waste my data plan for basically nothing is not nice).

 

What is the purpose of the variant? Where does the "value" come from? How do the string contents get into the cluster?

 

I would start by looking at your course notes. I am sure it will bring you closer.

0 Kudos
Message 3 of 11
(4,383 Views)

Aha!  Altenbach suggests a Proverb I made up in college:  "Answer Analysis Reveals that the Question is Wrong".

 

Here's a suggestion for the Original Poster -- repost your "question" by typing (yourself, one letter at a time, no images!) the entire Assignment, including any problems that come first and could be considered "training" questions.  Also tell us (in broad strokes) the subject matter of the last 2-3 LabVIEW class presentations.  This would suggest to us what you are "supposed to know".

 

Bob Schor

0 Kudos
Message 4 of 11
(4,320 Views)

All good questions from Bob and Altenbach. It's a bit of a strange question so understanding why you need to do this will probably point towards what the best solution is. I could think up a reason why doing this might be helpful although there are much easier ways to display a cluster on the UI or get a particular value.

 

If you are using a newer version of LabVIEW you might find some useful tools under Programming > Cluster, Class, and Variant > Variant > Data Type Parsing although when we learn more about the problem we might find that they aren't very helpful for you.

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 11
(4,272 Views)

Basically i am trying to get data from a cluster variant. Type, name and values from the elements inside the cluster.

0 Kudos
Message 6 of 11
(4,245 Views)
Solution
Accepted by topic author Blaze888

http://zone.ni.com/reference/en-XX/help/371361N-01/lvhowto/parsing_with_vis/

 

get-data-from-variant.png

get-data-from-variant.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 7 of 11
(4,236 Views)

Thank you, i would also like to display the data from the array on the block diagram in the way it is shown on the example that i linked. That rectangle on the right how do i create it?ClusterValsFromVariant.png

0 Kudos
Message 8 of 11
(4,188 Views)

1) display on the block diagram:

i guess its a mistype and you meant front panel, otherwise that is not possible

 

2) have it look like "Array"

 

this is a friendly representation of variants, but so far i don't know a way to get a string from that, that looks exactly the same.

in short, you have to build this yourself, with the tools in the variant palette.

 

i noticed, that from 2014 to 2016 the vis in there have changed,

so it is not backportable, but the vis should have similar names i guess.

 

use the "Get Type Information" then you have names and types,

then cast each variant to its type and use "Format into String",

for Enums you might want "Get Numeric Information" to see what possible values (as String) it can be.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 9 of 11
(4,178 Views)

Thank you your solution worked out for me.

0 Kudos
Message 10 of 11
(4,152 Views)