Skip to main content

StreamTotal

The StreamTotal function is supported in both Studio and Search. It returns the totalization of the connected streams, according to the Direction argument. Streams are totalized according to the following rules:

  • The element object status must be equal to the objectstatusvalue argument, if defined.
  • The element contains an attribute defined in the Attributeslist.

The function automatically discovers connected elements according to the Direction argument, and performs the totalization.

According to the Previoucase argument, the function will work on the current or previous case.

Prototype

    StreamTotal(PreviousCase ; Direction ; Uom ; ObjectStatusValue ; ObjectStatusAttribute ; Attributelist)

Arguments

    PreviousCase             String      By value (Nullable)  

Null (not defined) or emty string or equal to:

'N' : work on current case
'Y' : work on previous case

Direction String By value (Nullable)

A valid String containing:

I : count input streams
O : count output streams
A : count attached streams
Null (not defined) or Empty string : count all connected streams

Uom String By value (Nullable)

Null (not defined) or empty : no UOM conversion;
A valid UOM.

ObjectStatusValue String By value (Nullable)`

A Null (Not defined) or empty string if the function has not filtered out elements based on their object
status. Otherwise, a valid string containing the object status value (e.g., 'IS' or 'OS').

ObjectStatusAttribute String By value (Nullable)

A Null (Not defined) or empty string if the function has not filtered out elements based on their object
status. Otherwise, a valid string containing the attribute name.

AttributeList String By value (Nullable)

One or more valid strings, semi-colon separated, containing the attribute names to be totalized. Depending
on the model, different elements may have different attribute names. In such a case, add all attribute names
of interest in the totalization.

Returns

    Number

The function returns the totalized value. Zero, if no streams are connected.

Exception

    Undefined

Undefined is returned if:

- PreviousCase is not empty and not a valid one, or the previous case does not exist
- Empty or invalid AttributeList
- Invalid UOM, if specified
- Invalid Direction

Example

    StreamTotal( ; 'I' ; ; 'IS' ; 'ObjectStatus' ; 'i_Meas_ Mass' )

This will totalize the [i_Meas_Mass] attribute value of all streams connected in input, and will return the totalized value.