LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph multiple 1D arrays of different lengths of the same graph without adding zeros to the X values without Y values

Solved!
Go to solution

I have a simple program that looks for when water was flowing or not flowing from a raw data file to plot the temperature and pressure during flow. It takes all of these and combines them in a 2D array and graphs it.  The problem is that not all of the flow times are equal, therefore LabVIEW uses zeros as place holders  to fill out and make a nice even 2D array.  This makes it look like my temperature and pressure values plunge.

 

So I want to graph several plots on the same graph that have a varying number of data points.

 

I'm sure there is information out there to help with this, but I have been unable to locate it.  Can anyone give me a clue?

 

Thanks,

BFeds

0 Kudos
Message 1 of 51
(9,417 Views)

B-Feds,

 

It would be better if you could supply some code to get a better idea of exactly what you are trying to achieve. To get data sets of different lengths onto a graph you can:

 

Different length data graph.png

 

 

Rgs,

 

Lucither

 

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 2 of 51
(9,393 Views)
Solution
Accepted by topic author B-Feds

Pad the rows with NaN instead of zero and they won't show on the graph.

Message 3 of 51
(9,387 Views)

Thanks!  The NaN is very fast and simple for my code!

Message 4 of 51
(9,374 Views)

Hi

 

I set up an array of timestamps and an array of temperature values extracted from an sms text. I want to group both individual arrays together to produce an output waveform with temperature vs time. The timestamps are in string format(i.e HH:MM:SS) and the temperature values are in numeric format. Could anyone help me with this?

 

Regards,

 

Hammy.

0 Kudos
Message 5 of 51
(9,280 Views)

Hi Hamidq,

 

The easiest way to plot timestamps (X-axis) and temperature values (Y-axis) would be to make use of an XY Graph. You will need to change the formatting on the X-Axis (timestamp) such that it's formatted to Timestamp data. Otherwise, the X-axis will have large integers which are the numeric conversion of the timestamp.

 

For your reference, I've attached a copy of a VI in which I've plotted a few Timestamp values and a few numeric DBL values on an XY Graph.

Sanjay C.
Embedded Software Product Manager| National Instruments
Download All
Message 6 of 51
(9,255 Views)

Hi Sanjay,

 

First of all i like to thank you for the attachment as its given me an idea of how to plot timestamps. However i have one problem, i convert the timestamps extracted into numeric form into timestamp format but it gives me something like 00:00:14.000 instead of 14:29:32.

 

I've attached my documents for you to see. You may notice the string array is unattached to anything, this was originally used to view the timestamp as a string when i remove the fract/exp string to number.

 

Any ideas how may resolve this? Thanks!

 

 

 

Regards,

 

Hammy.

0 Kudos
Message 7 of 51
(9,240 Views)

Hi Hamid,

 

The issue you are running into is simply related to the Display Format of the Timestamp Data. You can overcome the issue by Right Clicking on the timestamp indicator, selecting Display Format, and editing the Digits field for the timestamp to 0 Digits. This will set the format to look like: HH:MM:SS instead of HH:MM:SS.SSSS as you seem to have the Digits field currently set to 4 in the VI you've attached.

Sanjay C.
Embedded Software Product Manager| National Instruments
0 Kudos
Message 8 of 51
(9,224 Views)

Hi,

 

Sorry that doesnt work. I've already figured it out. What I had to do was convert each values of the string timestamp into an integer then display them into a timestamp format. I used a scan string to do that for me then a bundle by name block to identify the year, month, day etc where it displays the output as timestamp.

 

 

0 Kudos
Message 9 of 51
(9,205 Views)

Hi Hamid,

 

Thanks for following up with your solution to the problem. I took the first step (converting to integer) for granted, but it looks like you were able to put all the pieces together to reach a complete solution.

Sanjay C.
Embedded Software Product Manager| National Instruments
0 Kudos
Message 10 of 51
(9,183 Views)