LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variant data written to excel

Solved!
Go to solution

I have numbers (data) being calculated in a variant and I need this data to be writting into different columns into excel. Can anyone help?Thanks in advance

0 Kudos
Message 1 of 7
(3,136 Views)

Varient to data.jpg

 

You can use varient to data function available in Function Pallete--> Cluster --> Varient --> Varient to Data

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
Message 2 of 7
(3,034 Views)

We need more information.  

 

Is the file you are writing to an existing file or one you are making?

What is the file format (CSV, TSV, TXT, XLSX etc).

Why are you dealing with a variant and not the numeric it self?  Use the Variant to Data to get your number back out of a variant if you are using a variant.

What code have you tried? (post it)

Message 3 of 7
(3,078 Views)

It is CSV data. I tried using Variant to Data and using the type i would like the data to be displayed in, but its just giving an error.

0 Kudos
Message 4 of 7
(3,072 Views)

Here is a pic

0 Kudos
Message 5 of 7
(3,062 Views)
Solution
Accepted by topic author *E*

You aren't using those functions properly.  Read the help.  You are writing a name of an attribute but no data, the you are trying to write more attributes but no data, then you are saying to read the data of the variant as an array but you never wrote an array of numerics.

 

Variants have two components.  The data, and attributes.  The data can be anything, and you can have any number of attributes (like a look up table) where each attribute can be anything.  In the attached example I write an array of I32 numbers to the data, then write a string to the attribute.  Then I read the attribute string, and then I read the array data.  The data types must match.

Message 6 of 7
(3,055 Views)

Very good example. Thanks for your help!

0 Kudos
Message 7 of 7
(3,049 Views)