I think my questions are unusual, but I want to work on real-time targeting in MATLAB Simulink, but I don't want to use XPC target. I just want no interruption on the program (simulink) when it is running in order to have a real-time interruptless control system. In that order, I can use my control module without a target system.
- can we force a core to only be used by Simulink and nothing else?
- what is the average and maximum time that an interrupt takes?
- is there any other way that we can use in Simulink?
a. In case you have a multicore platform: Stay away from
core 0
. Windows assigns certain tasks specifically tocore 0
. See the SetThreadAffinityMask function to get information how to run a thread on specific cores.b. Possibly raise the thread/process priority. See the SetThreadPriority function and the SetPriorityClass function for details about setting priorities and Scheduling Priorities for dertails about the priority ranges.
Priority class REALTIME_PRIORITY_CLASS with thread priority THREAD_PRIORITY_TIME_CRITICAL will run your thread at utmost priority whenever it is ready to run. Be aware that such a priority setting will disallow any other process/thread to gain CPU on that core while your thread is running.