DIAdem-Hilfe

Method: CreateUpdateSource for Settings <Navigator>

  • Aktualisiert2024-09-12
  • 2 Minute(n) Lesezeit

Method: CreateUpdateSource for Settings <Navigator>

Generates the UpdateSource object which provides information about the DataPlugins in an update source. The generated object provides update methods for the DataPlugins registered locally and methods for searching for DataPlugins for specified filename extensions. An update source is either the NI DataPlugin website or a DateFinder instance.

Set oUpdateSource = Object.CreateUpdateSource([Type], [Parameter])
ObjectSettings <Navigator>
Object with this method
[Type]Variant
Specifies the update source. If you do not set this parameter, DIAdem uses the NI DataPlugin website as the update source.
Enumeration with the following selection terms:
 42001
eUpdateSourceNiWeb 
The NI DataPlugin website is the update source.
 42002
eUpdateSourceNiDFSE 
The specified DataFinder instance is the update source.
[Parameter]Variant
Specifies the DataFinder instance which is the update source, for example, TestRig@DataFinder_instance. DIAdem does not include this parameter if you assign the value eUpdateSourceNiWeb to the Type parameter.
oUpdateSourceUpdateSource <Navigator>
Returned object

The following example displays the date of the last DataPlugin information update and the number of DataPlugins available on the NI website:

VBScriptPython

 

Dim oMyDataUpdateSource
Set oMyDataUpdateSource = Navigator.Settings.CreateUpdateSource()
Call MsgBoxDisp("Last update: " & oMyDataUpdateSource.LastUpdate & VBCrLf & "Number of DataPlugins to be updated: " & oMyDataUpdateSource.UpdateData.Count)

The following example checks whether the GPX DataPlugin is available on the DataFinder instance TestRig@DataFinder_instance and if necessary, updates this DataPlugin.

VBScriptPython

 

Dim oMyDataUpdateSource, oMyUpdateData, oPluginData
Set oMyDataUpdateSource = Navigator.Settings.CreateUpdateSource(eUpdateSourceNiDFSE, "TestRig@DataFinder_instance")
Set oMyUpdateData = oMyDataUpdateSource.UpdateData
If oMyUpdateData.Exists("GPX") Then
  Set oPluginData = oMyUpdateData("GPX")
  If ((oPluginData.Type = ePluginCodeVbCrypt) OR (oPluginData.Type = ePluginCodeVbs)) Then
    Call oMyDataUpdateSource.Install("GPX")
  Else
    Call MsgBoxDisp("DataPlugin " & oPluginData.Name & " is no VBCrypt or VBS DataPlugin." & vbcrlf & "Please install the DataPlugin manually.")
  End If 
End If

See Also

Objects Overview