LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot array of time data against another array in XY graph

Respected Sir.
I have written and read data using text format. I want to plot an array of time data (i.e. a column array with time as the values) against another array of dbl data in an express graph. The issue is that the time is not the current time but some past time at which the data was written. Is that possible?
0 Kudos
Message 1 of 15
(4,088 Views)

yes, it is possible.

give time as x input and other data as y. in a graph.

Message 2 of 15
(4,082 Views)
Respected Sir/Madam

I tried doing that but the XY graph does not accepted string data and time is in the form of a string data. If you input a DBL array it gets converted to dynamic data and is given as an input. But time as a string array if it is converted to DBL array the data values are no longer in time format. So how do i go about it?

0 Kudos
Message 3 of 15
(4,050 Views)

In XY graph,

Go to XY graph prperties

In that select format and precision

In that select X-axis, and Absolute time.

Then select the type of time yyou want to select.

After that the X-axis will show the time.

 

Message 4 of 15
(4,045 Views)
Respected SIr/Madam

I want to plot an array of time values that are input from the user. That is, we have written the data in a text file. Now we read the data back and delete the time array from the written data. This time array is now to be plotted in the XY graph along with some data values. So it is not the system time but some time array at which the data was written. Is this possible?
0 Kudos
Message 5 of 15
(4,026 Views)

It won't take system time. XY graph is a bundle of two array. So, make the array of time and give that as one input  of that bundle. other will be your value. That properties is to show the value in time form. If you are not specifying the time then it will take system time. Otherwise it will show the time which is in the file.

I hope now u have got ur ans.

Ranjeeta

Message 6 of 15
(4,011 Views)
I'm a little confused. What time do you want to plot? The current system time, the time array that's part of the data file, or neither (you mention time values that are input from the user).

In any case, as mentioned above, you want to bundle the time stamp and the Y value together for each XY value pair giving you an array of clusters. Then, as also mentioned above, set the format of the X axis to "Absolute Time" or "Relative Time" depending on what you want.

Here's an example of plotting the current time against some Y values:


And the formatting of the X-axis:

and the result:


Message Edited by Bill@NGC on 09-26-2007 11:57 PM

Download All
0 Kudos
Message 7 of 15
(4,004 Views)
Thank you sir
the time i want to plot is a part of the data written in the text file.
First we have written the data in a text file. Then we have read the text file. We have deleted the time array from this written data and given the rest of the data (usualy in the form of sample values of a sine wave) to calculate some efficiency parameters. After that i want to plot the values of the efficiency against the time array from the text file
0 Kudos
Message 8 of 15
(3,995 Views)

Even umpteen times you ask the que, you ll get the same answer. Smiley Mad

The answer lies in Reply 6. Smiley Wink

Or, atleast try to follow Bill's diagrammatic explanation. Smiley Happy

Then, if you still have some problems, post the code you ve developed so far, we ll help you surely.

Mention the version of LV you use.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 9 of 15
(3,987 Views)


@BTech Project wrote:
We have deleted the time array from this written data ... After that i want to plot the values of the efficiency against the time array from the text file

Well, if you want to plot against the time data, don't delete it! 😮

Seems you are reading a 2D array and slicing out the second column for further processing. This should be done using "index array" and not e.g. "delete from array" as I have sometime seen posted here or elsewhere. Just get column 1 and process it further and get column 0 and use it as x.

Why don't you attach an example file and your VI so we can see if there are any deeper problems. 🙂

Message Edited by altenbach on 09-27-2007 06:40 AM

0 Kudos
Message 10 of 15
(3,982 Views)