[Next] [Previous] [Up] [Top] [Contents] [Index]

Chapter 9 DM: Run-time Operation

2. Running DM

2.1. Setting Your Path

Usually, you will start DM from an EPICS application directory (usually called appl, or apple or something similar), and this directory will have a link to an <epics-extensions>/bin directory, which is a subdirectory of a directory that contains all the EPICS applications and programs for a certain EPICS release (3.11, 3.12, etc.). Thus, there are more than one <epics-extensions>/bin directories, and some of these directories have differing versions of DM. The link should point to the <epics-extensions>/bin directory that has the version of DM that is compatible with the display list files in the application directory. Thus, you do not need to set your path in your UNIX start-up files (.login and .cshrc, for instance). In fact, you should not, sometimes, because in some systems there are different application directories to control different EPICS systems or sub-systems. The application directories may point to different <epics-extensions>/bin directories that may have different versions of DM, the version compatible with the display list files in it. If you do work on more than one of these subsystems, you want to run the DM version that is compatible with the display list files you are going to be using, so you definitely don't want to set your paths to an <epics_extensions>/bin directory.

You may, however, want to place the path to a version of DM in your UNIX start-up files. You will find the latest version of DM in the <epics_extensions>/bin subdirectory of the latest EPICS release. The <epics_extensions>/bin directory may have several sub-directories for different platforms (sun4, for instance). In one of these you will find the version of DM you want. Put the absolute pathname of that version into one of your start-up files. The set path command may look like this:

%set path = (/usr/epics/epics/extensions/bin/sun4 $path)
Whatever the case, if you are uncertain about different versions of DM and how to set your paths to the correct version, ask your system administrator for assistance.

2.2. Setting Your Environment Variables

There are two environment variables you may need to set before you run DM: the EPICS_DISPLAY_PATH and the PSPRINTER environment variables.

The EPICS_DISPLAY_PATH variable specifies where DM searches for the start-up display and related display files, and imported images. The start-up display is the display that you specify on the command line when you start DM. There are two types of related displays: color template files and displays whose files are invoked by a related display callup object. Chapter 3, Working With Templates And Color Rules, explains color templates, what they are, how to use them, and what they are useful for, so they will not be discussed at length here. It will suffice to say that a display references a color template file in the 'external color palette display name' in its Display Attribute window.

Displays can be referenced by their path names, so they do not need to be in your EPICS display path. Still, life is made easier if files can be referenced by their simple pathnames. In the EPICS_DISPLAY_PATH variable you can specify a list of directories that EDD will search for files when they cannot be found in the current directory. Usually, you will only want to specify relative UNIX pathnames and/or use the directory abbreviations understood by the UNIX shells, such as the '.' for the current directory, the '~' for a home directory, or '. .' for the directory containing the current directory. Remember that you usually will be running DM from an EPICS application directory and that display files are often placed in a display file directory, dl/ for instance. So your set-environment command may look like this:

%setenv EPICS_DISPLAY_PATH ".:./dl:..:"
The directory list is enclosed in quotes and the directories are separated by a colon. This environment variable causes DM to search in the current directory ('.'), the display list directory in the current directory ('./dl'), and the directory that contains the current directory ('..').

You may want to set your PSPRINTER environment variable if you are going to print displays. The PSPRINTER variable specifies the name of the PostScript printer in your system. DM can print displays only on PostScript printers. As of version 2.3, you can also choose your printer by choosing the Select Printer option under the Options submenu of the DM window. The DM window is the window that appears whenever DM is run.

2.3. Setting your X Defaults

There are two X defaults that you can specify which change the behavior of the text-entry object. These resources do not apply to DM versions prior to 2.2.

In versions of DM prior to 2.2, when a user entered a new value in a text-entry object, the value was sent when the object was no longer selected. When the value was sent, but for some reason the value of the channel was not changed, the object displayed was the value as entered, not the current value of the channel. As of version 2.2, the default behavior of the text-entry object has changed. Now, the user must press Enter or Return in order to send the value to the channel. When the object is no longer highlighted, the displayed value reflects the current value of the channel, which may be the value last entered or another value if the value could not be changed or Return/Enter was not pressed.

By setting the default Dm.teTimeout to anything greater than 0.0 such as 1.0, the value of the text-entry object will display whatever the user has entered even though the user has not pressed enter and the object is no longer highlighted. Thus, to change the default behavior, add the following line to your .Xdefaults file:

Dm.teTimeout:       1.0
where 1.0 can be any non-zero value.

The second X default you can change is Dm.teUpdate. The current default behavior of text-entry objects is to update the value of the object with the current value of the channel only when the mouse is not inside the object, i.e., when the object is not highlighted. As of DM version 2.2, you can change this behavior by setting the value of this X default to True, as in the following:

Dm.teUpdate:        True
If this default is set to False or is not specified at all in your .Xdefaults file, text-entry objects will be updated only when they are not highlighted.

In addition, as of version 2.4, DM can size displays proportionally, taking into account the ratio between the pixel size of the display and the resolution of the monitor, instead of just the display's pixel size. In addition, as of version 2.4, DM can resize the objects within a display when the display is resized. To add these capabilities, set Dm.propResize to True in your .Xdefaults file:

Dm.propResize True

2.4. Running DM

Starting DM is a simple matter. Simply type dm with or without specifying a display file and the macro expansions for that file. The DM window will appear (Figure 9-1), along with the display that you specified.

2.4.1. The DM Window

The DM window has three menus: File, Options, and Help, though the Help menu currently has no available options. Under the File menu is the Open Display option. Choosing this option brings up a dialog box in which you can specify a display to open. You can choose a file in the Files box, move to a different directory in the Directories box, or specify a file by name in the Selection box. Note that you can expand none of the macros in the display if you open it using this dialog box. You can, however, expand any macros by specifying the display and any macros from the command line. A brief explanation of macros, their purpose, appears in the following section, Expanding Macros from the Command Line.

The DM Window

Under the Options menu is the Select Printer option with which you can bring up the dialog box shown below. In this box, you can select the printer to which an image dump of the current display will be sent when a user selects Print from the display manager menu or left-clicks on a print display button. However, if print to file is chosen, the image dump will be spooled to the file specified in the File Name field, instead of to the printer. The print options dialog box can be brought up at run-time by right-clicking on a print button or by left-clicking on a print options button.

Select Printer Dialog Box.

2.4.2. Expanding Macros from the Command Line

In an EPICS context, channels refer to records and fields within those records. As of R3.13 and the implementation of the Channel Access Portable Server, a channel can refer to any process variable in a system. Within the same TCP/IP subnet, each channel name must be unique. When a display is configured, a dynamic object specifies a channel that it will connect to at run-time when the display is opened in DM. In EPICS, the channel name usually consists of a record and a field name separated by a period. When a channel name specifies only the record and omits naming a field, the VAL field of the record is accessed. Channel names are always case sensitive. An example of an EPICS database channel might be,

It is often desirable to use an object in a display to connect to a different channel each time the display is opened. To use an object or all the objects in a display to connect to a variety of channels, instead of reconfiguring the display by going into each object's property sheet and changing the name of the channel, a display can be configured to have macro substitution string in place of a channel name or part of a channel name. You can then replace the macro with an actual name or name component when you open the display. Actually, the macro replacement string will replace every instance of the substitution variable, not just in channel names--in the titles of menus, in the text string of a text object, etc.

When you start DM with a display that uses macros, you can replace the macro on the command line. Before version 2.4, a display could only have up to eight macro replacement strings. As of version 2.4, the number of macros aren't limited, though each must be unique.

As an example of macro replacement, if a display called process2.dl uses the macros $(chan1), $(chan2), and $(chan3); the command line to start that display would be,

dm process2.dl chan1=analog_out,chan2=binary_in,chan3=steppermotor3
You can see from this command line that when you replace more than one macro, you must separate them by commas, but you must not use any spaces between the commas and the replacement string that follows it. There is no space separating the comma from chan2, or chan3 in the example. Remember this, because when you fail to format the macro expansions properly, only the first replacement string will work, the rest will be ignored, and no message will appear on the command line to tell you why some of the channels on the display are not connected.
NOTE: You cannot specify more than one display to open from the command line.

As of 2.3, you can open more displays by using the Open Display option in the File menu. Remember that macros cannot be expanded for a display when you open displays this way, only from the command line. If you need to open another display and expand the macros in it, you will have to do it from the command line, starting another DM process. The recommended method, however, is to use related display callup objects to open other displays as these objects can be configured to expand macros in a display when the display is chosen from their menus. Note that related display objects are configured in EDD to open the specified displays with the specified macro expansions. You cannot choose just any display, but only the ones in the object's menu.

2.1. - Setting Your Path
2.2. - Setting Your Environment Variables
2.3. - Setting your X Defaults
2.4. - Running DM
2.4.1. - The DM Window
2.4.2. - Expanding Macros from the Command Line

EDD/DM User's Manual, 2.4 - 27 MARCH 1997
[Next] [Previous] [Up] [Top] [Contents] [Index]

| LANL | Lansce | UC | DOE |

L O S   A L A M O S   N A T I O N A L    L A B O R A T O R Y
Operated by the University of California for the US Department of Energy

Copyright 1996 UC   Disclaimer   

For problems or questions regarding this web site contact George Vaughn.