LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot time and pressure arrays in scrolling chart

Hello:

I am in need of plotting from an array that has the following column data (in order): time, pressure A, pressure B.  It needs to show 30 seconds of data while the program is running to the user.  I am also displaying the array on the front panel so the time that is listed in each row must correspond with the plotted information.

 

Because of this I am having trouble with the labview graphs and charts as the function produces its own time values. To further complicate the situation I am plotting both sets of pressures (column 2 and 3) in the same plot. 

 

 What is the best way to plot an array that already has time values in first column?

 

I am not well-versed in clusters and array manipulation so please be patient with me.

 

Thanks.

0 Kudos
Message 1 of 4
(3,138 Views)

Charts and graphs have no time information unless you provide it. If you change the x axis to display absolute or relative time and you don't provide it, the dt will default to 1 and the start time to January, 1903. You need to index the array and get the start time and use the Xscale.Offset property. You would need to calculate the difference in time in the array(i.e. element 1 - element 0) and set the Xscale.Multiplier to this value.

 

Look at the example called Real Time Chart.

0 Kudos
Message 2 of 4
(3,131 Views)

Thanks Dennis.

 

I have look at the example and unfortunately it is a little vague on the documentation.  I am not really sure how to implement.

 

For instance, if I record the following data in an array: Time, Pressure A, Pressure B, other data, other data. Each iteration of the while loop has a 500 ms wait on it.  Thus, each "time" row entry should be spaced exactly 500 ms form the previous data row.  At the same time (same iteration) I need to continuously plot the pressure data on the strip chart-and so forth through the while loop.

 

How would I "trick"/ implement the code to obtain relative time (in 500 ms steps) and plot concurrently as I store and display data from the array.  To clarify, I think what I am asking is what would be the property node inputs needed for this to work? Also would the array data displayed to the user concur with the strip chart displayed?

 

Thanks again.

0 Kudos
Message 3 of 4
(3,095 Views)

You use the exact same properties that are in the example. The offset defines the initial value of the chart. The multiplier defines the interval between values on the chart. That is what the documention says as well.

 

Here's an example similar to the shipping one. The difference is that the multiplier is extracted from the array and also used to determine the loop rate. I used a for loop so that it will automatically stop when the last element in the array is plotted. Modify as needed.

 

If you still have problems, post your VI.

0 Kudos
Message 4 of 4
(3,088 Views)