function status = mdsevent(event,data)

% MDSEVENT sets MDS event
%   MDSEVENT(EVENT,DATA) sets the MDS EVENT with an optional 12 character
%   string DATA and returns the STATUS.

if nargin < 1, error('Specify the event.'), end
if nargin < 2, data = ''; end
data = [data blanks(12-length(data))];
stat = mdsdata('mdsshr->mds$event(descr($1),ref($2))',event,data(1:12));
if nargout, status = stat; end
