MATLAB: When can I use a atomic subsystem in simulink model? (At what conditions we can use atomic subsystem in a model)
atomic subsystems
I will be very glad if there are any answers for this.
Best Answer
Virtual (or non-atomic) subsystems are simply a visual convenience, but Simulink treats the subsystems as if all the blocks existed at the same level.
Atomic subsystems, on the other hand, let you control the execution of the model. It forces Simulink to run all the blocks in that subsystem as if it were its own separate "function". This has implications for generated code as well, if you're doing that.
This code counts the number of Inport blocks and Outport blocks in the first level of a Simulink model, and provides this info in the variables Num_Of_Root_InPorts and Num_Of_Root_OutPorts respectively.
I got reply from MATLAB: "Yes, a higher priority atomic subsystem’s task can preempt another lower priority atomic subsystem’s task. A single rate atomic subsystem can be preempted by blocks or other systems running in a higher priority task. So, atomic system doesn’t imply the system execution is atomic in multitasking environment in real-time deployment. It’s execution can be preempted."
Best Answer