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

Title: fifoload
Post 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.
Title: Re: fifoload
Post by: ATU on November 16, 2021, 01:07:41 PM
Are you talking about how to scale the number on your particle counter display with the analog input?
Title: Re: fifoload
Post by: b_carlton on November 16, 2021, 05:12:13 PM
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.
Title: Re: fifoload
Post by: unsyndicated on November 30, 2021, 09:08:05 AM
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.
Title: Re: fifoload
Post by: b_carlton on November 30, 2021, 11:41:59 AM
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
Title: Re: fifoload
Post by: unsyndicated on December 01, 2021, 10:21:32 AM
Thank you very much, I was able to find the error of my ways.