LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure elapsed time & chart history

Hi all,

 

I am developing this VI which is acquiring continuous from 6 analog channels. For 5 of them I am calculating rms values and present them in 5 charts at the front panel. The test should run for 5 hours ( 18000 sec). I am finding difficult to

 

a) Measure the elapsed time : I want to save the exact time that an event takes place (i.e. an rms value over 30mA) and automatically stop the VI when 5 hours is reached.

 

b)Having a chart window of 5 hours. I know that changing the history length buffer does not change the window you view at the chart but I need to have a chart with x- axis being 18000 seconds. I am extremely confused of how to time my samples or my loops to achieve that.

 

Could you please assist me on this coz it'a been a while I am trying to solve the problem with no success.

 

VI is attached. Labview 8.6, PCI-6254,  2xSCB-68.

 

Thank you in advance

 

Panos

 

 

 

 

Download All
0 Kudos
Message 1 of 4
(3,666 Views)

Just a few observations

1.  You have a AI and Digital running in the same loop, these tasks are not clocked at the same speed, you could have problems here (your digital dask is not done when you need to sample the ai causing the buffer to buildup and possible timeout.

2.  You have a nice consumer loop but still put processing in the producer loop, maybe you move this to the consumer loop to minimize the chance of running out of

3.  Graphing question-  You use a waveform chart.  This has a fixed history length which has to be set, this will depend on the sample time (fixed) and AI (set with control).   It assumes thaty there is even sampling of data (fixed number of points) If you want to display the entire waveform time, unselect autoscale X and type the maximum time (18000) in the X axis).

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(3,642 Views)

falkpl wrote:

Just a few observations

1.  You have a AI and Digital running in the same loop, these tasks are not clocked at the same speed, you could have problems here (your digital dask is not done when you need to sample the ai causing the buffer to buildup and possible timeout.

2.  You have a nice consumer loop but still put processing in the producer loop, maybe you move this to the consumer loop to minimize the chance of running out of

3.  Graphing question-  You use a waveform chart.  This has a fixed history length which has to be set, this will depend on the sample time (fixed) and AI (set with control).   It assumes thaty there is even sampling of data (fixed number of points) If you want to display the entire waveform time, unselect autoscale X and type the maximum time (18000) in the X axis).

 


Hi falkpl,

 

first of all thank you for the reply.

 

1. The Digital undertakes the task of turning on/off 2 relays. I faced some problems as the one you described but now it seems to work fine. Would you suggest creating another consumer loop exclusively for the DIO?

 

2. Originaly, I had all the graphs and charts to the consumer loop ( that is why you can see all this empty space in my block diagram) but unfortunately that caused a time lagging of the data viewed at the front panel and the real-time data (i.e. I might change the input voltage and see the change in my front panel after some seconds). Hoping that it wont time-out the VI, I placed them to the producer loop. If you have any other suggestion on this one, I would appreciate any help.

 

3. Chart assume evenly spaced points for X-axis. So, the increment of the x value takes place every time new data points are produced, here rms values.  Just had the idea of changing the number of samples to read at the DAQmx Read (number of samples constant) to 10000 and set the buffer size to 10000 (Samples per Channel control on the left of the front panel), and it seems that every iteration takes 1 sec to complete and therefore looks like I have an increment of 1sec at the X-axis of the charts per new Y-axis value. In that case I guess changing the upper limit of X-axis to 18000 as you suggested has a meaning as every increment corresponds to 1 second. I have added a Get Time on the Producer loop inside and outside and then subtract (please see attached the new VI). It seems it works but, is it really? I mean, are there samples I am losing or something I am missing here?

 

Thank you very much

 

Panos

Download All
0 Kudos
Message 3 of 4
(3,630 Views)

One thing that is critical here is the sampling rate of the AI (10Hz, 10kHz ....) it will help in determining how to balance the timing, also how often do you need to calculate the RMS (each second, 10 Hz ....)

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 4
(3,620 Views)