APS_WISH User's Guide

Author: Ben-chin Cha

Table of Contents


1. aps_wish

aps_wish is an APS version of wish which includes all the tcl/tk commands plus the EZCA channel access interface commands listed below.

It is assumed that the Sun4 operating system is used throughout this document. And the aps_wish was built as an EPICS extensions tool and it is installed under the /usr/local/epics/extensions/bin/sun4 directory.

2. Setup requirement:

3. CA Interface Commands

Available channel access commands in aps_wish are listed below:

The ezca channel access commands in aps_wish always return the appropriate or meaningful string for the command entered. This will minimize the intervene required from the user. In addition to the result string returned to the aps_wish each command also returns a return code which can be

A user always can use the TCL exception handling function catch to check the return code of each command. The catch command returns TCL_OK (i.e. 0) if the command execution succeeded, returns TCL_ERROR (i.e. 1) if the command execution failed.

Most of CA command returns a resultant string representation of the command execution. If the channel access failed, in the interactive mode the appropriate error message is displayed on the user terminal, in programming control mode a user can use the TCL exception handling function to catch the error.

ezcaget <pvname> <type>

Get the current value(s) back for the requested channel(s) This commands does not support waveform record, ezcagetwf supports waveform record.

Example

ezcaget chademoai1

ezcaput <pvname> <value> <type>

Put new value(s) to the requested channel(s), for single value it figures out type of put automatically. This commands does not support waveform record, ezcaputwf supports waveform record.

Examples

ezcaput chademobi1 1
ezcaput chademobi1 "State 0" string
ezcaput {chademoai2 chademomask1} {111 222}

ezcagetenumstrings <pvname.field>

Get the current value setting and array of strings for the requested enum type field. This command can not support a list input.

Example

ezcagetenumstrings chademoai1.SCAN

ezcagettype <pvname>

Get the database record type for the specified channels.

Example

set x {chademoai1 chademoai2 chademobi1}
ezcagettype $x

ezcagetnelem <pvname>

Get the database element count(s) for the specified channel(s).

Example

set x {chademoai1 chademoai2 chademobi1}
ezcagetnelem $x

ezcainfo <pvname>

Get the database miscellaneous record control information for the specified channel(s).

Comment

For each requested process variable the corresponding TCL global `Control_Info' array element is reset. The Control_Info variable consists of the following pieces of information :

If desired a user can extract the substring from the global `Control_Info' variable. Currently, these info are not automatically printed unless a `ezcadebug 2' is issued first.

Example

set x {chademoai1 chademoai2 chademobi1}
ezcadebug 2
ezcainfo $x
ezcadebug 0
set Control_Info(chademoai1)
set Control_Info(chademoai2)
set Control_Info(chademobi1)

ezcagetwf <pvname> <type> <nelem>

This function can be used for getting the value back for a single device. If the get `type' is not specified, the native type is assumed. The ca_pend_io is automatically called for waveform record.

Example

ezcagetwf chademowf1

ezcaputwf <pvname> <value> <type> [nelem]

This function can be used for setting the value for a single channel. If the record is an array record (nelem > 1), that is if a waveform record, the string value is put to the waveform record. The ca_pend_io is automatically called for the waveform record.

Example

ezcaputwf chademowf1 { 1 2 3}

ezcagetvss <pvname> <type>

Get the triplet value, status, severity back for the requested process variable name.

Example

ezcagetvss chademoai1

ezcagetvsst <pvname> <type>

Get the value, status, severity, and timestamp string back for the requested process variable name.

Example

ezcagetvsst chademoai1

ezcasearch <pvname>

Search the IOC network for the specified list of process variable names

Example

set x {chademoai1 chademoai2 chademobi1}
ezcasearch $x

ezcapendio <secs>

Set the timeout will be used by the ca_pend_io function

Example

ezcapendio 2.

ezcapendevent <secs>

Delay for secs in calling ca_pend_event

Example

ezcapendevent 0.5

ezcaconnect <pvname>

This command add a change of connection event for the specified channel.

Example

ezcaconnect chademomask1

ezcasetmonitor <pvname> <keyword>

Set and add the pvname to the monitored list

For each process variable monitored the name is added to the monitored list and the corresponding TCL global `Control' array element is set. The Control variable consists of four pieces of information VAL, STAT, SERV, and TSTAMP string.

If the waveform record is monitored, in addition of `Control' array element is set, a TCL global `WF' array element is also set for the process variable. It returns the current values detected in the waveform record.

E.g. if `chademoai1' is added to the monitored list, then the global variable `Control(chademoai1)' is set in aps_wish. Whenever a new value is set or put to the channel, the array element `Control(chademoai1)' reflects the new current value, status, severity, and time stamp string of the value.

To use the value from Control(pvname), a user must ensure that pvname is currently monitored.

Examples

ezcasetmonitor chademoai1
set Control(chademoai1)
ezcasetmonitor chademowf6
ezcaputwf chademowf6 {1 2 3 4 5 6}
set Control(chademowf6)
set WF(chademowf6)

ezcaclearmonitor <pvname>

Clear the pvname from the monitored list

Example

ezcaclearmonitor chademoai1

ezcacheckmonitor <pvname>

Check and clear the event flag(s) of the monitored channel(s).

Example

ezcacheckmonitor chademoai1

ezcawaitmonitor <secs> <pvname>

Wait for any new event for the specified channel until time out .

Example

ezcawaitmonitor chademoai1

ezcagetmonitorvss <pvname>

Get the triplet value, status, severity back for the monitored process variable(s) and clear the new event flag(s) for the monitored channel(s).

Example

ezcagetmonitorvss chademoai1

ezcadebug <n>

Set the debug printing level

Example

ezcadebug 1

4. TIME PERFOMANCE of CA Commands

(Run on a sun4 SPARC)
FUNCTION               Microseconds / Iteration
------------------------------------------------------
ezcasearch               500 
ezcaconnect              372 
ezcasetmonitor           453 
ezcacheckmonitor         484 
ezcagetmonitorvss       3708 
ezcaclearmonitor         469 
ezcagetvss              3660 
ezcagetvsst             4097 
ezcaget                 3241 
ezcaput                 1390 
ezcagetenumstrings      4550 
ezcagettype              482 
ezcagetnelem             479 
ezcainfo                4350 
ezcagetwf               3811 
ezcaputwf               2070 
[In above table 1000 iterations were performed on a single PV. ]

FUNCTION   LTS.ioc(554 PVs)   type   Microseconds/iterations
--------------------------------------------------------------
ezcasearch            $x                    313090 (*)
ezcasetmonitor        $x                    133750 (*)
ezcacheckmonitor      $x                     74776 
ezcagetmonitorvss     $x                    152476 
ezcagetmonitorvss     $x                    152476 
ezcaclearmonitor      $x                     76263 (*)
ezcagettype           $x                     72607 
ezcagetnelem          $x                     84881 
ezcaget               $x    string          206803 
ezcagetvss            $x    string          239824 
ezcagetvsst           $x    string          296612 
ezcagetmonitorvss     $x                    162879 
ezcainfo              $x                   1326867 (*)
[In above table, x contains an array of 544 PVs from a database, 100 iterations were performed, cases marked with (*) only one iteration is performed. ]

FUNCTION   PV          Nelem    Native_Type Microseconds/iteration
--------------------------------------------------------------
ezcagetwf chademowf1      20    DBF_STRING       5223    
                                                 7292 (*)
ezcagetwf chademowf2      20    DBF_CHAR         4231
                                                 6288 (*)
ezcagetwf chademowf3      20    DBF_UCHAR        3856
                                                 5366 (*)
ezcagetwf chademowf4      20    DBF_SHORT        4068 
                                                 5552 (*)
ezcagetwf chademowf5      20    DBF_USHORT       5459 
                                                 5532 (*)
ezcagetwf chademowf6      20    DBF_LONG         4153
                                                 5520 (*)
ezcagetwf chademowf7      20    DBF_ULONG        5669
                                                 5726 (*)
ezcagetwf chademowf8      20    DBF_FLOAT        5470
                                                 5500 (*)
ezcagetwf chademowf9      20    DBF_DOUBLE       5585
                                                 5617 (*)
ezcagetwf chademowf10     20    DBF_ENUM         4121
                                                 5418 (*)
ezcagetwf chademowfmax  2000    DBF_DOUBLE     193505
ezcagetwf chademowfmax7 4000    DBF_FLOAT      387273
ezcagetwf chademowfmax6 4000    DBF_LONG       117259
ezcagetwf chademowfmax5 8000    DBF_SHORT      204854
                        4000                   103371
ezcagetwf chademowfmax1 16000   DBF_CHAR       310953
                        8000                   157103
                        4000                    80088
[ In the above table 100 iterations were performed for waveform record, case marked with (*) double precision type is requested. As shown above requested the waveform record as native type is more efficient. Bigger array takes more time to get. Same array size, the time perfomance is propotional to the word size. ]