LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To plot the histogram from arrays

I have a Labview program which runs 'N' times. For each run it gives an array "Time". This is running inside a while loop and can be stopped mannualy when I finish the experiment. I want to plot the histogram of "Time" while running. I tried to connect the "Time" to the 'x' input of the general histogram in the Labview, but it was showing error. The error says the "source is an array of some elements and sink is double". How can I fix it? Or please tell me how can I plot the histogram it the data is in the form of arrays. 

0 Kudos
Message 1 of 9
(8,133 Views)

Please attach your code (make sure it contains some typical default data).

0 Kudos
Message 2 of 9
(8,121 Views)

The files are attacted here... the first one "RAE.vi" is my original program. It has some drives which may not be shown when open in any other computer because these are the drives of specific cards I use (CAEN cards). In this, you can see a "Time" array. This is the array which I want to input to a histrogram and display while running.

 

I have attached another file "Read". The "Read" may be replaced with the missing drive. This creates random data, which can imitate the drive.

 

 

Download All
0 Kudos
Message 3 of 9
(8,104 Views)

I have attached the files in the reply... Thank you...

0 Kudos
Message 4 of 9
(8,103 Views)

Hi aneps,

 

did you ever had a look at the Mathematics->Probability function palette? There are ready-to-use functions which provide histograms:

RAE.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(8,081 Views)

@aneps wrote:

The files are attacted here... the first one "RAE.vi" is my original program. It has some drives which may not be shown when open in any other computer because these are the drives of specific cards I use (CAEN cards). In this, you can see a "Time" array. This is the array which I want to input to a histrogram and display while running.


What is the typical range of times in the array? If it is just 0..10 as in your example, all you need a very simple code. No histogram subVI needed.

 

0 Kudos
Message 6 of 9
(8,072 Views)

Hi

 

I have a question regarding obtianing histogram.

I have X-Y data which is repeated for say 200 times. So for each X value there are 200 Y values. I would like to plot histogram of Y values for a particular X. It would be great if some of you could help.

 

Thanks

Suchand

0 Kudos
Message 7 of 9
(7,586 Views)

Hi Suchand,

 

We have documentation on the National Instruments website that can help you with creating your histogram. Here are links to some of those resources-

 

Histogram VI Help Page -  http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/histogram_discrete/

Using the Create Histogram Express VI - http://digital.ni.com/public.nsf/allkb/248CD14CD6C53D7986256D190058FD32

 

There are also some examples in LabVIEW that you could explore. You can reach the Statistics Examples by opening LabVIEW, opening the help tab, and selecting “Find Examples…”. Then, with “Task” selected under the “Browse according to:”, open the folders Analysis, Signal Processing and Mathematics>>Probability and Statistics”.

These should help you getting started with creating histograms in LabVIEW.

 

Regards,

Eric H.

Eric H.
Senior Applications Engineer - Product Analytics
Emerson T&M (NI)
0 Kudos
Message 8 of 9
(7,557 Views)

Dear Erich

Thanks. I have already made it by finding out the index of array elements and creating histogram for each element.

 

suchand

0 Kudos
Message 9 of 9
(7,525 Views)