LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform Chart

Hello,

I am using labview7.0 and need to know how to display and update current time and date on x-axis of  waveform chart and waveform graph.

 

 

Please reply 

 

 

Thanks,

Ratna

0 Kudos
Message 1 of 6
(3,097 Views)

Hi

 

In waveform chart or graph to select the x-scale as a time stamp, select the graph or chart property. Select the display format and according to your requirement select relative time or absolute time settings.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 6
(3,092 Views)

hi

Thanks for the reply, but i did all those changes in waveform chart and graph. The problem is it is not showing current date and time. Its displaying time as 5:30 and date as 01/01/04.

 

Kindly tell me how can i start chart x-axis with current time and date and update it after every 1 sec.

 

 

Thanks,

Ratna

0 Kudos
Message 3 of 6
(3,061 Views)

It appears you are not setting the timestamps of the data you send to the chart (we would need your code to know for sure).  The easiest way to set a timestamp on data is to use the waveform datatype and set the timestamp in the datatype before writing to the chart/graph.  You can certainly use single point waveforms.

 

Give it a try.  If you still have problems, post your attempt so we can help correct the problem.

0 Kudos
Message 4 of 6
(3,045 Views)

Hi,

 

I have attached the code for x-axis timestamp. I tried many options but still facing the same problem of wrong timestamp on x-axis. My requirement is to start accumulating values of all plots as soon as the vi gets executed, so the

x-axis timestamp also should get accumulated from the start.

 

Please help me to solve this problem as its very important for further development.

 

 

Thanks,

Ratna 

 

 

 

 

0 Kudos
Message 5 of 6
(3,007 Views)

You have two major issues with your code:

 

  1. You need to associate the timestamp with the data, not the graph.  The graph can autoscale its X-axis if the data properly contains X information.  It cannot put data at an x-axis place other than where you tell it to.  You are not telling it anything (you have no x-axis information).  There are three primary ways of supplying x-axis information for LabVIEW data.  The first is to use the waveform datatype and make sure the timestamp and increment are properly filled out.  The second is to use a cluster composed of X0, dX, and a data array for your data (this is very similar to the waveform datatype).  The final way (which may work best for you) is to create a cluster containing the X data (timestamp, but not timestamp datatype) and Y data (value) for each data point.  You will need to use an XY graph for this to work.  Please read the documentation on LabVIEW graphs for details of these methods and look at the included examples.
  2.  You are using front panel controls to hold data.  In LabVIEW, data is held in the wires connecting nodes together.  Using front panel controls as data repositories and local variables to fetch that data will result in code which is slow, a memory hog, and prone to race conditions (a difficult to debug program error).  For example, in the timeout case of your event structure, at the top, you write the current timestamp to Current time, and right next to it, you use a local variable to fetch the data.  A wire would have worked much better, since this has a race condition.  There is no guarantee that the data will be written to the Current time indicator before it is read by the local variable, so you could get inconsistent results.  If there is no data flow reason for events to occur in a certain order, their order will be determined by the compiler or operating system in an indeterminate manner.

So learn about the different types of data that a graph can accept.  Learn about using wires instead of front panel controls.  Use shift registers to cache data in loops.

 

Good luck!  Keep us posted on your progress.

0 Kudos
Message 6 of 6
(2,998 Views)