If someone else trying to run multiple tasks is getting confused, then please refer to this matlab example:
To run Multiple Processor tasks, define your tasks as subsystems within the Processor Refrenced model. Then, if you want to make a task event driven, change its subsytem to triggered by using a trigger block( use function call option) inside the task logic. Outsied the task subsystem, connect the function trigger port to "Asynchronous Task Specification" block and connect this async task spec block to the input port. Change input port type to "Output Function Call" in execution tab of port properties. Now, you can connect this input port of precessor model to a event driven task of task manager.
To define a timer driven task, put your logic in an Enabled Subsystem and drive the enable port of subsytem via some constant. Change the sample time of constant to the time period of task you want. Then, Enable "Schedule Rates" option in the "Block Parameters" of the processor model. When you update the diagram, a timer icon will appear in the top left corner of processor model showing the timer period you set. Now, connect this timer icon port to a timer driven task in the task manager.
To define multiple tasks, create multiple subsytems(either function trigger or enabled subsytems depending on task type) within the processor model. Drive their corresponding input ports by the coressponding tasks of task manager.
To supply events to the task manager, use "IO Source Block" to generate events. "Event Source" Block does compile the code but it never runs on processor and even causes the "ExtTargetPacketSending() Failed" error on ZCU RFSoC ( hardware tested).