LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to plot the graph

Hi, I am a beginner in Labview. In my exercise, I want to display the 1D data I got from excel in the waveform graph in Labview but it does not appear. Here is my what I have done so far. I have data in excel which has 16 rows and 2 column. I have used path function and also read spreadsheet function to display my table in labview and it works. In My labview front panel displaying now, I have 16 rows and 2 column of data. I want to analyse the 2nd column only so I use array subset function to extract the 2nd column. When I run my labview, the size of my array is now 16x1. I want to display this as a waveform graph so I choose 1D waveform graph. When I run it, the graph doesn't show anything. Please give me advice for this.

Regards
ade
0 Kudos
Message 1 of 9
(2,879 Views)

I don't know where you are encountering the problem with this so far? Would it be possible for you to post your code or an image of it so that we can get a better idea of what is going on. From what you have said so far there seems to be no reason that your graph would not be working. See image below for the simplest possible method of outputting to a graph.

 

Example.JPG

0 Kudos
Message 2 of 9
(2,859 Views)

how are you reading the excel file? Try using activex if u are not. You cannot use read spreadsheet.

0 Kudos
Message 3 of 9
(2,850 Views)
0 Kudos
Message 4 of 9
(2,833 Views)

See if this is what u want

0 Kudos
Message 5 of 9
(2,821 Views)

Thank you for your reply. I really appreciate it. In my previous diagram, instead of using the waveform chart (as shown in your figure), i use waveform graph. I tried to use the  chart  and it work but it keeps repeating the graph. How to stop it so i can only get 1 period of graph?. Because of the continuously repetition of the graph, i change my indicator back to waveform graph indicator but it doesnt show any plot. Here i attach my block diagram.

 

Again, thanks very much for your willing to help

 

Regards

Ade

 

Block diagram.jpg

 

and here is my fron nt panel        

 

                                  

Front panel.jpg

0 Kudos
Message 6 of 9
(2,801 Views)

How are you running this program? From the look of it you should just be running the program once when you hit the run button as you do not have a while loop or anything surrounding the program This means that you should not get a repeating diagram from the waveform chart as it should only be updated once. If you are using the Run Continuosly Button (The looping arrows) to run your program, try running it simply from the single arrow. This should mean that the entire program will run through once generating only a single version of the points on the chart. If you have multiple waveforms that are being recorded in the file and only want to view a certain range of the chart, right-click on the chart and go X-Scale -> Properties and then adjust the X-Scale to fit your desired period. There are programmatic ways of doing this but for now we'll stick with this way.


From what you say about only wanting to see a single image of the information contained within the chart this seems like it should be exactly what you want. If you wish to persist in using the waveform graph then you will need to add in a time scale to the graph through using the generate waveform controller.

Example.JPG

0 Kudos
Message 7 of 9
(2,784 Views)

Hi,

thank you very much for your reply.

 

Previously, i change my excel data to CSV file before i applied it to the labview. Now,  I am planning to change my simulation from using 'read from spreadsheet" to use the activex as shown in your VI . Im still in the very basic stage of understanding what is activex, how activex and labview works together, how to display the data in the labview table (previously in the array indicator), and also how to analyse/process the data so i will need more intensive time to learn. However, in your VI, i cannot run it because there is a mismatch particularly in Variant to data Function as shown in pict below

 

The thing that still make me curious until now is why i cannot plot my array of data in waveform graph. When i plot it in Chart, the plot is appear but in the  graph, there is no plot. . i try to track by mark the point that might be plotted but it shows only in point 0,0. If you dont mind, can you look at my work in my attachment?. I will attach my VI, and also the data in csv format. Thanks before

 

Regards,

Ade

 

 

Error in Reading from excel

Download All
0 Kudos
Message 8 of 9
(2,750 Views)

Hello Adepeter, 

 

I am sending you an example that can help you write a table in Excel. You can also find more examples like this one regarding ActiveX  in LabVIEW.  Just go to help menu, then click find examples. Then in the browse tab, you open the "Communicating with External Applications" folder, then "ActiveX", then Excel. 

 

Here you will find the example attached and many more. 

 

Regards.

 

Ernesto

AE Engineer

National Instruments

0 Kudos
Message 9 of 9
(2,712 Views)