function getGPIONumberCallback(hObj, hDlg, tag, desc)
% getGPIONumberCallback get the gpio number of the corresponsing input Xbar
% when the eCAP capture input is changed.

% Copyright 2020 The MathWorks, Inc.

hCS = hObj.getConfigSet();
ud = hDlg.getUserData(tag);
fieldName = ud.Storage;
newVal = hDlg.getWidgetValue(tag);
gpioTag = strrep(fieldName,'_IXBAR','');
codertarget.targethardware.doWidgetChangedCallback(hObj, hDlg, tag, desc);
inputXbarTag = ['IXBAR.I' num2str(newVal+1)];
gpioNum =  codertarget.data.getParameterValue(hCS, inputXbarTag);
if ~isequal(gpioNum,'None')
    codertarget.data.setParameterValue(hCS, gpioTag, ['GPIO' gpioNum]);
else
    codertarget.data.setParameterValue(hCS, gpioTag, gpioNum);
end
end