function callbackTuneButton(blkh)
% CALLBACKTUNEBUTTON opens either the PID Tuner App or the FRD Tuner App
% based on the settings of TUNERSELECTOPTION in the PID Controller 1DOF or
% 2DOF dialog.
%
%   blkh: the masked subsystem handle of the PID 1dof or 2dof block

%   Author(s): Aaron Zimmerman
%   Copyright 2017-2020 The MathWorks, Inc.

% Tune Button
if isslcontrolinstalled
    slctrlguis.pidtuner.ToolManager.getInstance(blkh);
else
    DAStudio.error('Simulink:blocks:licenseRequiredForPIDTuner',getfullname(blkh));
end
end

function val = isslcontrolinstalled
% Check if slcontrol license exists and if it is actually installed (g711233)
val = license('test','Simulink_Control_Design') && ~isempty(ver('slcontrol'));
end
