-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
Fix for DAQmx input and output tasks #185
Conversation
Signed-off-by: Shalini-Subramanian <[email protected]>
@lornazh For other drivers, this is already implemented. |
@@ -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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Please add unit tests in Analog/DigitalInputTests to verify behavior. |
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?
Read measurements for all sites
Read measurements for filtered sites