4 expressions, Expressions -44 – Campbell Scientific LoggerNet Datalogger Support Software User Manual

Page 180

Advertising
background image

Section 5. Real-Time Tools

When components are grouped, the properties for each of the components will

show up as an item in the Component right-click menu. These menu items can

be used to modify the properties for each component.

If there are multiple screens in the project, the

Window Menu will allow you

to change between the screens.

Help Menu provides access to help for all of the features of RTMC.

5.2.1.4 Expressions

Components that display data values either numerically or graphically can be

processed using expressions. These expressions can include simple

mathematical expressions, functions to manipulate strings, or more complex

functions that deal with the state of a data value over time.

For instance, a temperature reading in degrees Celsius can be processed to

display in degrees Fahrenheit using a simple mathematical expression. This is

done by first selecting the data value in the Select Data

field, and then entering

the mathematical expression after the defined data value. Using the above

example, if the data value is defined as “Server:CR5000.TempData.Temp1”

(“Source:datalogger.table.variable”), you would enter

“Server:CR5000.TempData.Temp1” * 1.8 + 32

to convert the temperature reading from degrees Celsius to degrees Fahrenheit.

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,

5-44

Advertising