function eventID = profilingXCPEventID()
    %

    % Copyright 2017 The MathWorks, Inc.
    %
    % The function returns the XCP Event ID associated to the DAQ list 
    % that uploads the profiling buffer data.
    %
    % In particular, for the signals streaming the XCP Master currently 
    % associates a different Event ID for each task in the model
    % (from 0 to tasksNumber - 1).
    %
    % Therefore the first unused ID available for profiling is tasksNumber
    % 
    % @todo (g1653814): create an Event ID manager to assign Event IDs

    % In order to retrieve the number of tasks in the model, 
    % the extmode_task_info.m function is invoked
    assert(isfile('extmode_task_info.m'), 'extmode_task_info.m not found');
    
    [~, numTasks, ~] = eval('extmode_task_info');
    
    eventID = numTasks;
end

