Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: May 11, 2007


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

How can I create a non-modal dialog with menus (Custom Palette) in DIAdem?

9 ratings | 2.22 out of 5
Print

Overview

Custom palettes improve ergonomics and ease of use by organizing and presenting frequently used scripts and functions in a way that makes the most sense to the user.

Custom user interfaces in DIAdem

Custom Palettes

The Custom Palettes Toolset allows you to easily create Palettes and Menus capable to control DIAdem and expand its functionality. The Palettes give the user the ability to call functions, run scripts, set properties, etc.
Palettes improve usability grouping function family’s or even scripts based on user characteristics and or requests.
An ergonomic Palette can be a valuable help to users that are not familiar with DIAdem or need to operate thru a complex sequence of steps for certain processes.




Using as your own "My Favorites" Palettes


The custom Palettes allows the customization of the DIAdem environment according specific needs and preferences. If there are certain operations commonly performed depending on user characteristics, the custom palette can be created to perform them. This gives the user easy access to specific functions or script operations.

Technical background


The custom Palettes uses the concept of elements and groups.

An Element is an item associated to some action.
A Group is an object responsible to gather multiple elements or even other groups.
Once relationships are set up, groups and elements can be displayed as a non modal dialog. If the displayed main group has other group as one of its items this other group elements will be shown as sub-menus, demonstrating on an intuitive way the hierarchy. There is no theoretical limit for the number of subgroups.

The GPI interface


The GPI (General Programming Interface) is the DLL user interface for DIAdem. It
can be used to program DLLs, which extend various areas of standard functions in DIAdem. Extension DLLs can contain any number of DIAdem extensions,
e.g. additional variables, commands and file I/O drivers . The GPI also provides engineers developing DIAdem extension DLLs with a number of service routines. They contain Help functions and allow communication with DIAdem.With GPI you may expand DIAdem on the most different ways.

Examples


After the GPI dll is registered, run the following script in the script editor. The icons for the dialog are provided as bitmaps. The bitmaps are required to be in the same directory as the script itself.

'First Create Groups
call cp_creategroup("Data handling","file_b.bmp")
call cp_creategroup("Math","file_b.bmp")

'Then create the functional elements
call cp_createelement("RMS","RMS.bmp","CHNRMS(""Time"",""Speed"",""Y_root_mean"",10)")
call cp_createelement("FFT","FFT.bmp","CHNFFT1(""Time"",""3"")")
call cp_createelement("Demo GRAPH","graph.bmp","scriptstart(""demo.vbs"")")

'Now define the hierarchy

'Add the Math group to the Data Handling group
call cp_AddToGroup("Data handling","Math")

'Populate the sub groups of Math
call cp_AddToGroup("Math","RMS")
call cp_AddToGroup("Math","FFT")
call cp_AddToGroup("Data handling","Demo GRAPH")

'Display the Data Handling group to launch the dialog
Call cp_showgroupdlg("Data handling")

Here is the result:

Software requirements

  • DIAdem 9.0
  • XP, Windows 2000 or Windows NT

    Installation

The Custom Palettes component interfaces with DIAdem as GPI dll. To be able to use the function, you must first register CustPlt.dll.dll thru Diadem. Refer to the help topic GPI-Extensions, Registration for information on how to register a GPI DLL with DIAdem

Troubleshooting


To be able to run the Diadem scripts, this component makes use of Diadem’s ActiveX interface. If you notice multiple instances of Diadem launching when running this tool, you will need to disable Diadems instancing option from the registry.

1. Go to Start >> Run and type in regedit
2. Search for the keyword instancing
You should find at:
[HKEY_CLASSES_ROOT\CLSID\{285E4FB2-F633-11D1-85DC-008048D9A408}\StartParameter
3. Set the Instancing key to 0.
4. Reboot.

This will allow us to reuse the same instance of Diadem for any script operation that we may run using the custom palette.

Downloads

custompallet.zip

9 ratings | 2.22 out of 5
Print

Reader Comments | Submit a comment »

Can't find GPI dll; interface description incomplete
The GPI dll mentioned in the text of this document doesn't appear to be installed with DIAdem. I also can't find a download link in the document where I might download the GPI dll. There is no formal interface description in this document. I'd expect some kind of documentation which contains a complete list of the functions and a description of each of their parameters.
- Dec 8, 2004

bad title and missing download link
the document title suggests that SUDs can be used in a non modal way which is definitly wrong there is no download link to get the tool from
- Dec 8, 2004

 

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/).