Initial commit
This commit is contained in:
30
scripts/caput.m
Executable file
30
scripts/caput.m
Executable file
@@ -0,0 +1,30 @@
|
||||
function sts = caput(pvname, value)
|
||||
% sts=caput('pvname',value) sets the value of EPICS PV 'pvname'.
|
||||
|
||||
%
|
||||
channel=pvname;
|
||||
|
||||
if ischar(channel)
|
||||
pv = mocha('open',channel);
|
||||
|
||||
if mocha('isConnected', channel) == false
|
||||
mocha('openNowAndWait', 1.5)
|
||||
end
|
||||
|
||||
if mocha('isConnected', channel) == false
|
||||
error('EPICS channel %s not found', channel);
|
||||
end
|
||||
elseif isnumeric(channel)
|
||||
|
||||
if mocha('isConnected', channel) == false
|
||||
error('EPICS channel with handle %d not connected', channel);
|
||||
end
|
||||
pv = channel;
|
||||
|
||||
else
|
||||
error ('First argument must be channel name or handle');
|
||||
end
|
||||
|
||||
|
||||
sts= mocha('set', pv, value);
|
||||
|
||||
Reference in New Issue
Block a user