-
Notifications
You must be signed in to change notification settings - Fork 99
Add enable_match_fail_combination method to nidigital API #2076
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
Merged
ni-jfitzger
merged 8 commits into
ni:master
from
ni-jfitzger:nidigital_enable_match_fail_combination
Feb 19, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7f99097
Add enable_match_fail_combination
ni-jfitzger 44f70ab
Add a system test
ni-jfitzger a1502c4
Update changelog
ni-jfitzger 01bb742
Fix typo
ni-jfitzger 126ad16
Use pattern and spec files from LabVIEW example and apply levels and …
ni-jfitzger 18e9f8c
Correct mistake in library_interpreter method
ni-jfitzger e2a041d
Fix flake8 failure
ni-jfitzger 6219cb8
Added the requested comment
ni-jfitzger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.55 KB
src/nidigital/system_tests/test_files/test_enable_match_fail_combination/pattern.digipat
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
...idigital/system_tests/test_files/test_enable_match_fail_combination/pin_levels.digilevels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <PinLevelsFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xmlns="http://www.ni.com/Semiconductor/PinLevels"> | ||
| <PinLevelsSheet> | ||
| <DigitalPinLevelSets> | ||
| <DigitalPinLevelSet pin="PinGroup1"> | ||
| <Vil>0</Vil> | ||
| <Vih>3.3</Vih> | ||
| <Vol>0.8</Vol> | ||
| <Voh>2</Voh> | ||
| <Vterm>0</Vterm> | ||
| <TerminationMode>HighZ</TerminationMode> | ||
| </DigitalPinLevelSet> | ||
| </DigitalPinLevelSets> | ||
| </PinLevelsSheet> | ||
| </PinLevelsFile> |
35 changes: 35 additions & 0 deletions
35
src/nidigital/system_tests/test_files/test_enable_match_fail_combination/pin_map.pinmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <PinMap xmlns="http://www.ni.com/TestStand/SemiconductorModule/PinMap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.2"> | ||
| <Instruments> | ||
| <NIDigitalPatternInstrument name="PXI1Slot2" numberOfChannels="32" /> | ||
| <NIDigitalPatternInstrument name="PXI1Slot5" numberOfChannels="32" /> | ||
| </Instruments> | ||
| <Pins> | ||
| <DUTPin name="DUTPin1" /> | ||
| <DUTPin name="DUTPin2" /> | ||
| <DUTPin name="DUTPin3" /> | ||
| <DUTPin name="DUTPin4" /> | ||
| </Pins> | ||
| <PinGroups> | ||
| <PinGroup name="PinGroup1"> | ||
| <PinReference pin="DUTPin1" /> | ||
| <PinReference pin="DUTPin2" /> | ||
| <PinReference pin="DUTPin3" /> | ||
| <PinReference pin="DUTPin4" /> | ||
| </PinGroup> | ||
| </PinGroups> | ||
| <Sites> | ||
| <Site siteNumber="0" /> | ||
| <Site siteNumber="1" /> | ||
| </Sites> | ||
| <Connections> | ||
| <Connection pin="DUTPin1" siteNumber="0" instrument="PXI1Slot2" channel="0" /> | ||
| <Connection pin="DUTPin2" siteNumber="0" instrument="PXI1Slot2" channel="1" /> | ||
| <Connection pin="DUTPin3" siteNumber="0" instrument="PXI1Slot2" channel="2" /> | ||
| <Connection pin="DUTPin4" siteNumber="0" instrument="PXI1Slot2" channel="3" /> | ||
| <Connection pin="DUTPin1" siteNumber="1" instrument="PXI1Slot5" channel="0" /> | ||
| <Connection pin="DUTPin2" siteNumber="1" instrument="PXI1Slot5" channel="1" /> | ||
| <Connection pin="DUTPin3" siteNumber="1" instrument="PXI1Slot5" channel="2" /> | ||
| <Connection pin="DUTPin4" siteNumber="1" instrument="PXI1Slot5" channel="3" /> | ||
| </Connections> | ||
| </PinMap> |
9 changes: 9 additions & 0 deletions
9
...nidigital/system_tests/test_files/test_enable_match_fail_combination/specifications.specs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Specifications xmlns:f="http://www.ni.com/schemas/Semiconductor/Formula.xsd" schemaVersion="1.0" xmlns="http://www.ni.com/schemas/Semiconductor/Specifications.xsd"> | ||
| <Section name="timing"> | ||
| <f:Formula symbol="period"> | ||
| <f:Definition>1 µs</f:Definition> | ||
| </f:Formula> | ||
| </Section> | ||
| <Description /> | ||
| </Specifications> |
23 changes: 23 additions & 0 deletions
23
src/nidigital/system_tests/test_files/test_enable_match_fail_combination/timing.digitiming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <TimingFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xmlns="http://www.ni.com/Semiconductor/Timing"> | ||
| <TimingSheet> | ||
| <TimeSets> | ||
| <TimeSet name="tset0"> | ||
| <Period>timing.period</Period> | ||
| <PinEdges> | ||
| <PinEdge pin="PinGroup1"> | ||
| <DriveNonReturn> | ||
| <On>0 ns</On> | ||
| <Data>timing.period / 2</Data> | ||
| <Off>timing.period</Off> | ||
| </DriveNonReturn> | ||
| <CompareStrobe> | ||
| <Strobe>(3 * timing.period) / 4</Strobe> | ||
| </CompareStrobe> | ||
| <DataSource>Pattern</DataSource> | ||
| </PinEdge> | ||
| </PinEdges> | ||
| </TimeSet> | ||
| </TimeSets> | ||
| </TimingSheet> | ||
| </TimingFile> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/nidigital/templates/_grpc_stub_interpreter.py/enable_match_fail_combination.py.mako
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## This file is empty. We won't support gRPC, for now. | ||
| ## Even though gRPC Device supports the function, the nisync Python API lacks gRPC support, so there's no point. | ||
| ## If a user tries to call enable_match_fail_combination with a session runing on a gRPC Device Server, they will get an error | ||
| ## because the method does not exist in _grpc_stub_interpreter.py. | ||
| ## Most likely it will be an AttributeError, though it hasn't been tested. |
8 changes: 8 additions & 0 deletions
8
src/nidigital/templates/_library_interpreter.py/enable_match_fail_combination.py.mako
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| def enable_match_fail_combination(self, sessions, sync_session): # noqa: N802 | ||
| session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 | ||
| sessions_ctype = _get_ctypes_pointer_for_buffer(value=sessions, library_type=_visatype.ViSession) # case B550 | ||
| sync_session_ctype = _visatype.ViSession(sync_session) # case S110 | ||
| error_code = self._library.niDigital_EnableMatchFailCombination(session_count_ctype, sessions_ctype, sync_session_ctype) | ||
| errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) | ||
| return |
10 changes: 10 additions & 0 deletions
10
src/nidigital/templates/session.py/fancy_enable_match_fail_combination.py.mako
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <%page args="f, config, method_template"/>\ | ||
| <% | ||
| import build.helper as helper | ||
| %>\ | ||
| def ${f['python_name']}(self, sync_session): | ||
| '''${f['python_name']} | ||
|
|
||
| ${helper.get_function_docstring(f, False, config, indent=8)} | ||
| ''' | ||
| self._interpreter.enable_match_fail_combination([self._interpreter.get_session_handle()], sync_session.session_handle) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.