DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Load Events with multiple databases

We have multiple databases that are setup differently.  I need to handle data being loaded, and I am using the load events (OnLoading, and OnLoaded), but I don't quite know how to tell which database the data is coming from. Any suggestions?  

0 Kudos
Message 1 of 6
(4,232 Views)

You can use

Navigator.Display.CurrDataStore.Name

in case you have registered your DataStore to DIAdem - such known by name.

 

In case you connected the DataStore by parameter, you can use:

Dim tempDataStore : Set tempDataStore = Navigator.Display.CurrDataStore.GetDataStore()
MsgBox tempDataStore.Parameters
Set tempDataStore = Nothing

 

(You can get that same parameters for registered DataStores using : Navigator.Settings.RegisteredDataStores(Name).Parameter)

0 Kudos
Message 2 of 6
(4,219 Views)

Hi Russell,

 

If you're loading data from a data base, why aren't you issuing SQL queries to retrieve the desired records and add them as new channels in the Data Portal?  In that case you don't need a load event.

 

Are you really dragging and dropping data from a data base or using a DataPlugin with DataFileLoad() to load data from a data base?!

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 6
(4,193 Views)

I'm using Navigator.LoadData to get the data from the ASAM datastore.  I've never tried to use SQL queries... 

 

here were a couple things that lead me to use the events, first was that I wanted properties to load consistently, regardless of how they are loaded, ie, through the simple GUI I created, through the Navigator GUI, or if I call the LoadData method.  Second, and bigger reason, there were some properties that needed to be imported across database levels.  For example, there is a key that ends up at the root level when loading data with loading configurations, so I use the events to move this key to the group level.  There are a couple of other things like this.  

 

Does this seem like a valid reason?  

0 Kudos
Message 4 of 6
(4,187 Views)

If you combine

 

Navigator.Events.OnDataStoreLoading

with

 

 

Navigator.Events.OnInteractionLoading
Navigator.Events.OnInteractionLoaded

you can determine if the load command was done by Navigator or your script.

 

 

So if you set

 

navigator.Display.CurrDataStore.GetDataStore

to a global variable in OnInteractionLoading and set it back to nothing on OnInteractionLoaded you will be able to fuígure out which store belongs to your elements.

 

0 Kudos
Message 5 of 6
(4,164 Views)

Hi Russel,

 

Never mind.  An ASAM-ODS database uses a completely different API from an open SQL database.  You definitely want to use the ASAM-ODS (AOP5) DataPlugin to read data from that.  You can even use the query tools and advanced tree view browsing tools in the NAVIGATOR, which are NOT available for open SQL databases.

 

I'll leave you in Andreas' capable hands,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 6
(4,141 Views)