Implementing code snippet example for HLS - Part 1#409
Open
Ashutosh-NI wants to merge 7 commits intomainfrom
Open
Implementing code snippet example for HLS - Part 1#409Ashutosh-NI wants to merge 7 commits intomainfrom
Ashutosh-NI wants to merge 7 commits intomainfrom
Conversation
nitamil
reviewed
Mar 3, 2026
...ource/CodeSnippets/InstrumentAbstraction/ConfigureUpfrontAndInitiateAdvancedSequenceLater.cs
Show resolved
Hide resolved
nitamil
approved these changes
Mar 3, 2026
lornazh
approved these changes
Mar 9, 2026
| dcPowerPins.ConfigureMeasureSettings(new DCPowerMeasureSettings() { MeasureWhen = DCPowerMeasurementWhen.AutomaticallyAfterSourceComplete }); | ||
|
|
||
| // configure the advanced sequence upfront, but do not set it as the active sequence. This allows you to initiate the advanced sequence later in your test flow without needing to reconfigure it. | ||
| var advanceSequenceName = "MyAdvancedSequence"; |
|
|
||
| // configure the advanced sequence upfront, but do not set it as the active sequence. This allows you to initiate the advanced sequence later in your test flow without needing to reconfigure it. | ||
| var advanceSequenceName = "MyAdvancedSequence"; | ||
| var advanceSequenceSettings = new List<DCPowerAdvancedSequenceStepProperties> |
Collaborator
There was a problem hiding this comment.
"advancedSequenceSettings"?
| dcPowerPins.ConfigureMeasureSettings(new DCPowerMeasureSettings() { MeasureWhen = DCPowerMeasurementWhen.AutomaticallyAfterSourceComplete }); | ||
|
|
||
| // configure the advanced sequence upfront, but do not set it as the active sequence. This allows you to initiate the advanced sequence later in your test flow without needing to reconfigure it. | ||
| var firstAdvanceSequence = "MyAdvancedSequence1"; |
| // configure the advanced sequence upfront, but do not set it as the active sequence. This allows you to initiate the advanced sequence later in your test flow without needing to reconfigure it. | ||
| var firstAdvanceSequence = "MyAdvancedSequence1"; | ||
|
|
||
| var advanceSequenceSettingsForFirstAdvancedSequences = new List<DCPowerAdvancedSequenceStepProperties> |
Collaborator
There was a problem hiding this comment.
"advancedSequenceSettingsForFirstAdvancedSequences"?
| }; | ||
|
|
||
| // configure another advanced sequence with different settings | ||
| var secondAdvanceSequence = "MyAdvancedSequence2"; |
|
|
||
| var voltages = new double[] { 0, 2, 3, 4 }; | ||
| var apertureTimes = new double[] { 2, 3.1, 4.3, 2.4 }; | ||
| var advanceSequenceSettingsForSecondAdvancedSequences = new DCPowerAdvancedSequenceStepProperties[4]; |
Collaborator
There was a problem hiding this comment.
"advancedSequenceSettingsForSecondAdvancedSequences"?
| // Create a voltage ramp sequence from 0 to 3 volts with 10 points, which will create a sequence like [0V, 0.33V, 0.66V, ..., 3V] | ||
| var voltageSequence = HelperMethods.CreateRampSequence(outputStart: 0, outputStop: 3, numberOfPoints: 10); | ||
|
|
||
| var dcPowerPins = sessionManager.DCPower(smuPinNames); |
Collaborator
There was a problem hiding this comment.
It might be better to move this line right after the creation of sessionManager?
| var sessionManager = new TSMSessionManager(tsmContext); | ||
|
|
||
| // Create a voltage ramp sequence from 0 to 3 volts with 10 points, which will create a sequence like [0V, 0.33V, 0.66V, ..., 3V] | ||
| var voltageSequence = HelperMethods.CreateRampSequence(outputStart: 0, outputStop: 3, numberOfPoints: 10); |
Collaborator
There was a problem hiding this comment.
It might be better to move this line right before ForceVoltageSequence.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds two new code snippet style examples.
Instrument Abstraction Example Additions:
ConfigureUpfrontAndInitiateAdvancedSequenceLater.cswith two methods showing how to set up advanced sequences up front, and initiate them later for DCPower pins. This includes support for configuring multiple advanced sequences and initiating them as needed in a test flow.ForceVoltageRampMeasureCurrent.cswith an example method demonstrating how to ramp voltage across a sequence for DCPower pins and measure current after the sequence completes.Testing
This PR also implements integration tests for the above mentioned tests :
InstrumentAbstractionTestsfor the integration tests for the examples.Initialize_ForceVoltageRampMeasureCurrent_SucceedsAndPublishesDataandInitialize_ConfigureUpfrontAndInitiateAdvancedSequenceLaterSucceedsintegration tests.Note
Example
ConfigureMultipleAdvanceSequencesUpfrontAndInitiateAdvancedSequencesLaterExamplewas not part of defined scope in feature spec , but is added additionally to give clarity on different workflow to the users.