Documentation:Reference:TCL 1 - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search
MDSplus Documentation: TCL (Tree Command Language)

INDEX
Next Chapter of TCL Commands
MDSplus Document List


Contents

DECOMPILE

Displays data contained in the node in decompiled expression format.
Format: DECOMPILE nodename

DEFINE

Define a command macro (see HELP mdsdcl_features macros)
or
Associate an equivalence string and a set of attributes with a key on the terminal keyboard (see /KEY).

DEFINE [/EDIT] macro-name

Defines a command macro.
Parameters:
macro-name
The name of a command macro. The string can contain from 1 to 32 characters.
command-qualifiers
/EDIT
The edit qualifier invokes the EDT editor to define a macro procedure.
Examples
1. > DEFINE FOO
DEFMAC> WAIT 0:00:05
DEFMAC> TYPE I''ve just waited 5 seconds
DEFMAC>
> FOO
(pause)
I've just waited 5 seconds
The DEFINE command creates the macro FOO. Since the /EDIT qualifier was not present the macro definition utility prompted for macro lines. Prompting continues till a return with no input is entered. To execute the macro you can just type the macro name.

DEFINE/KEY key-name equivalence-string

Associates a key on the terminal keyboard to a string. The /KEY qualifier is required.
Parameters:
key-name
Specifies the name of the key that you are defining. The following table gives the key names in column one. The remaining three columns indicate the key designations on the keyboards for the three different types of terminals that allow key definitions. All definable keys on VT52 terminals are located on the numeric keypad. On VT100-type terminals you can define the four arrow keys as well as all the keys on the numeric keypad. There are three types of keys that can be defined on terminals with LK201 keyboards: (1) keys on the numeric keypad, (2) keys on the editing keypad, and (3) keys on the function key row across the top of the terminal. (Note that you cannot define function keys F1 through F5.)
Key-name LK201 VT100-type VT52
PF1 PF1 PF1 [blue]
PF2 PF2 PF2 [red]
PF3 PF3 PF3 [gray]
PF4 PF4 PF4 - -
KP0, KP1, ..., KP9 0, 1, ..., 9 0, 1, ..., 9 0, 1, ..., 9
PERIOD . . .
COMMA , , n/a
MINUS - - n/a
ENTER Enter ENTER ENTER
LEFT <--| <--| <--|
RIGHT <--| <--| <--|
E1 Find - - - -
E2 Insert Here - - - -
E3 Remove - - - -
E4 Select - - - -
E5 Prev Screen - - - -
E6 Next Screen - - - -
HELP Help - - - -
DO Do - - - -
F6, F7, ..., F20 F6, F7, ..., F20 - - - -
Some definable keys are enabled for definition all the time. Others, including KP0 through KP9, PERIOD, COMMA, and MINUS, may need to be enabled for definition purposes. You must issue the SET KEY/APPLICATION command before using these keys if a SET KEY/NUMERIC has been issued.
equivalence-string
Specifies the string which is to be processed when you press the key. If the string contains any spaces, enclose the equivalence string in quotation marks.
Command_Qualifiers
/ECHO
/NOECHO
Determines whether or not the equivalence string is displayed on your screen after the key has been pressed. The default is /ECHO. You cannot use /NOECHO with the /NOTERMINATE qualifier.
/IF_STATE=(state-name,...)
/NOIF_STATE
Specifies a list of one or more states, one of which must be in effect for the key definition to be in effect. If you omit the /IF_STATE qualifier or use /NOIF_STATE, the current state is used. The state name is an alphanumeric string. States are established with the /SET_STATE qualifier or the SET KEY command. If you specify only one state name, you can omit the parentheses. By including several state names, you can define a key to have the same function in all the specified states.
/LOCK_STATE
/NOLOCK_STATE
Specifies that the state set by the /SET_STATE qualifier remain in effect until explicitly changed. If you use the /NOLOCK_STATE qualifier, the state set by /SET_STATE is in effect only for the next defineable key that you press or for the next read terminating character that you type.
The default is /NOLOCK_STATE. The /LOCK_STATE qualifier can only be specified with the /SET_STATE qualifier.
/LOG
/NOLOG
Controls whether the system displays a message indicating that the key definition has been successfully created. The default is /LOG.
/SET_STATE=state-name
/NOSET_STATE
Causes the specified state-name to be set when the key is pressed. The state name can be any alphanumeric string.
If you omit the SET_STATE qualifier or use /NOSET_STATE, the current state that was locked remains in effect. If you have not included this qualifier with a key definition, you can use the SET KEY command to change the current state.
/TERMINATE
/NOTERMINATE
Specifies whether or not the current equivalence string is to be terminated (that is, processed) when the key is pressed. The default is /NOTERMINATE, which allows you to press other keys before the equivalence string is processed. Pressing RETURN has the same effect as using /TERMINATE.
The /NOTERMINATE qualifier allows you to create key definitions that insert text into command lines, after prompts, or into other text that you are typing.
Examples
1. $ DEFINE/KEY PF3 "SHOW KEY/ALL" /TERMINATE
%DCL-I-DEFKEY, DEFAULT key PF3 has been defined
The DEFINE/KEY command defines the PF3 key on the keypad to perform the SHOW KEY/ALL command. DEFAULT refers to the default state. 2. $ DEFINE/KEY PF1 "SHOW " /SET_STATE=GOLD/NOTERMINATE/ECHO
%DCL-I-DEFKEY, DEFAULT key PF1 has been defined
$ DEFINE/KEY PF1 " MACRO" /TERMINATE/IF_STATE=GOLD/ECHO
%DCL-I-DEFKEY, GOLD key PF1 has been defined
The first DEFINE/KEY command defines the PF1 key to be the string SHOW. The state is set to GOLD for the subsequent key. The /NOTERMINATE qualifier instructs the system not to process the string when the key is pressed. The second DEFINE/KEY command defines the use of the PF1 key when the keypad is in the GOLD state. When the keypad is in the GOLD state, pressing PF1 will cause the current read to be terminated.
If you press the PF1 key twice, the system displays and processes the SHOW MACRO command.
The word DEFAULT in the second line of the example refers to the fact that the key PF1 has been defined in the default state. Note the space before the word MACRO in the second DEFINE/KEY command. If the space is omitted, the system fails to recognize MACRO as the keyword for the SHOW command.
3. $ SET KEY/STATE=ONE
%DCL-I-SETKEY, keypad state has been set to ONE
$DEFINE/KEY PF1 "ONE"
%DCL-I-DEFKEY, ONE key PF1 has been defined
$DEFINE/KEY/IF_STATE=ONE PF1 "ONE"
%DCL-I-DEFKEY, ONE key PF1 has been defined
The above two :Examples both define the PF1 key to be "ONE" for state ONE. However, the first method is somewhat error-prone in that it is possible to forget which state you are in, and to define a key for a state other than you intended. The second example eliminates this possibility by specifying the state in the same command as the key definition. This is the preferred method for defining keys.

DELETE

The DELETE command perform the following functions:
o Delete key definitions established by the DEFINE/KEY command (see /KEY).
o Delete a node
o Delete a pulse file

DELETE NODE

Deletes a node from a tree.
Format: DELETE NODE nodename [/LOG] [/NOCONFIRM]
This command will delete the node named in the nodename parameter from the currently open tree.
NOTE: The tree must be open for write (EDIT) to use this command. See EDIT vs SET TREE.
Parameters
node_name - the name of the node to remove from the tree.
Qualifiers
/LOG
Log the name of the nodes deleted
/NOCONFIRM
Do not prompt for confirmation.

DELETE PULSE

Delete a pulse file.
Format: DELETE PULSE shot_number [/ALL]
Parameters
shot_number - specifies which pulse file to delete
qualifiers
/ALL
Specifies to delete all versions of pulse files with the specified shot number. If omitted, only the last version found is deleted.
/KEY
Deletes key definitions that have been established by the DEFINE/KEY command. The /KEY qualifier is required.
Format: DELETE/KEY [key-name]
Parameters
key-name
Specifies the name of the key whose definition you want to delete.
Command_Qualifiers
/ALL
Specifies that all key definitions in the specified state be deleted. If you use the /ALL qualifier, do not specify a key name. If no state is specified, all key definitions in the current state are deleted. Use the /STATE qualifier to specify one or more states.
/LOG
/NOLOG
Controls whether messages are displayed indicating that the specified key definitions have been deleted. The messages are displayed by default.
/STATE=(state-name[,...])
/NOSTATE
Specifies the name(s) of state(s) for which the specified key definition(s) are to be deleted. If you specify only one state name, you can omit the parentheses. State names can be any appropriate alphanumeric string.
If you omit the /STATE qualifier or use /NOSTATE, key definitions in the current state are deleted.
Examples
1. $ DEFINE/KEY PF3 "SHOW MACRO" /TERMINATE
%DCL-I-DEFKEY, DEFAULT key PF3 has been defined
$ DELETE/KEY PF3
%/DCL-I-DELKEY, DEFAULT key PF3 has been deleted
The DEFINE/KEY command defines the PF3 key on the keypad to perform the SHOW TIME command. Later, you use the DELETE/KEY command so that the PF3 key no longer has a definition. Now when you press that key, only the system prompt appears.
2. $ DELETE/KEY/ALL
%DCL-I-DELKEY, DEFAULT key PF1 has been deleted
%DCL-I-DELKEY, DEFAULT key PF2 has been deleted
%DCL-I-DELKEY, DEFAULT key PF3 has been deleted
%DCL-I-DELKEY, DEFAULT key PF4 has been deleted
$
This example assumes that you had defined keys PF1 through PF4 in the default state. The DELETE/KEY command deletes all key definitions in the current state, which is the default state.

DIRECTORY

Lists out all of the nodes which match a given path specification.
Format: DIRECTORY path_name
QUALIFIERS
/FULL
/NOFULL (D)
Specifies whether all additional information about the node should be displayed (for now this the list of tags associated with the node)
/PATH
/NOPATH
Specifies whether or not the full path names of all of the nodes which are found should be displayed.
/TAG
Lists out all of the tags which match a given wildcard tag specification. if a tree is specified (to the left of '::' then only sub_trees matching the tree specification will be searched.
Format: DIRECTORY/TAG tag_spec [,tag_spec...]
Parameters
tag_spec - a tag specification containing optional VMS wildcard characters.
default - :*::*
Examples
1: List all of the tags in all of the subtrees of the current tree.
TCL> DIR/TAG
2: List all of the tags in all of the subtrees of the current tree which contain the string 'MAGNET'.
TCL> DIR/TAG *MAGNET*
3: List all of the tags which start with CHAN_ in subtrees whose names start with DIAG.
TCL> DIR/TAG :DIAG*::CHAN_*
Parameters
path_name - a path name optionally containing wild cards specifying which nodes to look for. See HELP SPECIFY PATH_NAME for more information on wild card path names.
default - *

DISPATCH

Dispatch an action node to a server for execution
Format:
DISPATCH[/NOWAIT] action-node-spec
DISPATCH/BUILD
DISPATCH/CHECK[/RESET]
DISPATCH/COMMAND/SERVER=server-name[/WAIT][/TABLE=table] command
DISPATCH/PHASE phase-name

DISPATCH/BUILD

Build a dispatch table.
qualifiers
/TABLE=table
Specify command table which contains the commands. Defaults to "TCL".

DO

Execute a node if it is either a TASK or ACTION.
Format: DO nodename
/METHOD
Perform a method on a node (usually nodes which are parts of devices).
Format: DO/METHOD nodename method
DO /METHOD will perform the specified method on the specified node. By default it will only do this if the node is ON. The /OVERRIDE and /IF qualifiers can be used to control the execution of the method.
EXAMPLE:
DO/METHOD MY_DIGITIZER STORE
/OVERRIDE
Format: DO/METHOD nodename method /OVERRIDE
The override qualifier will cause DO/METHOD to execute the method regardless of whether or not the node specifed is on.
/IF
Format: DO/METHOD nodename method /IF=boolean-expression
The IF qualifier will cause DO/METHOD to execute the method only if the boolean-expression specified evaluates to TRUE (low bit set)
EXAMPLE:
DO /METHOD MY_DIGITIZER STORE /IF=:TOP.MY_DIAG:STORE_IT

EDIT

Open a tree for write / edit access.
Format: EDIT filename [/NEW]
This command opens a tree for editing operations. You must EDIT as opposed to SET TREE in order to use the ADD NODE, ADD TAG, DELETE NODE, and REMOVE TAG commands. Note that subtrees of the the tree defined in filename are NOT mapped.
Qualifiers
/NEW
Specifies to create a new tree even if the tree already exists.

END

Used to specify the end of a conglomerate being created. Only valid with the /CONGLOMERATE qualifier.
Format: END/CONGLOMERATE
Qualifiers
/CONGLOMERATE
Required qualifier which specifies that this command is referring to the end of a conglomerate.

EXIT

Terminates processing of the current command procedure or macro. If the command procedure was executed from within another command procedure, control returns to the calling procedure.
If a command procedure is not being executed, the EXIT command terminates the current image.
Format: EXIT