title: Event-Specific Data with DataAvailable
body: <p>I am trying to include specific data into the EventData of a DataAvailable listener, but I do not find the way.</p>
  
  <p>I have tried the following:</p>
  
  <p>First, create a class associated with EventData and store in a file MyEventData.m:</p>
  
  <pre><code>classdef (ConstructorLoad) MyEventData &lt; event.EventData
      properties (Access = public)
          Data = [];
      end
      methods
          function obj=MyEventData(receiveObject)
              obj.Data = receiveObject;
          end
      end
  end
  </code></pre>
  
  <p>Next, inside my program.m:</p>
  
  <pre><code>% Create the session
  Session = daq.createSession('nidaq');
  
  % Add a channel
  Channels = addAnalogInputChannel(Session, 'PXI1Slot2', 0, 'Voltage'); 
  
  % Set continuous adquisition
  Session.IsContinuous = true;
  
  % Sampling rate
  Session.Rate = 1000000;
  
  % in this way two events per second
  Session.NotifyWhenDataAvailableExceeds = 500000;
  
  % Add listener
  lh=addlistener(Session,'DataAvailable', @(src,event)EventFunction(src,event));
  
  % My counter or any other data to pass to the event
  TaskCounter = 0;
  
  % Add my data
  notify(Session, 'DataAvailable', MyEventData(TaskCounter);
  
  % Start the session to adquire data
  Session.startBackground(); 
  </code></pre>
  
  <p>When I run this, I get the following error in the line of the notify:</p>
  
  <p><em>Event 'DataAvailable' is not defined for class 'event.listener'</em> </p>
  
  <p>I do not find any way to pass data to the event. I find the Matlab help is quite but regarding this issue.</p>