Rockwell Automation FactoryTalk Historian SE DataLink 4.2 User Guide User Manual

Page 139

Advertising
background image

9

FactoryTalk Historian DataLink Function Reference

131

Argument

Explanation

mode (string)

The type of calculation to be used to compute point values.

calcbasis (string)

The weighting method used to calculate values.

sampmode (string)

The sampling method used for calculation expressions.

sampfreq (string)

The frequency used for interpolated sampling.

minpctgood (number) The minimum percentage of good data required to calculate and

return a value.

cfactor (number)

The time unit of flow for the source tag, required for Total

calculations.

outcode (integer)

An ouput code, either 0, 1, 2, 4, 5, 6, or 7, and not 3.

PIServer (string)

The target FactoryTalk Historian server.

Returns

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

Example:

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

=PIAdvCalcExpFilVal("'cdf144'+'cdt158'","y","t","'productid'=
"Product2"","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.

Advertising