LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to import a csv file into a histogram

Solved!
Go to solution
Hi, I am looking for a way to be able to import data from a csv file into LabVIEW 8.6 have it create a histogram graph. I have seen this done before, so I know it is possible, I just need some resources are vi's to get me started in the right direction. I have thousands of entries, and it gets teadious importing them vi QI macros. Does anyone know of a vi, or toolbox that will give me the building blocks to do this. Appreciate any help, Thanks, AJ
0 Kudos
Message 1 of 6
(4,563 Views)

It is always helpful to provide some information when you ask a question.  If you don't have any code to post, at least tell us which version of LabVIEW you are using.  LabVIEW has a function in the File Palette whose name changed in LabVIEW 2015, but it has a name similar to "Read from Spreadsheet File".  This means "Read from a Something-delimited File" -- in some versions of LabVIEW, it means "comma-delimited", in others it is (by default) "tab-delimited", and you need to set the delimiter to a comma, etc.

 

There have been numerous examples of using these functions in this Forum.

 

Bob Schor

0 Kudos
Message 2 of 6
(4,539 Views)
Solution
Accepted by topic author AlphaDog73

Bob,  The OP clearly stated LabVIEW 8.6.

 

AlphaDog,

Do you have a shortened exaple of you data file?  Are there multiple channels or just one?

Regardless, if you look in the Mathematics->Probability & Statistics palette, you will find a Histogram.vi that will take an array of data and make a histogram out of it.  To display it, use a graph and change the plot type to be a bar chart.


GCentral
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
Message 3 of 6
(4,515 Views)

Good point, Crossrulz -- guess I'm just getting "punchy" from seeing so many "how do I do ..." questions when the answers are right there in the LabVIEW Palettes and Help.

 

BS

0 Kudos
Message 4 of 6
(4,479 Views)

Thanks Crossrulz,

 

 

The code is basically in a sequence (no state machine here).  There are multiple channels being measured, just one at a time.

Measurements include:

Boolean (T/F)

String (Serial Number, Part Number,etc)

Numrical (DBL)  (Voltage, Current,Resistance)

 

 

I have attached a typical csv file we use.

The goal is being able to import these values into histrograms, with upper and lower limits.

 

 

See attached,

 

Once again I appreciate all the help you guys can give me.

 

See attached,

 

AJ

0 Kudos
Message 5 of 6
(4,423 Views)

@AlphaDog73 wrote:

 

 

The code is basically in a sequence (no state machine here).  There are multiple channels being measured, just one at a time.

Measurements include:

Boolean (T/F)

Do you really want a histogram of Booleans?

String (Serial Number, Part Number,etc)

Do you really want a histogram of Strings?

Numrical (DBL)  (Voltage, Current,Resistance)

Unclear which data in Worksheet were Voltage, Current, Resistance

 

 

I have attached a typical csv file we use.

No, you attached an Excel (.xlsx) file.

The goal is being able to import these values into histrograms, with upper and lower limits.

 What values?  There is a single row of data strung out across >100 columns, with what may be multiple measurements.

 

 


Do you have any code of your own to show us?  Are you expecting us to write the code for you?

 

Bob Schor

0 Kudos
Message 6 of 6
(4,410 Views)