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

Fix for DAQmx input and output tasks #185

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shalini-Subramanian
Copy link
Collaborator

What does this Pull Request accomplish?

This PR contains the implementation for updating the channels to be read with the filtered channel list, where the task contain channels for multiple sites for one pin and on applying FilterBySite while we get the measurements.

Why should this Pull Request be merged?

Previously, while getting the measurements for the Daqmx tasks, the channels to be read was not updated with the filtered channel list. This also applies while writing the output tasks as well.

We are updating this logic to read/write channels for the filtered list alone.

What testing has been done?

  • Manual Testing
    Read measurements for all sites
    image
    Read measurements for filtered sites
    image

@Shalini-Subramanian
Copy link
Collaborator Author

@lornazh For other drivers, this is already implemented.
Adding reference for example
image

@@ -22,6 +22,7 @@ public static PinSiteData<double[]> ReadAnalogMultiSample(this DAQmxTasksBundle
return tasksBundle.DoAndReturnPerSitePerPinResults(taskInfo =>
{
taskInfo.VerifyTaskType(DAQmxTaskType.AnalogInput);
taskInfo.Task.Stream.ChannelsToRead = taskInfo.ChannelList;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to restore original channels after the read operation, otherwise subsequent reads using direct driver calls will be affected.

@@ -19,6 +19,7 @@ public static void WriteAnalogSingleSample(this DAQmxTasksBundle tasksBundle, do
{
tasksBundle.Do(taskInfo =>
{
taskInfo.Task.Stream.ChannelsToRead = taskInfo.ChannelList;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analog output channels are used to do write operations. I think we should modify ChannelsToWrite instead.

Copy link
Collaborator

@lornazh lornazh Dec 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a check and noticed there is no ChannelsToWrite actually. We use a different mechanism to do the writes, which won't be impacted in similar scenarios.

So nothing needs to be done to Analog/DigitalOutput cs files.

@lornazh
Copy link
Collaborator

lornazh commented Dec 25, 2024

Please add unit tests in Analog/DigitalInputTests to verify behavior.

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

Successfully merging this pull request may close these issues.

2 participants