DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Method: RunCalculation for CalculationChannel <Data>

Method: RunCalculation for CalculationChannel <Data>

Runs a calculation in the script interface for internal data to determine the values of a calculation channel. When you create a calculation channel, DIAdem calculates the channel values automatically; you do not need to call the RunCalculation method. If the values of the channels in the calculation change, DIAdem updates the channel values when you restart the calculation using the RunCalculation method. If DIAdem cannot calculate the values of a calculation channel because, for example, an input channel is missing, DIAdem deletes all values and the unit of the calculation channel as soon as you update the values of this channel.

Object.RunCalculation()
ObjectCalculationChannel <Data>
Object with this method

The following example generates a calculation channel from a formula. Then the example sets the unit "m/s", specifies that the calculation is quantity-based, performs the associated calculation, and fills the channel with the calculated values:

VBScriptPython

 

Dim oMyCalculationChn
Set oMyCalculationChn = Data.Root.ChannelGroups(1).Channels.AddCalculationChannel("Result", "=Speed * 2", , 1)
oMyCalculationChn.DestUnit = "m/s"
oMyCalculationChn.QuantityBased = True
'Changed input channel values or unit require a new calculation of the Calculation Channel
Call oMyCalculationChn.RunCalculation()
In This Section
Was this information helpful?