06-11-2015 05:30 PM
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]
I'd be grateful for any help!
Best regards,
Pete
06-11-2015 06:39 PM
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.
06-11-2015 10:28 PM
06-12-2015 08:07 AM
@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]
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
06-15-2015 03:36 PM
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?
06-15-2015 04:24 PM
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
06-15-2015 04:26 PM
06-15-2015 04:39 PM
Maybe not any, but arrays, doubles, integers, strings, etc.. I want to create XML file later.
06-15-2015 04:49 PM
06-16-2015 05:51 AM
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...