Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helper function for clearing existing task of a defined name #9

Open
raacampbell opened this issue Nov 18, 2019 · 0 comments
Open

helper function for clearing existing task of a defined name #9

raacampbell opened this issue Nov 18, 2019 · 0 comments

Comments

@raacampbell
Copy link
Contributor

Because of the annoying errors where an existing task of the same name exists following an error:



    % Check if free

    taskMap = dabs.ni.daqmx.Task.getTaskMap;

    if any(strcmp(taskMap.keys, obj.taskName))

        oldTask = taskMap(obj.taskName);

        disp(['Deleting existing task "' obj.taskName '"']);

        delete(oldTask);

    end

Check that fixes our problem. If so, write a function that wraps task creation so all functions use it and we avoid this annoying problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant