Calculation functions, Picalcval() – Rockwell Automation FactoryTalk Historian SE DataLink 4.2 User Guide User Manual

Page 132

Advertising
background image

FactoryTalk Historian DataLink User Guide

124

Calculation Functions

Calculation functions compute new values from FactoryTalk Historian
point values corresponding to a specific time range.

PICalcVal()

Retrieves a calculated FactoryTalk Historian point value using the
following syntax:

PICalcVal(tagname, stime, etime, mode, cfactor, outcode,
PIServer)

PICalcVal() is generated only by the Calculated Data dialog box in

XP-2003

versions.

2007

versions use PIAdvCalcVal().

Arguments

Argument

Explanation

tagname (string)

The tag name or names matching the desired FactoryTalk Historian

points for calculation.

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

mode (string)

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

cfactor (number)

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

outcode (integer)

An output code, 0-7, and not 3.

PIServer (string)

The target FactoryTalk Historian server.

Returns

The output code (page 104) argument affects the output as follows:

If the outcode is 0, only the calculated value is returned.

Advertising