EZCA.pm - Perl extension for EPICS Easy Channel Access library (ezca)
use EZCA;
EZCA::AutoErrorMessageOff();
EZCA::SetTimeout(0.1);
EZCA::SetRetryCount(10);
$timeout = EZCA::GetTimeout();
$retry = EZCA::GetRetryCount();
print " timeout = $timeout Retry = $retry \n";
@data = EZCA::Get("S:SRsecsPastEpochAI","ezcaLong",1);
print "Status = $data[0] Value = $data[1] \n";
EZCA::GetStatus("ID01:Gap",$tstamp,$tnstamp,$status,$severity);
print "Time: $tstamp $tnstamp Status = $status Severity= $severity \n";
EZCA.pm is a perl interface to EPICS EZCA library. The routine names are based on EZCA nomenclature. Each routine name in EZCA has an equivalent in perl module. At this time 21 functions have been implemented and tested.
All the commands are similar to what is used in C version of EZCA. The various datatypes as described in EZCA (ezcatype) are used. They are as follows:
Most fucntion calls return status codes indicating the success/failure of the call. All other values are a indication of a problem. Following are the return codes.
Work in Progress:
@data = EZCA::Get($pvname,"ezcatype", $no_elem)$pvname and
the data type is specified as ezcatype At this time the
no of elements $no_elem is limited to 2000.
The return status code is stored in $data[0] and
the retrieved values are in the rest of the array starting at
elements $data[1]
$status = EZCA::GetControlLimits($pvname, $low, $high)$low and $high.
$status is the return status.
$status = EZCA::GetGraphicLimits($pvname, $low, $high)$low and $high.
$status is the return status.
$status = EZCA::GetNelem($pvname,$nelem)$nelem.
$status = EZCA::GetPrecision($pvname,$prec)$pvname is returned in $prec.
EZCA::GetStatus($pvname,$tstamp,$tnstamp,$status,$severity)$pvname.
The time in seconds is in $tstamp and in nanoseconds is in $tnstamp
All times are since EPICS EPOCH. The $status and $severity returns
status of the pv and its severity.
$status = EZCA::GetUnits($pvname,$unit)$pvname in $unit.
$status = EZCA::Put($pvname,"ezcatype",$no_elem,$data)$pvname. The value is send in $data and
the data type is specified as ezcatype. At this time the
no of elements $no_elem is limited to 1.
$status = EZCA::SetMonitor($pvname,"ezcatype")$pvname.
$status = EZCA::ClearMonitor($pvname,"ezcatype")$pvname.
$mon = EZCA::NewMonitorValue($pvname,"ezcatype")$mon indicates a new value since the last
time the value was read a get call.
$status = EZCA::Delay($seconds)$seconds is in seconds.
Fractional time is allowed.
EZCA::AutoErrorMessageOn()EZCA::AutoErrorMessageOff()EZCA::Perror($prefix)EZCA::GetErrorString(NULL, $stringBuff)$stringBuff instead of stdout.
EZCA::Free($stringBuff)$stringBuff used in the above call.
$seconds = EZCA::GetTimeout()$number = EZCA::GetRetryCount()$status = EZCA::SetTimeout($seconds)$status = EZCA::SetRetryCount($number)
The software has been built on epics R3.13.9. The software is available as a gzipped tarfile
for solaris http://www.aps.anl.gov/aod/people/mohan/EZCA/solEZCA.tar.gz
for Linux http://www.aps.anl.gov/aod/people/mohan/EZCA/linuxEZCA.tar.gz
For building it standalone, some of the EPICS include files and libraries are included.
The EZCA perl module was written in 1996 by Mohan Ramanathan. However it was documented only in 2002. During these years the module has been extensively used and tested by the author. This module is used in numerous activities at the Advanced Photon Source.
For latest info contact the author Mohan Ramanathan mohan@aps.anl.gov