LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plotting XY graph

Hi guys,

I've been assigned to a school project that supposingly I have to do data logging.

This project is to log down the data into a Current against Time graph every few intervals form a solar panel.
I'm very very new to labview and I have lots of question and problems that i cant find specific help online.

Basically, I want to transfer data of Current against Time in a XY graph from an excel file

but the problem is

 

1. I have difficulties with arranging the X and Y coordinates

 

2. I am only able to read the excel file after saving as a txt file, but i want it in excel format

 

3. I cant get the time format in labview from excel file.

 

I've attached what i've done so please guide me along.
The excel file is just a sample reading for me to work on
Thanks in advance!

0 Kudos
Message 1 of 23
(2,949 Views)

Your files did not make it. Please reattach.

 

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 23
(2,938 Views)

wrt to the excel file. You could use a csv (its a comma delimited file) then use read/write spreadsheet vis. This is then viewable in excel and easy to manipulate in labview. You dont get the excel formating though but this isnt normally a problem. working with proper xls files is more problematic.

 

hope it helps

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 23
(2,936 Views)

Oh, sorry i didnt notice. here are the files.

 

Hi akiel, i used to use delimited text file but i dont really understand how it works since its opened in a notepad.

0 Kudos
Message 4 of 23
(2,923 Views)

you can either open excel then file->open -> change the filter to csv then open your file or right click on your file, select properties and change the opens with to excel.if you have the delimiter right it should open in excel as a spreadsheet where it should make a bit more sense. In notepad you should see you data with a comma between each item. 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 5 of 23
(2,920 Views)

Alright thanks, that much i can do,

 

but how do I plot the graph?

 

Why can't I get the correct coordinates on the x and y axis.

 

also I cant get the time format right.

0 Kudos
Message 6 of 23
(2,881 Views)

Hi Patrick,

 

  1. I guess you'll need to check your text file. There are some using MM/DD/YYYY and MM/DD/YY. So you might want to use one format only (not mixed).
  2. Since your first 2 rows are headers so you might need to read the rows after that. Maybe you'll need to use the Array Subset function to read the data other than the headers.
  3. Since your data is in string, you might want to convert each elements of your date/time to time stamp (ref link: http://digital.ni.com/public.nsf/allkb/95D386A68269A53A86257082001DAED0). You can use Scan from String function and unbundle by name for this approach
  4. Since you split each elements to convert their string format to the appropriate format, I used a for loop for this case. 
  5. To plot the XY graph, I used bundle instead of Build XY graph express vi.

 

I have attached the modified file. Perhaps you can modify the rest from here?

 

Hope it helps

 

Warmest regards,

Lennard.C

Learning new things everyday...
0 Kudos
Message 7 of 23
(2,858 Views)

Thanks lennard,

 

I greatly appreciate your help, but just so happen that I'm using labview 2011 and I cannot open your attachment.

 

would you mind saving it in a format whereby im able to open it?

 

 

0 Kudos
Message 8 of 23
(2,825 Views)

Hi Patrick, 

 

Sure thing. Please find the attached file in this reply and use the .txt file which I have attached in my previous reply.

 

 

 

Warmest regards,

Lennard C

Learning new things everyday...
0 Kudos
Message 9 of 23
(2,811 Views)

Oh, it works great! thanks a lot!

 

now just a tiny problem that is, i attached a notepad because i couldnt attach an excel file

 

so i guess there's a bit of misunderstanding, my apologies for that, 

 

how do i modify the program so that i can display the data from an excel file?

0 Kudos
Message 10 of 23
(2,805 Views)