LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read text in variant input terminal on control pane

Hi all,
I've created a 3D array of double and I've sent it to sub vi to a variant terminal. How to read info that is displayed on the terminal? The message on the terminal that I want to read is:

 

'': 3D array of
'': double [64-bit real (~15 digit precision)]

[500x5x0]


variant.png

 

I'd be grateful for any help!

 

Best regards,

Pete

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

You could just use the Variant To Data with a 3D Array wired to the data type to get your array back.  Granted, at that point you might as well not have used the variant.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(4,821 Views)
You can't read that text that appears in the control directly, but you can reconstruct it. Why do you need the text?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 11
(4,795 Views)

@Piotr.Zawistowski wrote:

Hi all,
I've created a 3D array of double and I've sent it to sub vi to a variant terminal. How to read info that is displayed on the terminal? The message on the terminal that I want to read is:

 

'': 3D array of
'': double [64-bit real (~15 digit precision)]

[500x5x0]


variant.png

 

I'd be grateful for any help!

 

Best regards,

Pete


I don't know what you might expect from an array which have 0 column, it will never contain any value.

The VariantType.lvlib:GetArrayInfo.vi can also give you informations (number of dimensions, element data type).

To retrieve the original array use the Variant To Data function as specified by Crossrulz.

 

Ben64

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

Hi all,

 

thanks for replying. I just want to have generic terminal to which I can connect any type of data and, using this information from the terminal, change to proper type. I can easily get the information that this is a cluster but how about any information about dimensions and type of data...? Any clue?

0 Kudos
Message 5 of 11
(4,729 Views)

As I said, have a look at the vis inside the VariantType.lvlib. There is a vi called GetClusterInfo.vi

 

You can find this library at the following location:

C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\Utility\VariantDataType

 

Alternately you can download the "Hidden Gems in vi.lib" package from the JKI VI Package Manager.

 

Ben64

0 Kudos
Message 6 of 11
(4,715 Views)
When you say "any", do you really mean ANY datatype. If the expected data types are somewhat constrained, a polymorphic VI might be an easier way to get where you're going.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 11
(4,713 Views)

Maybe not any, but arrays, doubles, integers, strings, etc.. I want to create XML file later. 

0 Kudos
Message 8 of 11
(4,704 Views)
Well you can flatten a variant directly to XML.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 11
(4,694 Views)

But in the array case, I'd rather like to get dimensions and size of it, rather then log data to XML (for performance reasons). I thought it's easier if the information I need, is displayed on terminal...

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