-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add enable_match_fail_combination method to nidigital API #2076
Add enable_match_fail_combination method to nidigital API #2076
Conversation
I feel like there are a couple of ways to approach the session method: We could either pass in the nisync Python Session handle and retrieve the internal handle for the user or have them pass in the internal handle (telling them how to get it in the documentation). I think the kinder approach is to handle it for them, so that's what I went with. |
I believe we should be able to support calling this with gRPC device, though it may be awkward to test, due to the nisync session (which probably won't have gRPC Device Support). Because nisync has no gRPC support, I'm not bothering adding gRPC support for this method. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2076 +/- ##
==========================================
+ Coverage 91.33% 91.35% +0.01%
==========================================
Files 66 66
Lines 16274 16292 +18
==========================================
+ Hits 14864 14883 +19
+ Misses 1410 1409 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Should we add a required or optional dependency on nisync to the nidigital setup.py or leave it as is? |
There's either something wrong with my implementation of the API or my test. I've run the LabVIEW example with simulated hardware and get no error. |
nisync.Session.session_handle is returning a ctype. :( |
…timing before calling method
Nope, I was just passing the wrong handle. |
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.
We should get someone more familiar with this functionality to review the API.
We should consider an example. Maybe? Maybe not.
src/nidigital/templates/_grpc_stub_interpreter.py/enable_match_fail_combination.py.mako
Outdated
Show resolved
Hide resolved
We handle it for then in |
What happens if they try it then? |
What do we do for |
If they try to call it with a gRPC session, as the code is written now, they will get an error when the session method tries to call a non-existent method in _grpc_stub_interpreter.py. NI-Digital does expose it in gRPC Device. |
For nidigital, we list nitclk as a dependency, but we have to because we import nitclk in session.py. Additionally, though NI-Digital's LabVIEW API ships with an example for this entrypoint, which uses NI-Sync, the NI-Digital feed does not depend on NI-Sync, under any circumstances. Based on this, I think we should leave out the dependency. |
What does this Pull Request accomplish?
Add support for
enable_match_fail_combination
, now that we have an nisync Python API with an official way to access the session reference.Official description for what it does: "Configures digital pattern instruments in a multi-instrument session as well as the PXIe-6674T timing and synchronization instrument to combine pattern comparison results and control subsequent pattern execution across all digital pattern instruments in the multi-instrument session, based on those results."
I have chosen not to add an nisync dependency to the nidigital API, based on the following reasoning:
Example Code
Anyone wondering how to use it can tread the system test as an example. It's based on the LabVIEW Example.
The pattern doesn't do the best job of demonstrating the feature, but the code, itself, demonstrates proper usage.
Usage Steps:
Reading the sequencer flag is not a necessary step to use the feature. In the example, it's intended to demonstrate that feature is working (though that requires real hardware and, like I said, this pattern does a poor job of demonstrating whether the feature actually is working).
List issues fixed by this Pull Request below, if any.
What testing has been done?
System Test Added based on the shipping LabVIEW example for Multi-Instrument Enable Match Fail Combination. Copied the config files right out of the example.
What exactly does this entry point actually do?
This explanation comes from the following pages:
The "match" opcode is used to
Then, exactly 80 cycles later you can use jump_if([!]matched, label) or exit_loop_if([!]matched, label).
The "failed" condition, used in jump_if([!]failed, label) or exit_loop_if([!]failed, label):
On the use of EnableMatchFailedCombinations: