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.

RTMCPro - compare last value to previous value


ScottB Sep 18, 2012 05:17 AM

Hi,

I want to indicate if a value is rising or falling in RTMCPro V4 by comparing the last value to the one before it, i.e. if I am sampling every hour then the value for this hour to the one before that. In a perfect world I would want to show an up-arrow graphic for rising and a down-arrow for falling.

Any ideas??


Thanks,

Scott.


jtrauntvein Sep 18, 2012 02:50 PM

The Last() function can be used to compare the current value of a variable with the last value that was loaded. If you want the graphic to show up in a graph, you will have to create two separate traces that use something like the following expression:

alias("ln:cr1000.one_hour.temp_degf", temp);
iff(Last(temp) > temp, temp, NOPLOT)

This expression will produce a point if the value is increasing, otherwise, it will produce a NAN value which would be ignored by the plot. You would specify a trace with the down arrow symbol and a different comparison to plot decreasing values.

This is easier if all you want to show is the current state of the value compared to the previous. This can be accomplished by using an alarm that specifies up arrows and down arrows for the images associated with the on an off states.


ScottB Sep 18, 2012 11:04 PM

Cool, thanks, will give this a go.


Scott.

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