03-26-2014 05:37 PM
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
03-27-2014 02:03 PM
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.
03-31-2014 06:58 PM
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.
04-01-2014 08:07 AM
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
04-01-2014 11:04 AM
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
04-01-2014 12:09 PM
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
04-01-2014 12:20 PM
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
04-02-2014 04:23 AM
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
04-02-2014 07:34 PM
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?
04-04-2014 11:43 AM
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