Skip to content

Implementing code snippet example for HLS - Part 1#409

Open
Ashutosh-NI wants to merge 7 commits intomainfrom
users/Ashutosh-NI/Example_HLS_AdvanceSequence
Open

Implementing code snippet example for HLS - Part 1#409
Ashutosh-NI wants to merge 7 commits intomainfrom
users/Ashutosh-NI/Example_HLS_AdvanceSequence

Conversation

@Ashutosh-NI
Copy link
Collaborator

@Ashutosh-NI Ashutosh-NI commented Feb 23, 2026

This pull request adds two new code snippet style examples.

Instrument Abstraction Example Additions:

  • Added ConfigureUpfrontAndInitiateAdvancedSequenceLater.cs with 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.
  • Added ForceVoltageRampMeasureCurrent.cs with 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 :

  1. Added a new class InstrumentAbstractionTests for the integration tests for the examples.
  2. Added Initialize_ForceVoltageRampMeasureCurrent_SucceedsAndPublishesData and Initialize_ConfigureUpfrontAndInitiateAdvancedSequenceLaterSucceeds integration tests.

Note

Example ConfigureMultipleAdvanceSequencesUpfrontAndInitiateAdvancedSequencesLaterExample was not part of defined scope in feature spec , but is added additionally to give clarity on different workflow to the users.

@Ashutosh-NI Ashutosh-NI changed the title Implementing code snippet example for HLS which are using - Part 2 Implementing code snippet example for HLS which are using - Part 1 Feb 24, 2026
@Ashutosh-NI Ashutosh-NI changed the title Implementing code snippet example for HLS which are using - Part 1 Implementing code snippet example for HLS - Part 1 Mar 3, 2026
@Ashutosh-NI Ashutosh-NI marked this pull request as ready for review March 9, 2026 05:15
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";
Copy link
Collaborator

Choose a reason for hiding this comment

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

"advancedSequenceName"?


// 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>
Copy link
Collaborator

Choose a reason for hiding this comment

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

"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";
Copy link
Collaborator

Choose a reason for hiding this comment

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

"firstAdvancedSequence"?

// 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>
Copy link
Collaborator

Choose a reason for hiding this comment

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

"advancedSequenceSettingsForFirstAdvancedSequences"?

};

// configure another advanced sequence with different settings
var secondAdvanceSequence = "MyAdvancedSequence2";
Copy link
Collaborator

Choose a reason for hiding this comment

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

"secondAdvancedSequence"?


var voltages = new double[] { 0, 2, 3, 4 };
var apertureTimes = new double[] { 2, 3.1, 4.3, 2.4 };
var advanceSequenceSettingsForSecondAdvancedSequences = new DCPowerAdvancedSequenceStepProperties[4];
Copy link
Collaborator

Choose a reason for hiding this comment

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

"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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be better to move this line right before ForceVoltageSequence.

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.

3 participants