Called by PyDAQmx whenever a callback event occurs.

def EveryNCallback(self):
        """Called by PyDAQmx whenever a callback event occurs."""
        # print('ncall ', self.n_callbacks)
        if self.do_callbacks:
            if self.n_callbacks >= self.callback_step:
                # print('n_callbacks', self.n_callbacks)
                for func, func_dict in self.callback_funcs:
                    func(func_dict)
                    print('func:::', func)

                self.latest_callback_index +=1
                if self.latest_callback_index >= len(self.callback_function_list):
                    # print('done with callbacks')
                    self.do_callbacks = False
                else:
                    out = self.callback_function_list[self.latest_callback_index]
                    callback_time = out[0]
                    self.callback_step = int(callback_time/expt_settings.callback_resolution)
                    # print('updatin callback step', self.callback_step)
                    self.callback_funcs = out[1]

        self.n_callbacks += 1
        #print('n_callbacks', self.n_callbacks)
        return 0