LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from textfile and graph

Solved!
Go to solution
Hello Everyone. I am new to Labview and have started using it only one week ago. My advisor has assigned me a difficult project and I am stuck. My goal is to retrieve data from a Keithley instrument by setting the Voltage and measuring the current. I was able to find a driver to do so but now he wants me to take my measurments and make a different graph from the one that is already in the driver. The graph I get is for X vs Y which has voltage on the horizonal axis and current on the vertical. After I get this information, it is then saved into a .txt file. What my advisor wants me to do is take the values that are saved and divide them, (V/I) which equals the resistance and then plot the resistance as a function of the voltage. Since I am very new to Labview, I am having difficulty in reading the values from the  text file, calculating the resistance and plotting the result. To add to my troubles, the computers I am using only have up to Labview 7.0 Express. If anyone can please help me, it will be greatly appreciated because I would rather graph the values by using Labview instead of using Microsoft Excel. Thank You.
0 Kudos
Message 1 of 4
(2,796 Views)

The problem seems pretty simple and would not be any different in a later version of LabVIEW. It would help if you had posted an example of the file. If it's a tab or comma separated text file, you can use the Read From Spreadsheet File. Then it's a matter of getting the columns. That's where the Index Array function is used. Then you just have divide one by the other. Look at the image and modify as needed. this assumes that voltage is in the first column. You could also plot the resistance as the data is acquired instead of post processing from a file.

 

Plot Voltage versus Current.PNG

 

 

Message 2 of 4
(2,793 Views)
Thank you Dennis. Your example is working. Sorry for not attaching the .txt file in my last response but I am attaching it now. One question I have is that when I am graphing from this .txt file, I get two lines. One red and one white. Do you know which line I should be using? Thank you again for your help as I really appreciate it. I do not think I could have figured this out for another couple of days at least. I will post here again if I have a problem with this program. Thanks Again.
0 Kudos
Message 3 of 4
(2,781 Views)
Solution
Accepted by topic author Darkjib
Sorry, misunderstood how you wanted to display the data. The first array appears to be voltage and the array that is the output from the divide is the resistance. Instead of the build array and a waveform graph, you'll want to use the bundle function where the top input is your x axis and the bottom input is the y axis and sire the output of this to an XY Graph.
0 Kudos
Message 4 of 4
(2,778 Views)