Campbell Scientific RTDAQ Software User Manual

Page 244

Advertising
background image

Section 8. Real-Time Monitoring and Control Software

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.

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”)

Expressions can also use “Functions with State” that 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)

For example,

StartAtOffsetFromNewest(5,OrderCollected);IIF(ABS(("Server:CR1000.MyT
able.Value"-
ValueAtTime("Server:CR1000.MyTable.Value",TimeStamp("Server:CR1000.
MyTable.Value"),30*nsecPerSec,0))>10 AND
ABS(ValueAtTime("Server:CR1000.MyTable.Value",TimeStamp("Server:CR

8-10

Advertising