How to connect Xmath to DIAdem
Overview
DIAdem offers a wide variety of ways to easily analyze and present large data sets, however there are a number of reasons why you may want to use Xmath to perform analysis on DIAdem data. You may want to take advantage of the powerful built-in Xmath analysis functions or to use legacy Xmath algorithms that you or others have developed.
Description
Connectivity between Xmath and DIAdem
The Xmath Connectivity interface is a free addition to DIAdem which enables users to interact with Xmath while fully utilizing DIAdem features such as reading/writing the database and file formats supported by DIAdem’s PlugIns. Through DIAdem’s scripting interface, users pass data between DIAdem and Xmath and can execute command line instructions.
The Xmath DIAdem Connectivity interface in DIAdem makes it easy to quickly interface with Xmath scripts, using variables to expose the inputs and outputs. The advantage of this approach is that no additional Xmath programming is needed if the interface supports the data types that you are interested in accessing.
The GPI interface
The DIAdem Custom Palettes toolset is a General Programming Interface (GPI) extension. DIAdem uses GPI to call DLLs that can be used to expand the standard DIAdem functionality. For example, a DLL can contain new variables, commands, or drivers.
Software requirements
· DIAdem 9.0 or higher
· XP, Windows 2000 or Windows NT
Interface installation and registration
The Xmath interface is a GPI DLL. To be able to use the function, you must first register DDXmath.dll thru Diadem, which you can do using the following instructions:
To register the extension DLL:
1. Copy DLL (We suggest under ...\DIAdem\AddInfo\)
2. Start DIAdem
3. Select Windows » Close all to close all DIAdem windows.
4. Select Settings » GPI-DLL Registration.
5. Click Add.
6. Select DDXmath.dll in the dialog box DLL-Selection .
7. Click Open.
8. Click Close.
9. Specify that you want to save the GPI extension in a desktop file.
10. Select the file desktop.ddd.
11. Click Save.
12. Click Yes, to overwrite the desktop file. DIAdem closes the program and automatically starts the program again. If the selected GPI extension is a valid GPI-DLL, you can now use this GPI extension.
Congratulations, you have registered your Xmath interface successfully!
Description of API
XMathStatus - Xmath error status from the last performed interface command
XmathStart() - This command initializes the Xmath engine and instantiates in the background an instance of Xmath.
XmathStarParam – (optional) Text variable that enables the passage of parameters to XmathStart.
XmathStop - This command deinitializes the Xmath engine and should be called always when the script is finished.
XmathSet(DDEntityName,XmathEntity) - Command responsible to pack either a DIAdem group or channel into a Xmath array. DDEntityName determines what channel or group is intended to be passed and can be either in numeric or textual format. XmathEntity is the name of the Xmath array (within the Xmath environment) the data will be assigned to.
XmathGet(XmathEntity,DDEntityName) - - Command responsible to pack a Xmath array and send it back to DIAdem. XmathEntity determines what Xmath array is intended to be passed. DDEntityName is the name of the new DIAdem group to be created (within the DIAdem environment, precisely in the data portal).
XmathExecute(Commandline) - Executes any command line instruction in the Xmath environment.
Examples
Go to DIAdem Auto and paste the following script in order to see the interface working:
'---------------------------------------
XmathStart
if XmathStatus = 0 then
XMathSet "[1]/[2]", "SecondChannel"
XMathGet "SecondChannel","my result chn"
XMathSet "example","DDGroup"
XMathGet "DDGroup","my result group"
else
msgbox "Error!"
end if
XmathStop
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
