LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Speeding up and slowing down data collection

I am creating a temp monitoring vi that will display temps in real time on a waveform chart. It will log temperatures over the course of a week so I need to limit the number of data points I take and keep it computer resource efficient. I only need to record temperature to the wave form chart every 10 or 15 minutes but I would like to have the current temp as a numeric indicator update more frequently so you can see its working.

 

I'm looking for a way to collect data from a daq at maybe 10 samples per second to average and display on the numeric indicator but then at 15 minutes collect 100 samples per second to average and add to the waveform chart. 

0 Kudos
Message 1 of 5
(2,581 Views)

you could compute an average for the times when you only update the numeric indicator

and use the quotient remainder vi to trigger graph/chart updates every x iterations

example-averaging.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 2 of 5
(2,573 Views)

You didn't post any code so I will just say this. If you are using a proper program architecture like a state machine you can have separate measuring, displaying and logging states. 

 

Then your program goes something like this:

  1. Timer
    1. Time to measure=T Time to log=F
    2. goto measure 
  2. Measure
    1. goto display
  3. Display
    1. goto timer

 

  1. Timer
    1. Time to measure =T AND time to log =T
    2. Goto measure
  2. Measure
    1. Goto Display 
  3. Display
    1. Goto Log
  4. Log
    1. Goto Timer
========================
=== Engineer Ambiguously ===
========================
Message 3 of 5
(2,551 Views)

Yes I was thinking of using a state machine in a way similar to your idea but how does the daq assistant fit into that. Can I have separate daq assistants in different states that reference the same pins on the daq?

0 Kudos
Message 4 of 5
(2,544 Views)

No, you cannot generate two tasks for the same channels on a single device. 

 

It seems like the snippet that jwscs posted is what you are looking for. Have the task set to sample the data at the rate of the numeric indicator, then every x-cycles of the while loop (10 in jwscs' example) you can jump into a case statement and write the latest value(s) to your waveform charts 

Message 5 of 5
(2,515 Views)