DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically check to see if remote DataFinder exists

Hello,
 
I have some scripts that connect to a remote (DFSE) data finder, and I am using the command Navigator.Display.OpenDataFinder(DataFinderName) to connect.  If the user of the script does not have this remote datafinder set up, the script brings up a message box that says "The data store ... does not exist." and then proceeds merrily along, using the user's default DataFinder. 
 
Is there a way to check beforehand if that user has this datafinder set up so I can automatically install a URF export of the DataFinder?  Or even some way to prevent the script from continuing after the message box? 
 
Thank you!
Julia
0 Kudos
Message 1 of 3
(3,533 Views)

Hello Julia,

This connection command should throw an error if it doesn't properly connect to a DataFinder, but unfortunately it currently does not.  We will work on this for future versions of DIAdem. 

The best workaround is to try to connect to the remote DataFinder and then test to see if the connection was made by comparing the name of the current DataFinder to the known value of the remote DataFinder.  We can then use some programming logic, like the If statement below, to control what happens if we do not properly connect.

Dim DataFinderName
DataFinderName = "RemoteDataFinder"
Navigator.Display.OpenDataFinder(DataFinderName)
If Navigator.Display.CurrDataProvider.Name <> DataFinderName Then
...
End If

 

John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,500 Views)

That will work - thank you!

0 Kudos
Message 3 of 3
(3,496 Views)