Skip to content

Commit

Permalink
mdsgetmsg.m: use MdsShr->MdsGetMsgDsc
Browse files Browse the repository at this point in the history
make use of MdsShr->MdsGetMsgDsc
from getmsg.fun
  • Loading branch information
zack-vii committed Aug 25, 2015
1 parent 02312b1 commit 8c51533
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions matlab/mdsgetmsg.m
@@ -0,0 +1,20 @@
% translates the tdi message id into the tdi message
% messages are cached in 'tdimsg.mat'
function msg = mdsgetmsg(id,throwerror,except)
narginchk(1,3)
if nargin<3, except = [];
if nargin<2, throwerror = false;
end,end

if ischar(id)
error(id);
else
try
msg = mdsvalue('_msg = REPEAT(0,255);MdsShr->MdsGetMsgDsc(val($),descr(_msg));TRIM(_msg)',id);
catch
msg = sprintf('message not found: 0x%08x',id);
end
if xor(throwerror,ismember(id, except))
error(msg)
end
end

0 comments on commit 8c51533

Please sign in to comment.