Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: unsyndicated on November 12, 2021, 09:56:14 AM
-
Hello
I have a 4-20ma particle counter that pulls a sample for 1 minute(on its own internal timer), then resets. I'm looking to take the result from each on minute pull and put it into a rolling 36 minutes cumulative quantity. The Fifoload instruction looks to be a good start, just unsure of how to get it to sync with the high count of the particle monitor.
-
Are you talking about how to scale the number on your particle counter display with the analog input?
-
Are you seeing the rising count or just each final one minute total? If you see the rising count then copy the reading into another register. When a new reading drops below the previous - may need to set a minimum amount of drop to prevent noise from triggering - the use the previous count for your FIFO load source.
-
I can see the rising count, I figured how to pull the the high count with the MAXR function. (FIFO_0)
And I'm able to move that value into another FIFOload (FIFO_1) and get the sum of those values with the SUMR function.
The situation I'm running into now is at the very beginning when my FIFO_1 isn't full it wont complete the SUMR function until FIFO_1 reads full.
-
Use the FIFO control structure's .DEPTH parameter to determine the number of items. Edit - this doesn't really do anything. Since non-filled entries are zeroed the sum should be correct. Just sum the entire FIFO.
My setup using the Simulator provides a proper SUMR even though the FIFO is partially filled
-
Thank you very much, I was able to find the error of my ways.