02-13-2012 09:28 AM
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?
02-13-2012 10:10 AM
Set the XAxis Multiplier property to the calculated deltaT value.
Mike...
02-13-2012 02:21 PM
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..?
02-13-2012 03:30 PM
What is the problem that you're having specifically?
Mike...
02-13-2012 03:50 PM
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...