The following 'works' when simulink is running in code generation execution when creating a class
% Create a property of the type string
properties (Nontunable)
sInstanceName string ='FB_TriggerBuffer';
end
% Create an 'InitFcn' callback function and update the property
set_param(gcb,'sInstanceName',gcb)
% The propery can now be used in the code
warning(sInstanceName);