LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart x-axis in time (secs)

Ok here's what I'm trying to achieve (unsuccessfully at the moment). I've got a 2D array of data collected from a sensor. Each column in the array corresponds to one of the sensor's axes. I want to display 3 columns of data on a waveform chart with the magnitude of the data as the Y axis and time as the Z axis.

 

Here's the tricky bit. I have no timestamp with the data. However, I'm taking the first element of data in each column as being T (time) = 0. The sampling rate of the sensor is 100Hz so => dt = 0.01. So each data element in each column (sample) is separated by 0.01 seconds. Therefore by knowing the number of samples in a column of the array, I can get the end time. E.G. 1000 elements in one column of the array => end time, T = 1000 * 0.01 = 10 seconds.

 

So in the above example the chart's time axis should go from t = 00:00:00 to t = 00:00:10. However I'm not gettin anything like this in my chart. I did up a quick vi showing what I'm currently doin. 

 

Any tips?

0 Kudos
Message 1 of 5
(4,016 Views)

Set the XAxis Multiplier property to the calculated deltaT value.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 5
(4,009 Views)

Good stuff Mike, that certainly works for my example vi (which is a good start :P)

 

However, I'm still experiencing problems with my actual vi. I've uncovered that it's related to my chart history length exceeding the default 1024 value. Ideally I'd like to set this value programatically as I won't know it until the sensor data is read.

 

Any ideas..? 

0 Kudos
Message 3 of 5
(4,002 Views)

What is the problem that you're having specifically?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 5
(3,995 Views)

I've re-attached my example vi with a minor adjustment highlighting the problem. Each column of the array now contains 2000 elements which exceeds the deafult chart history buffer length value of 1024. This causes problems with the time display on the chart. I could of course change the chart history buffer length manually by right clicking etc. but would need to do it in real time in my actual vi as I won't know the size of the array until execution.

 

Is that clearer?

 

Running the vi now should show you, the time starts at 00:00:09 instead of 00:00:00. I understand why but not how to fix it...

0 Kudos
Message 5 of 5
(3,987 Views)