First off, I’m quite new to Ignition, so forgive me if I ask ‘NOOB’ questions.
I’m looking to attach a Ngara noise monitor to an Ignition project. The Ngara noise monitor (http://www.acousticresearch.com.au/Products/Noise%20Loggers/Ngara) allows for UDP broadcasting.
I have looked at the UDP specifications, and found the instrument to send out a a datagram every second. Within each datagram there are 10 readings (one for each 100ms).
We’d like to buffer these datagrams and create a 15 minute real-time average on the screen. We would also save the data to a historian logger.
Does anyone have any suggestions on how to create the moving average, which effectively updates every second, as a package comes in.
I had in mind to simply grab the datagram, and save that in a ‘RAW’ tag, which is linked to a ‘RAW’ historical value. Then create an expression based tag for the moving ‘AVG’ average, which extracts data from the last 900 packages (15 minutes) and calculates the average as its tag value. The RAW tag’s historical data can be overwritten every hour or so.
I guess my main questions for the moment would be:
- Can I store the raw datagram into a ‘RAW’ tag ?
- How do I then use an expression to (a) extract the 10 separate readings and (b) calculate the average
One complication, the moving average is a special case, since we are dealing with decibels… can’t just take the mean of the readings… must use logarithms and things…
Many thanks for your help!