Piadvcalcexpfilval() – Rockwell Automation FactoryTalk Historian SE DataLink 4.2 User Guide User Manual

Page 138

Advertising
background image

FactoryTalk Historian DataLink User Guide

130

Returns

See specific information for PICalcVal() outcodes (page 124).

Example:

The following calculates a time-weighted total for the expression
'cdf144'+'cdt158' from yesterday to today from the default
FactoryTalk Historian server:

=PIAdvCalcExpVal("'cdf144'+'cdt158'","y","t","total","time-
weighted","compressed","10m",50,1,4,)

The result is multiplied by 1. Since compressed is the specified sampling
mode, the sampling frequency is ignored and the expression will be
sampled at the combined compressed events of cdf144 and cdt158.
The minpctgood is 50 percent so result will only be displayed if
percent good is 50 percent or greater. The percent good is returned next to
the total.

PIAdvCalcExpFilVal()

Retrieves a filtered, calculated FactoryTalk Historian point value based on
an expression, using the following syntax:

PIAdvCalcExpFilVal(expression, stime, etime, filtexp, mode,
calcbasis, sampmode, sampfreq, minpctgood, cfactor, outcode,
PIServer)

Arguments

Argument

Explanation

expression (string)

A FactoryTalk Historian calculation expression.

stime (string)

The start time for the range of calculation (in FactoryTalk Historian

time format).

etime (string)

The end time (in FactoryTalk Historian time format).

filtexp (string)

The filter expression used to filter results.

Advertising