generated from ni/github-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct setting of voltage limits when forcing PPMU current (#142)
* Correct the setting of voltage limit low for digital. * Add auto tests. * Add more tests. * Add new dependency. * Referece A as a dependency. * Add more auto tests. * Adjust implementation and auto tests. * Update summary documentation for ForceCurrentMeasureVoltage and ForceDcCurrent methods, and add all changes for these method to the CHANGELOG.md --------- Co-authored-by: mattjet27 <[email protected]>
- Loading branch information
Showing
7 changed files
with
324 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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 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 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
150 changes: 150 additions & 0 deletions
150
SemiconductorTestLibrary.TestStandSteps/tests/Integration/ForceCurrentMeasureVoltageTests.cs
This file contains 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,150 @@ | ||
using NationalInstruments.ModularInstruments.NIDCPower; | ||
using NationalInstruments.SemiconductorTestLibrary.Common; | ||
using NationalInstruments.SemiconductorTestLibrary.InstrumentAbstraction; | ||
using Xunit; | ||
using static NationalInstruments.SemiconductorTestLibrary.Common.ParallelExecution; | ||
using static NationalInstruments.SemiconductorTestLibrary.TestStandSteps.CommonSteps; | ||
using static NationalInstruments.SemiconductorTestLibrary.TestStandSteps.SetupAndCleanupSteps; | ||
using static NationalInstruments.Tests.SemiconductorTestLibrary.Utilities.TSMContext; | ||
|
||
namespace NationalInstruments.Tests.SemiconductorTestLibrary.Integration | ||
{ | ||
[Collection("NonParallelizable")] | ||
public class ForceCurrentMeasureVoltageTests | ||
{ | ||
[Fact] | ||
public void Initialize_RunForceCurrentMeasureVoltageWithPositiveInRangeVoltageLimit_VoltageLimitsCorrectlySet() | ||
{ | ||
var tsmContext = CreateTSMContext("Mixed Signal Tests.pinmap", "Mixed Signal Tests.digiproj"); | ||
SetupNIDCPowerInstrumentation(tsmContext, measurementSense: DCPowerMeasurementSense.Local); | ||
SetupNIDigitalPatternInstrumentation(tsmContext); | ||
|
||
ForceCurrentMeasureVoltage( | ||
tsmContext, | ||
pinsOrPinGroups: new[] { "VCC1", "DigitalPins" }, | ||
currentLevel: 0.005, | ||
voltageLimit: 3.3, | ||
apertureTime: 5e-5, | ||
settlingTime: 5e-5); | ||
|
||
var dcPower = new TSMSessionManager(tsmContext).DCPower("VCC1"); | ||
dcPower.Do(sessionInfo => | ||
{ | ||
Assert.Equal(3.3, sessionInfo.AllChannelsOutput.Source.Current.VoltageLimit, 1); | ||
}); | ||
var digital = new TSMSessionManager(tsmContext).Digital("DigitalPins"); | ||
digital.Do(sessionInfo => | ||
{ | ||
Assert.Equal(-2, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitLow); | ||
Assert.Equal(3.3, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitHigh, 1); | ||
}); | ||
CleanupInstrumentation(tsmContext); | ||
} | ||
|
||
[Fact] | ||
public void Initialize_RunForceCurrentMeasureVoltageWithPositiveOutRangeVoltageLimit_VoltageLimitsCorrectlySet() | ||
{ | ||
var tsmContext = CreateTSMContext("Mixed Signal Tests.pinmap", "Mixed Signal Tests.digiproj"); | ||
SetupNIDCPowerInstrumentation(tsmContext, measurementSense: DCPowerMeasurementSense.Local); | ||
SetupNIDigitalPatternInstrumentation(tsmContext); | ||
|
||
ForceCurrentMeasureVoltage( | ||
tsmContext, | ||
pinsOrPinGroups: new[] { "VCC1", "DigitalPins" }, | ||
currentLevel: 0.005, | ||
voltageLimit: 1.3, | ||
apertureTime: 5e-5, | ||
settlingTime: 5e-5); | ||
|
||
var dcPower = new TSMSessionManager(tsmContext).DCPower("VCC1"); | ||
dcPower.Do(sessionInfo => | ||
{ | ||
Assert.Equal(1.3, sessionInfo.AllChannelsOutput.Source.Current.VoltageLimit, 1); | ||
}); | ||
var digital = new TSMSessionManager(tsmContext).Digital("DigitalPins"); | ||
digital.Do(sessionInfo => | ||
{ | ||
Assert.Equal(-1.3, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitLow, 1); | ||
Assert.Equal(1.3, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitHigh, 1); | ||
}); | ||
CleanupInstrumentation(tsmContext); | ||
} | ||
|
||
[Fact] | ||
public void Initialize_RunForceCurrentMeasureVoltageWithNegativeInRangeVoltageLimit_VoltageLimitsCorrectlySet() | ||
{ | ||
var tsmContext = CreateTSMContext("Mixed Signal Tests.pinmap", "Mixed Signal Tests.digiproj"); | ||
SetupNIDCPowerInstrumentation(tsmContext, measurementSense: DCPowerMeasurementSense.Local); | ||
SetupNIDigitalPatternInstrumentation(tsmContext); | ||
|
||
ForceCurrentMeasureVoltage( | ||
tsmContext, | ||
pinsOrPinGroups: new[] { "VCC1", "DigitalPins" }, | ||
currentLevel: 0.005, | ||
voltageLimit: -1.3, | ||
apertureTime: 5e-5, | ||
settlingTime: 5e-5); | ||
|
||
var dcPower = new TSMSessionManager(tsmContext).DCPower("VCC1"); | ||
dcPower.Do(sessionInfo => | ||
{ | ||
Assert.Equal(1.3, sessionInfo.AllChannelsOutput.Source.Current.VoltageLimit, 1); | ||
}); | ||
var digital = new TSMSessionManager(tsmContext).Digital("DigitalPins"); | ||
digital.Do(sessionInfo => | ||
{ | ||
Assert.Equal(-1.3, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitLow, 1); | ||
Assert.Equal(1.3, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitHigh, 1); | ||
}); | ||
CleanupInstrumentation(tsmContext); | ||
} | ||
|
||
[Fact] | ||
public void Initialize_RunForceCurrentMeasureVoltageWithNegativeOutRangeVoltageLimit_VoltageLimitsCorrectlySet() | ||
{ | ||
var tsmContext = CreateTSMContext("Mixed Signal Tests.pinmap", "Mixed Signal Tests.digiproj"); | ||
SetupNIDCPowerInstrumentation(tsmContext, measurementSense: DCPowerMeasurementSense.Local); | ||
SetupNIDigitalPatternInstrumentation(tsmContext); | ||
|
||
ForceCurrentMeasureVoltage( | ||
tsmContext, | ||
pinsOrPinGroups: new[] { "VCC1", "DigitalPins" }, | ||
currentLevel: 0.005, | ||
voltageLimit: -3.3, | ||
apertureTime: 5e-5, | ||
settlingTime: 5e-5); | ||
|
||
var dcPower = new TSMSessionManager(tsmContext).DCPower("VCC1"); | ||
dcPower.Do(sessionInfo => | ||
{ | ||
Assert.Equal(3.3, sessionInfo.AllChannelsOutput.Source.Current.VoltageLimit, 1); | ||
}); | ||
var digital = new TSMSessionManager(tsmContext).Digital("DigitalPins"); | ||
digital.Do(sessionInfo => | ||
{ | ||
Assert.Equal(-2, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitLow); | ||
Assert.Equal(3.3, sessionInfo.PinSet.Ppmu.DCCurrent.VoltageLimitHigh, 1); | ||
}); | ||
CleanupInstrumentation(tsmContext); | ||
} | ||
|
||
[Fact] | ||
public void Initialize_RunForceCurrentMeasureVoltageWithOutHighRangeVoltageLimit_ThrowsException() | ||
{ | ||
var tsmContext = CreateTSMContext("Mixed Signal Tests.pinmap", "Mixed Signal Tests.digiproj"); | ||
SetupNIDigitalPatternInstrumentation(tsmContext); | ||
|
||
void ForceCurrentMeasureVoltageMethod() => ForceCurrentMeasureVoltage( | ||
tsmContext, | ||
pinsOrPinGroups: new[] { "VCC1", "DigitalPins" }, | ||
currentLevel: 0.005, | ||
voltageLimit: 8, | ||
apertureTime: 5e-5, | ||
settlingTime: 5e-5); | ||
|
||
var exception = Assert.Throws<NISemiconductorTestException>(ForceCurrentMeasureVoltageMethod); | ||
Assert.Contains("Maximum Value: 6", exception.Message); | ||
CleanupInstrumentation(tsmContext); | ||
} | ||
} | ||
} |
Oops, something went wrong.