DIAdem Help

Method: LoadChannelsByName for Navigator

  • Updated2024-09-12
  • 4 minute(s) read

Method: LoadChannelsByName for Navigator

Loads or calculates channels from a channel group of a TDM file or a measurement of an ASAM data store into the Data Portal. If the names given in the MeasurementQuantityNameList parameter exist, DIAdem loads the respective channels. If the MeasurementQuantityNameList parameter contains the name of a channel that does not exist, the method searches for a calculation with this reference name in the loaded calculation template and executes the calculation. DIAdem saves the loaded and calculated channels in a new channel group in the Data Portal.

Set oElementList = Object.LoadChannelsByName(Measurement, MeasurementQuantityNameList, [ImportSettings])
ObjectNavigator
Object with this method
MeasurementVariant
Specifies the object containing the channel group or the measurement from which the method loads or calculates the channels or measured values given in the MeasurementQuantityNameList parameter.
MeasurementQuantityNameListVariant
Specifies the array with the list of names for the measurements or channels which the loading process accesses. Use the function Array to specify the list of measured values or channels or the output references of calculations, for example Array("Revs","Torque","Power").
The following cases are possible:

1) If the given measured value or the given channel exists in the measurement or in the channel group specified in the Measurement parameter, the LoadChannelsByName method loads the given measured values or channels into a new channel group of the Data Portal.

2) If the given measured value or the given channel exists in the measurement or in the channel group specified in the Measurement the Calculation Template, executes the calculation and generates the associated result channel in the new channel group of the Data Portal. If you want to calculate with DIAdem, the calculation must fulfill the following requirements:
  • The name of the output reference of the calculation must be the same as the name given in the MeasurementQuantityNameList parameter, and it must be defined as a channel in the calculation. You can find the name of the output reference in the Calculation Manager - Edit Calculation dialog box in the Reference column of the Outputs area.
  • Each reference of the input and output channels must refer to the default group and must be entered in the form /ChannelName. ChannelName corresponds to a channel name.
  • If several calculations with the name of the output reference given in the MeasurementQuantityNameList parameter in a calculation template exist, DIAdem executes all calculations and adjusts the names to the result channels in the Data Portal according to the Name Conventions in DIAdem.
Note  If a channel listed in the MeasurementQuantityNameList parameter does not exist and DIAdem does not find a calculation with this output reference, DIAdem ignores this channel or this calculation.
[ImportSettings]Variant
Specifies the Loading configuration as object. You can only use a loading configuration if you load data from data stores. If you assign the value Nothing to the ImportSettings parameter, DIAdem creates the standard browse setting for the open data store (Test/SubTest - Measurement - MeasurementQuantity), generates a minimum loading configuration, and then only transfers the name, the unit, and the description of each element into the Data Portal. If you do not assign any value to the ImportSettings parameter, DIAdem uses the loading configuration of the current data store.
oElementListElementList <Data>
Returned object

Note  If you have selected the inheritance of properties in the DIAdem NAVIGATOR Settings dialog box, the LoadChannelsByName method always passes on the properties to the loaded channels, irrespective of the selected setting.

The following example executes a search for channel groups and loads the channels, whose names exist in the first channel group of the search results list, into the Data Portal. The example also calculates the Calculation channel using the previously loaded calculation template. DIAdem creates a new channel group in the Data Portal with the loaded and calculated channels:

VBScriptPython

 

Dim oMyConditions, oMyQueryForm, oChnList, Channel, oChnGrp
 'Creating search
 Set oMyQueryForm = Navigator.Display.CurrDataFinder.QueryForm
 Call oMyQueryForm.Clear
 oMyQueryForm.Mode = eAdvancedQueryForm

 'Searching for channel groups
 oMyQueryForm.ReturnType = eSearchChannelGroup
 Set oMyConditions = oMyQueryForm.Conditions
 Call oMyConditions.Add(eSearchChannelGroup,"name","=","r*")

 'Executing search
 Call oMyQueryForm.Search()

 'First channel group of results list
 Set oChnGrp = Navigator.Display.CurrDataFinder.ResultsList.Elements(1)

 'Loading calculation set. The calculation must have the reference output name "Calculation"
 Call   CalculationSet.Load("MyCalculationSet.tca")
 Set oChnList = Navigator.LoadChannelsByName(oChnGrp, Array("Channel1","Channel2","Channel3","Calculation"))