Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

24 hour Max and Min expressions in RTMC


Clayton Apr 24, 2011 04:12 PM

Hello,
I'm trying to create an RTMC Pro project which includes maximum and minimum temperatures from the last 24 hours. It seems like this should be fairly straightforward, but I'm having a heck of a time. The syntax I've tried is below, but there aren't any examples for MaxRunOverTime in the help, and the data it is coming back with is definitely not correct.

StartRelativeToNewest(nsecPerDay,ordercollected); MaxRunOverTime("Server:Main_NL100.1.Air_Temp__AVG",Timestamp("Server:Main_NL100.1.Air_Temp__AVG"),nsecPerDay)

I've also tried the timestamp section without "Timestamp" or the parentheses. I'm wondering if I should instead be using the time value as the timestamp. On the CR10X, the timestamp is actually three different fields, so perhaps this works differently on newer loggers.

Also, I've tried to create a TimeStamp expression of the statement above to try and figure out what data it might be pulling out.

Timestamp(MinRunOverTime("Server:Main_NL100.1.Air_Temp__AVG","Server:Main_NL100.1.Hour_Minute_RTM",nsecPerDay))

This is coming back with 1/1/1990 00:00:00, which I believe is what RTMC thinks is the beginning of time.

I've tried setting up the page with a report for the previous 24 hours, then just use MaxRun and MinRun. This seems like the easy way to go, but it only appears to work if the project hasn't been restarted in the last 24 hours. Great if I never, ever, need to reboot my computer. I thought maybe this could be overcome by using a DAT file as a data source and backfilling at least a day's worth of data, but I just get the exclamation point if I use a file data source, even though I know it's working in other projects. Can reports not use files as data sources?

Campbell, RTMC Pro is great (and getting better all the time), but the documentation isn't. Please add more examples to the help file and explain all of the settings. For example, there is basically no explanation of the Offset in the Report Range Properties page.

Thanks for any help.

Alex


ChipsNSalsa Apr 25, 2011 05:32 PM

After a quick look at your expression

StartRelativeToNewest(nsecPerDay,ordercollected); MaxRunOverTime("Server:Main_NL100.1.Air_Temp__AVG",Timestamp("Server:Main_NL100.1.Air_Temp__AVG"),nsecPerDay)

it looks like it should work to me. What do you get if you put the following expression in a digital component?

Timestamp("Server:Main_NL100.1.Air_Temp__AVG")

Based on the table name being a number, I can tell you're dealing with data from an older mixed-array datalogger. I'm curious if year, Julian day of year, and hour and minute have all been included in the array.

* Last updated by: ChipsNSalsa on 4/25/2011 @ 1:06 PM *


Clayton Apr 26, 2011 07:37 PM

Thanks Glen,
Since you verified it, I tried that expression again and it seems to be working fine. I'm not sure if there really was a problem, or if the check to see if it was working was done incorrectly. Also, I figured out that the expression to get the time of max temp was:

StartRelativeToNewest(nsecPerDay,ordercollected);
Timestamp(MaxRunOverTime("Server:Main_NL100.1.Air_Temp__AVG",
Timestamp("Server:Main_NL100.1.Air_Temp__AVG"),nsecPerDay))

Alex


Makada Oct 17, 2017 08:30 AM

Bringing an old topic up...

...am i right regarding the following:

As soon as you close loggernet or rtmc those values are reset in rtmc?


ChipsNSalsa Oct 17, 2017 03:18 PM

The StartRelativeToNewest function is designed to backfill the expression with data. In this case a days' worth of data. If you close RTMC Run-time and restart it with your project, you should see the same calculated result if no new data was collected while RTMC Run-time was closed. The data source the expression is working on must have a days' worth of data stored however. I can see someone making the mistake of using a field in the Public table in their expression.

The Public table in a datalogger is only one record long. LoggerNet doubles the datalogger's table lengths to calculate how much history it will save in its cache. Thus, when an RTMC project with such an expression linked to a field in a Public table is first run in RTMC Run-time, there are only two values available to it, not a days' worth. If the project is left to run in RTMC Run-time for a day or longer it will have the correct value calculated only because it has been keeping the values it has received from LoggerNet's cache in its own memory space. It you close RTMC Run-time and start it again with the same project, it's back to having only two values available to it, thus the result will be different than it was before you closed and reopened it.


Makada Oct 17, 2017 04:14 PM

Thanks for the reply. 

Thats clear,  so best is to use a one minute data  table in a rtmc expression, then it will show historic data fine when rtmc has been closed and reopened....


ChipsNSalsa Oct 17, 2017 05:14 PM

One minute, fifteen minute, one hour, or whatever you've got for daily subintervals, as long as it's a Maximum CRBasic instruction output. But yes, processing one minute Average or Sample CRBasic instruction outputs would get you very close to the true max.

Log in or register to post/reply in the forum.