Hi Aera,
1) In order to generate files per event, you can use Simulink's "task manager" block which supports event driven task management. You can refer to the following MathWorks documentation for more details:
Whenever an event is detected, you can write the data into a file. You can consider using "MATLAB function" block to write the code responsible for handling file operations. You can refer to the following MathWorks documentation for details related to writing to a file using MATLAB:
2) To ensure data persistence after a reboot, you can use a non-volatile storage like an SD card, or an external storage device connected to the PS to store your files.
If the issue still persists, you can reach out to MathWorks Technical Support using the link given below: