DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Query Data Finder Server with ActiveX

I haven't been able to find much resources on how to use ActiveX to Query a Data Finder Server.  I know that this is all supposed to be done with the ToCommand but I have no idea how it is done beyond this.  Can someone give me some direction as to what commands are needed to Open a Data Finder, Create a Query, Merge Queries, and get resulting file paths?

 

Thanks,

David Vanleeuwen

0 Kudos
Message 1 of 11
(7,495 Views)

Hi Djvanlee,

 

So they are not ActiveX commands, you would use VBScript Commands with a ToCommand reference writing to DIAdem through invoke nodes.  Are you using LabVIEW with the ToCommand reference?  

 

An example of this can be found by opening up the DIAdem - Example Finder by going to Help>>Examples and it will be on the Context tab under the directory Examples>>Create Scripts>>Using Interfaces>>Controlling DIAdem from LabVIEW.  Then the commands can be found in the DIAdem Help on the Contents tab by going to Programming Reference>>Object Oriented Script Interfaces>>DIAdem NAVIGATOR>>Methods.  The methods you would reference are labeled as <DataFinder>.  It looks like the main commands you would need are:

 

ConnectDataFinder()

CreateQuery()

Load Query()

SaveQuery()  \\Note when you save the query you will have to indicate the path.

 

If you are looking for a good example of programmatically using the DataFinder in the script tab in DIAdem you can find this in the ExampleFinder on the Contents tab at "Extending Functionalities with Scripts>>Context Menu for the Search Results of the DataFinder".  The ResultsList_Menus_Add.VBS connects to the DataFinder programmatically and loads a query.

 

 

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(7,451 Views)

I'm still having trouble getting these commands to work.  I am working in LabVIEW currently although I am just trying to determine the commands we will need so that we can use them in MATLAB.

 

I keep getting the message Undefined command "Command".  I have tried the following commands:

 

ConnectDataFinder("TestDataFinder@<serverName>")

Navigator.ConnectDataFinder("TestDataFinder@<serverName>")

Navigator.Display.OpenDataFinder ("TestDataFinder@<serverName>")

Navigator.ConnectDataFinderByParameter("<serverName>","TestDataFinder",5,5)

 

Some of them worked in the VBScript tab in DIAdem but I have not been able to get them working in LabVIEW.

 

 

 

 

0 Kudos
Message 3 of 11
(7,412 Views)

Hi David,

 

You can not communicate directly from MatLab to the standard DataFinder.  The Navigator object you are prototyping code with only functions within a DIAdem VBScript.  If you have paid for an ASAM-ODS server API on top of the DataFinder then you can communicate with it using CORBA, otherwise you can only communicate directly with the DataFinder from DIAdem or LabVIEW.  Both DIAdem and LabVIEW have ActiveX servers that you can address from MatLab, but that would require installing either DIAdem ($$) or the LabVIEW DataFinder Toolkit ($) on each computer that communicates with the DataFinder.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 11
(7,398 Views)

Thanks for your response.  We have enough DIAdem and DataFinder Toolkit licenses that this wouldn't be a problem.  So if I didn't want to purchase the version of Data Finder Server with ASAM-ODS, I would need to call either my LabVIEW Data Finder ToolKit or DIAdem through ActiveX to communicate with my DataFinder server?

 

Which would most likely be simplier? Also, are there any examples on how to do this?  If I did this through DIAdem, would I need to call a VBScript since the DataFinder commands cannot be used outside of DIAdem?

 

Thanks,

David VanLeeuwen

 

LabVIEWActiveXDataFinder.png

 

0 Kudos
Message 5 of 11
(7,389 Views)

Hi David,

 

Correct, you'll either need to call LabVIEW to use the DataFinder Toolkit or call DIAdem to run a VBScript with the Navigator object.  I'd recommend you choose based on whether you're more comfortable with graphical programming or text based programming.  Here's an example of some ActiveX calls you can make to interact with DIAdem.  

 

Set ToCommand = CreateObject("DIAdem.ToCommand")
Set ToDataSheet = CreateObject("DIAdem.ToDataSheet")
ToCommand.CmdExecuteSync("WndShow('NAVIGATOR')")
Call ToDataSheet.ChnNameGet(1, ChName)
Set ToCommand = Nothing
Set ToDataSheet = Nothing
MsgBox ChName

 

You can also search in the DIAdem Help system under "ToCommand" or "ToDataSheet", the names of its two ActiveX servers.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 11
(7,387 Views)

Hi David,

 

In order to tell DIAdem through ActiveX to call a VBScript, use the following syntax:

 

ToCommand.CmdExecuteSync("ScriptStart('Full_Path_To_VBS_File')")

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 7 of 11
(7,385 Views)

Hi David,

 

I'm wondering wether it might be an alternative to stay in DIAdem and create a nice and compelling UI (using SUD) and control MATLAB from their through MATLAB's Automation interface (just thinking).

 

Greeitngs from sunny Aachen

Stefan

0 Kudos
Message 8 of 11
(7,366 Views)

We've considered using DIAdem more but our MATLAB tool is solid for looking at multiple data files quickly.  We just wanted to be able to search multiple TBs of files easily and so I'm trying out Data Finder Server.  Switching over to using DIAdem as the interface would also take quite a bit more development time, which is not necessary with the quality of our current tools.

 

Brad,

Thanks for all the responses. I've been able to make quite a bit of progress writing a VBScript to search my data finder server that could be called through ActiveX.  Do you know of a way to pass in parameters into the VBScript using ActiveX and get results back?

0 Kudos
Message 9 of 11
(7,342 Views)

Hi David,

 

If you mean that you are calling a DIAdem VBScript from MatLab by addressing the DIAdem ActiveX server, then you can set global variables in DIAdem through that same mechanism, or you can use file I/O or environment variables.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 10 of 11
(7,307 Views)