LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Only use datapoints at certain time interval

Solved!
Go to solution

Hi everyone,

 

I've got a new question. Currently I am working on the final part of an application of mine that consists of several while loops running simultaneously:

 

  1. DAQ loop: acquires data, adds a relative time in seconds and feeds it to a data queue
  2. Visualization loop: calculates different physical properties (requires some calculation time) from the first data queue and shows it on the screen in XY graphs (to be able to see a complete measurement). Depending on which tab the user activates in the tab control, different sets of XYgraphs are shown to accomodate different views. If the measurement is running (run button pressed), a second data queue is fed by the data from the first queue
  3. Storage queue: takes data from the second data queue and stores it into a spreadsheet file
  4. 2 additional loops to control the motors in the measurement
  5. An event loop that checks which buttons are pressed
Don't worry if there is something unclear, not everything matters in this thread. Now since I am using XYgraphs to show my data (I tried different types, but this suits my purpose), the performance of the program is determined by the continuously reloading of large sets of data for the graphs. To reduce this problem, I want to exclude some points from my calculation. Now every datapoint is plotted. I would like to plot points that are a multiple of x seconds (lets say a multiple of 1 second: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...). I attached a figure of the subvi I created to try to do this.
The subVI takes the relative timestamp (in seconds) and the desired multiple (1 second), calculates the mod(timestamp,multiple) and checks whether it is almost zero (if it is zero, it is a real multiple, but since this will not always occur I put in a certain threshold). As a result I get a confirmation to use the point or discard it. While it works for a simple case, in the complete program, it doesn't work.
I was wondering if someone would have an idea as to how I should solve this. I don't mind that the points used are not exactly the multiple, I just want to exclude a lot of points to reduce the loss in performance.
Thx

 

Giovanni Vleminckx
---------------------------------------------------------------------------------------
Using LabVIEW 8.5 on Windows7
0 Kudos
Message 1 of 3
(2,614 Views)
0 Kudos
Message 2 of 3
(2,573 Views)
Solution
Accepted by topic author GiovanniV

Hi,

 

thx for the reply. This would indeed serve as a good function, but I want to be able to see parts of previously acquired data. The decimate function either cuts out arbitrarily or averages information. So instead I came up (this weekend) with the following solution:

 

  • I added a shift register to the while loop that visualizes the information
  • This shift register is initialized at a 0 DBL
  • Everytime the loop runs, it takes a set of acquired data from a queue. It checks the relative time of that set of data, calculates the floor value (so round down of the time value) and checks whether it is larger that the value stored in the shift register.
  • If TRUE --> show that set of data and update the shift register with the rounded value
  • If FALSE --> do nothing
This way I can plot a point every 1 second. This can be altered to accomodate other time intervals by playing with the value in the shift register (for example for a 2 second interval --> update the shift register when TRUE and add "1")
But thanks anyway for the info.

 

Giovanni Vleminckx
---------------------------------------------------------------------------------------
Using LabVIEW 8.5 on Windows7
0 Kudos
Message 3 of 3
(2,546 Views)