Campbell Scientific RTMC Pro Real-Time Monitor and Control Professional Software User Manual

Page 26

Advertising
background image

RTMC Pro

Instead of typing the expression directly into the Select Data field, you can
press the calculator button next to that field to bring up the Expression Builder.
See Section 2.4.12, Expression Builder.

Strings

As shown above, double quotes are used in RTMC to enclose the name of a
data value (or source, datalogger, or table depending on the component).
Therefore, when defining a literal string, a dollar sign is used as a prefix. This
indicates to RTMC that you are defining a literal string rather than a data value.
For example, to search for the position of the sequence abc in the data value
mystring, you would use the following expression:

InStr( 1, “Server:CR1000.hourly.mystring”, $”abc”)

Statistical Functions and Start Options

Expressions can also use Statistical Functions, some of which involve the state
of a data value over a period of time. For instance, you can return the
maximum value of a data value over the past 24 hours using the expression:

MaxRunOverTime(“Server:CR1000.QtrHour.Temp”,Timestamp(“Server:

CR1000.QtrHour.Temp”),nsecPerDay)

When RTMC-RT is launched it begins processing with the newest record by
default. Therefore, using the above expression, a component will not
immediately display the maximum value over the past 24 hours. Rather, it will
display the maximum value since RTMC-RT was launched. The 24-hour
maximum will only be displayed after it has been running for 24 hours. In
order to get a 24 hour maximum immediately, you can use a “Start Option
Function” to cause RTMC to begin processing data at an earlier point. For
example,

StartRelativeToNewest(nsecPerDay,ordercollected);

MaxRunOverTime(“Server:CR1000.QtrHour.Temp”,Timestamp(“Server:
CR1000.QtrHour.Temp”),nsecPerDay)

would begin displaying a 24 hour maximum immediately, provided that the
data is available in the communications server’s data cache.

Aliases

If a data value is used multiple times in an expression, the expression can be
simplified by declaring an alias for the data value at the first of the expression,
in the form:

Alias(alias_name, data_value)

20

Advertising