LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read from spreadsheet

Hi. Please take a look at the VI that I attached below. What I am doing is to retrieve 2 colums of values from my text file and feed it into the polar plot so that it can construct an ellipse. The first problem I am having now is that nothing happens when I start running the VI even when I had specify the text file for it to read on the block diagram. The second problem is that the polar plot does not reflect the plot colour that I have chosen. For example, if I chose red for the plot colour, it still plots in black. Can anyone please tell me what is wrong with my VI?

Thanks.

0 Kudos
Message 1 of 21
(949 Views)

We can't run your VI without the text file you are reading.

 

Why are you doing everything in a loop, especially reading the text file over and over and over?  And also doing it at the speed of light since you don't have any kind of wait function in the loop?

 

The picture in the polar plot shows a line in red as you have it saved.

 

You have an inner For loop that is only acting one time (N=1) on every iteration of the outer while loop.  Once your iteration value i gets to be larger than your array, it is going to just be showing missing data, AKA nothing. 

 

 

 

0 Kudos
Message 2 of 21
(940 Views)

Okay so the only problem I have now is to plot an ellipse using the values I retrieve from the Spreadsheet. So what must I do so that whenever the values are retrieve from the spreadsheet, it will be passed from the 2 arrays to the polar plot vi and it will plot the ellipse?

Download All
0 Kudos
Message 3 of 21
(935 Views)

Hi Fred,

 

didn't I tell you not to open duplicate posts on the same topic? Again you started a new thread. Come on...

 

Posts regarding the same matter can be found here and here!

 

Nevertheless you can try the attached VI...

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 21
(927 Views)

Hey, I am really sorry! I would try not to duplicate threads in future and also specify what I want from the begining. 🙂

0 Kudos
Message 5 of 21
(911 Views)

The test.vi that you provided work wonders! But that is only for 1 graylevel so what if I have 255 graylevels and there are 255 text files to be read? How do I create a loop so that the computer would keep reading the 255 text files and display 255 different ellipses on the polar plot one after another? Would it be possible for the computer to auto select the 255 text files? Or do I have to always specify where are the 255 text files?

0 Kudos
Message 6 of 21
(905 Views)

Hi Fred,

 

I think we already discussed how to list files in a folder and read all of them one after the other...

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 7 of 21
(901 Views)

I tried using the List Folder function to read the 2 text files that I currently have but when I run my VI, the List Folder does read the 2 text files in the folder that it is saved in and pass it to an array but the VI only reads the first text file and not the second text file.

Download All
0 Kudos
Message 8 of 21
(897 Views)

Hi Fred,

 

your FOR loop runs only once - guess why!

 

As it only runs once it will only process the first file in the filename array...

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 9 of 21
(895 Views)

Haha, it represent me! Because I am always not alert enough! Great to have people like you always helping out people like me! Thanks!

0 Kudos
Message 10 of 21
(893 Views)