LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot datetime against temperature in waveform chart

Hi Everyone.

 

At first I want to apologize for my English.

 

I read temperature from my sensor network at a certain time and I want to make separate plot for each temperature sensor in waveform chart.

 I did it but I did it wrong: Chart updates from right to left side and x axis is flipped. I don’t know what I’m doing wrong.

 

Also I'm saving date, time and temperature to file, all in string data type, should I use XY Graph?

 

Also I want to ask about Update modes. I need to look at the history of measured temperature while I’m reading new values (temperatures), but when I move the chart display with hand tool from Graph Palette and chart updates, display jumps at the beginning.

 

I will appreciate any help

 

I’m using LabVIEW2010, picture of a code is attached.

Download All
0 Kudos
Message 1 of 14
(10,510 Views)

Hi Tukan,  

 

If you want to continuosly update the display in code the best option is to use a chart over a graph.  When using an XY or Waveform Graph you will need to collect all of your data at once, build the array or dynamic data and then pass it to the graph.  Where as the chart can keep reading and appending data.  Check out this KB for some more information on Charts vs. Graphs: 

 

http://digital.ni.com/public.nsf/allkb/95FEE9F5B252507E862562BA00007657

 

Update modes only apply to charts and can be explained in detail by visiting this link:

 

http://digital.ni.com/public.nsf/allkb/29353B4D8E4CC95C86256B9F007D1AD2 

 

And finally, since you are sending the chart both data and a time stamp you might want to pull the waveform chart inside of the for loop so that it can update each iteration. This might be the cause of your displayed data being

backwards.  Refer to the two for loops in the first KB I linked.

 

Kyle   

Regional Account Manager
NI
0 Kudos
Message 2 of 14
(10,456 Views)

Hi Kyle.

 

I'm not sure if I understood this:


 

If you want to continuosly update the display in code the best option is to use a chart over a graph.

 


 

" could you say more?

 

 

I have read the articles you posted but I don't know explain my problem because of my English so I have made simple VI, maybe you'll see what I need to do.

 

Anyway thanks for the reply.

 

Tukan

0 Kudos
Message 3 of 14
(10,441 Views)

Hi Tukan, 

 

No problem,  what I was saying was if you are continously adding points to the end of the graph you should use a Chart.  If you are collecting all of your points before sending them to the display then you should use a graph.  

 

Did this make sense?

 

Kyle

Regional Account Manager
NI
0 Kudos
Message 4 of 14
(10,415 Views)

Hi Kyle,

 

Ok then, I thought you mean overlay Graph by Chart Smiley Happy


I already use the chart just because of the continuous addition of new values but what I need is to have on X axis time when I measure temperature. I acquire temperature from various thermometers value by value in for loop (auto-indexing is enabled) using subVI, then I'm trying to plot these values in separate plots (according to various thermometers) in Chart. I also save these values as strings to file. But I don't know what to do with that time. I have tried to have it on x axis in many ways but always with bad result.

0 Kudos
Message 5 of 14
(10,408 Views)

Look at the properties of the chart for the X-Axis. You should set the offset to the current time (in secs) and the multiplier (in seconds per plot) properly. Change the the time axis to either Absolute or Relative time.

0 Kudos
Message 6 of 14
(10,395 Views)

Are you sampling these temperatures at the same rate?  If not then you won't be able to easily plot them across the same time axis.

 

Kyle

Regional Account Manager
NI
0 Kudos
Message 7 of 14
(10,385 Views)

 


@Joseph Loo wrote:

Look at the properties of the chart for the X-Axis. You should set the offset to the current time (in secs) and the multiplier (in seconds per plot) properly. Change the the time axis to either Absolute or Relative time


 

I have tried it, but time is shifted for an hour forward, don't know why, it's almost similar with example (real-time chart.vi) I found in NI examples.

 

See attachment below

0 Kudos
Message 8 of 14
(10,341 Views)

 


@K Smith wrote:

Are you sampling these temperatures at the same rate?  If not then you won't be able to easily plot them across the same time axis.


Now I know that I don't have to have exact time when I measure temperature, it's enough to have current time in format HH:MM:SS when I receive temperature from the sensor to labview in for loop.

 

 

acquiring time.png

Something like this, first or second way, but I'm not sure if it is good way to acquire time.

0 Kudos
Message 9 of 14
(10,340 Views)

 


@Tukan wrote:

 


@Joseph Loo wrote:

Look at the properties of the chart for the X-Axis. You should set the offset to the current time (in secs) and the multiplier (in seconds per plot) properly. Change the the time axis to either Absolute or Relative time


 

I have tried it, but time is shifted for an hour forward, don't know why, it's almost similar with example (real-time chart.vi) I found in NI examples.

 

See attachment below


 

Try extending the Chart History Length by right clicking the chart and selecting "Chart History Length."  By default the chart is set to 1024 points to display then the chart shifts, try extending this to the point where you can see your entire sample.  Then set the leftmost to 0secs.  

 

Kyle

Regional Account Manager
NI
0 Kudos
Message 10 of 14
(10,318 Views)