Hi Eungsoo Lee,
We found the problem and thanks to you eungsoolee we can now provide a hotfix, but first we would like to have your confirmation that works OK on your setup.
Please do the following steps:
#1: go to ..\MCToolbox\mctbx_9s12zvm\mctbx_s12zvmc256\src\c_library\ folder
#2: make a back-up copy of the mscan0_s12zvmc256.c file
#3: copy-paste the file attached mscan0_s12zvmc256.c file into this thread that contains the fix to ..\MCToolbox\mctbx_9s12zvm\mctbx_s12zvmc256\src\c_library\
#4: start Matlab and clean up the previous generated code (delete the entire folder that was generated for your model)
#5: regenerate the code for your model
Now it should work fine.
In addition please find attached a model we used to validate the fix. You may want to adapt it for your setup.

Hope this helps!
Once we have your confirmation that everything is fine we can then prepare an official hotfix patch.
Thank you!
Daniel