LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extra decimal places in double

Yes this was just an exercise. But it is very closely related to what I'm trying to do. I'm receiving a data stream and sampling every 10th point, then every 100th point, then every 1000th point, etc. I was using the Quotient & Remainder function to determine if my timepoint was a multiple of a number, which would indicate it should be sampled.

0 Kudos
Message 11 of 14
(529 Views)

@tda*! wrote:

Yes this was just an exercise. But it is very closely related to what I'm trying to do. I'm receiving a data stream and sampling every 10th point, then every 100th point, then every 1000th point, etc. I was using the Quotient & Remainder function to determine if my timepoint was a multiple of a number, which would indicate it should be sampled.


This is a good start at explaining what you *really* need to do.  Maybe if you could be a little more specific about the details of what you need to do, we can come up with something better than testing every data point that comes over.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 14
(516 Views)

So my problem is as simple as receiving a datastream with a timestamp and saving to file every 10th point for, say, 1000 points, then every 100th point for another 1000 points, etc.

0 Kudos
Message 13 of 14
(508 Views)

So store your count in a shift register as an integer.  Keep adding 1 to it.

 

Store your target in a shift register as an integer.  When count (an integer) equals the target (an integer), log the data, then multiply the target by 10 and store that value back into the shift register.

 

Nowhere do you need to do comparison of floating point numbers.

0 Kudos
Message 14 of 14
(505 Views)