FIFOs in templates?

I’m trying to create a FIFO inside of a template (no external storage to a DB or PLC) where I can read and write as needed. Basically, I want to create a rolling-hour FIFO (sixty integer registers) where I can capture the status of a bit every minute. When a minute elapses, the data will shift (FIFO[58] moves to FIFO[59], FIFO[57] moves to FIFO[58], and so on] and then the bit status from the previous minute is written to FIFO[0]. One minute later, it happens again. If I can create this, then I will take the sum of all registers to display the “current” hourly status of that condition (ie. “RUNNING” for 18 of the last 60 minutes). I intend to replicate this and no PLC or database needs this data, I really want all inside Ignition and within a template.

Anybody have or know of a solution?

I’ve attached a quick example that illustrates some of what you’re after. You’ll probably have to tweak it of course to meet your needs. There is a FIFO UDT that conducts all of the logic–the graphic template is very simple and just shows the “Status/Sum” value. Feel free to customize further, hopefully it helps get you started.

FIFO Example

custom_fifo_udt.json (4.3 KB) custom_fifo_template.zip (5.1 KB)

The reason why I wanted to share this is to demonstrate some of the power that you can achieve with “smart” UDTs and why generally you should avoid having a lot of processing logic on the graphic side of things when possible/applicable.

3 Likes