Method: AddCalculationChannelRef for Channels <Data>
- Updated2024-09-12
- 1 minute(s) read
Internal Data > Methods > Method: AddCalculationChannelRef for Channels <Data>
Method: AddCalculationChannelRef for Channels <Data>
Generates a new calculation channel with a reference to a calculation of the calculation manager in the script interface for internal data. Use the AddCalculationChannel method to create a new calculation channel using a simple one-line formula.
Set oCalculationChannel = Object.AddCalculationChannelRef(CalculationReference, [DestIndex])
| Object | Channels <Data> Object with this method |
| CalculationReference | String Specifies the reference to a calculation. You specify the reference with the GetReference for CalculationChannel <Data> method. |
| [DestIndex] | LongInteger Specifies the index of the new calculation channel within the collection of existing channels. If you do not specify the index, DIAdem appends the calculation channel to the collection of existing channels in the channel group. |
| oCalculationChannel | CalculationChannel <Data> Returned object |
The following example generates a calculation channel using the calculation manager:
| VBScript | Python |
Dim oMyCalculationChn, sMyCalculationReference Call CalculationSet.Load("Example.tca") sMyCalculationReference = CalculationSet.CalculationGroups(1).Calculations(1).GetReference() Set oMyCalculationChn = Data.Root.ChannelGroups(1).Channels.AddCalculationChannelRef(sMyCalculationReference, 1)