LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set X-axis to zero (time)

I am trying to get the x-scale to start at 00:00:00 when I hit the start button.  Then just act as a time scale in minutes and seconds correlating to my data that is being collected.  so say i collect data for 15 minutes and 30 seconds the final point would be 00:15:30. 

 

now in order for me to get the data in this format I need to correct everything in excel.  for example if i collect data starting at noon on the nose and collect data for the 15 min and 30 sec, I have the actual time that each data point was collected and need to subtract the initial time that started at to give me the time to correlate peaks to a certain time into the measurement. 

0 Kudos
Message 11 of 21
(1,710 Views)

An update after looking your VI.

Note that my solution uses a sampling period of 1 second. The defualt spacing between points in the chart is 1. Thus in my example every sample (taken each second) is plotted in the correspondent number 1,2,3, etc.

To understand this, change the sampling time to two seconds. Note that every two seconds a point will be plotted in the x axis (1, 2, 3 and not what one would like 1, 3, 5).

To adjust this you must set the multiplier (from offset and multiplier) to adapt to your sampling freq.

0 Kudos
Message 12 of 21
(1,707 Views)

So the solution will be something like this

Dibujo2.PNG

 

Please note that if you sample at high frequency during 15 minutes, the number of points will exceed the default chart memory of 1024 points.

0 Kudos
Message 13 of 21
(1,702 Views)
But my x-axis isn't changing, it is reamining at 00:00:00. Is a multiplier going to change that?
0 Kudos
Message 14 of 21
(1,701 Views)

Is the property node INSIDE the loop or OUTSIDE the loop? If it is inside, then at every iteration you are setting the starting point at zero preventing the proper update.

0 Kudos
Message 15 of 21
(1,696 Views)
It is outside the loop. I have also ran it with the get time function in the initialization loop so it uses just that initial time but that also reads just 0's the whole time.
0 Kudos
Message 16 of 21
(1,697 Views)

Please send the latest version of your VI

0 Kudos
Message 17 of 21
(1,694 Views)

sorry we had a bad snow storm here in milwaukee on friday.  I had to get out quick or I would have been stuck in traffic for hours. 

0 Kudos
Message 18 of 21
(1,662 Views)

Hi. Sorry for the late response

Your problem lies in that you are ploting a "waveform" data type and not an array. A waveform contains the array of data AND time information of the data, this is: A timestamp marking the start of the acquistion (t0) and the time interval between samples (dt).

More info here: http://digital.ni.com/public.nsf/allkb/B965F316364DE17B862572DF00363B10

This time information is passed to the chart and therefore overwrites the customization of the time scale.

 

To correct this, change the polymorphic DaqMx Read instance to output the data as a 2D array. Be carefult to transpose properly the 2D array before ploting the multiple signals. Also you may "unbundle" the components of a waveform, usign a special function called "Get waveform components".

 

I must say that the waveform option is quite handy since the time stamp is bundled together with the data, so there is no risk to forget when you acquired the data. If the problem how the time information is being read in excel, then you should not try to remove the time stamp info but format it in a way that the written text file (or .xls) can be interpreted by excel.

So, long story short: The chart can be left as it is (with the timestamp). For the written file, you do in LabvIEW what you are currently doing in excel: take the time stamp of the first point and substract it from the others. Then format the resulting time using "Format data/time into string" in the more convenient way to you.

 

Regards

 

0 Kudos
Message 19 of 21
(1,649 Views)

I have tried both the unbundle by name and get waveform components and neither of them worked.  The line was broken due to the it was a 1d array of waveform data.

 

I even then went as for to turn the waveform data into a cluster by using the array to cluster and then getting the wave form components.  I was able to separtate the three components out.  at this point my goal was to subtract the time at which the measurement started from the running time that the data was giving me.  This was somewhat successful, however I am not able to build the waveform with those new values.

 

This is what I do manually in excel so i know there is a way to do it in labiew.  Im  just not sure of all the tools available to me in labview so I am sure that I am overlooking something.  

0 Kudos
Message 20 of 21
(1,638 Views)