![]() |
Adding New Keywords to NIRC-2 | ![]() |
It is straightforward to add new keywords to the NIRC-2 motor or IO daemon keywords (service "nirc2"). Such keywords can be written and read, although they will not have any functionality within the keyword library itself. (E.g. they will not move any motors.) They do provide a convenient place to store information in a session-independent manner. This differs from the use of environment variables, in that the set of environment variables can be different on different xterms, for example.
Note that there are already some placeholders for "user variables": USERVAR1 through USERVAR10, USERFLT0 through USERFLT2, USERINT0 through USERINT2, USERSTR0 through USERSTR2, and USERAVAR, USERDVAR, and USERMVAR. However, long term solutions may require creation of keywords with more descriptive names.
To add a new keyword you must edit the file:
/home/nirc2eng/motor_config/nirc2_config_file
on waikoko. You can add a line containing the new keyword to this file. The column headings are explained within the file. Once the keyword is created, it is immediately available to write into. To read the variable requires you to first write into it, to initialize it.
You should also create a default value (i.e. the first, initialization "write") so that the keyword has a value upon startup. This is done as the user nirc2dev in the file:
/kroot/kss/nirc2/mech/keyword/nirc2_motor_defaults_script
This file contains a set of lines that initialize various keywords. The lines look like:
set_prop_string KEYWORD value
which will set the initial value of "KEYWORD" to "value". Note that "value" must be of the right form (string, float, or integer) for the keyword, as defined in column 6 of the nirc2_config_file.
| Go To: | ||||
| Instruments Home Page |       | Keck Home Page |       | Observer's Reference Shelf |
NIRC2 Master
4 March 2002