T3SP-D4MX Operator’s Manual
is_init = true;
end
if
strcmpi(cmd,'init'),
return
;
end
NoC = calllib(dll,'cDMXU_GetNumberOfChannels');
assert(NoC > 0, 'Getting number of channels failed');
% return value
ret = [];
if
strcmpi(cmd,'getserialnumber')
ret = calllib(dll,'cDMXU_GetSerialNumber');
assert(ret >= 0, 'Getting serial number failed');
elseif
strcmpi(cmd,'getnumberofchannels')
ret = NoC;
elseif
strcmpi(cmd,'setchannel')
% check for errors
error
(
nargchk
(2,2,
nargin
));
ch = varargin{2};
assert(isnumeric(ch) && isscalar(ch),'Channel must be a scalar
integer');
assert(ch == int32(ch) && ch >= 0 && ch <= NoC, 'Invalid channel');
err = calllib(dll,'cDMXU_SetChannel',ch);
assert(err >= 0, 'Setting channel failed');
elseif
strcmpi(cmd,'getchannel')
ret = calllib(dll,'cDMXU_GetChannel');
assert(ret >= 0, 'Getting channel failed');
elseif
strcmpi(cmd,'release')
if
is_init,
err = calllib(dll,'cDMXU_Release');
19
933407 Rev1