Skip to content

Commit

Permalink
Fix SetupNIRelayModules Implementation to Also Support DAQmx Relays (#91
Browse files Browse the repository at this point in the history
)

* Fix SetupNIRelayModules TestStandStep implementation to support creating DAQmx relay tasks

* Move the SetupNIDAQmxDOTask call out of the try catch block, since it implement's its own
  • Loading branch information
Mattjet27 authored Jul 30, 2024
1 parent 26b5aa9 commit 06cb0fc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static partial class SetupAndCleanupSteps
/// If the <paramref name="initialRelayConfigurationToApply"/> input is provided, the step will apply the specified relay configuration.
/// Note that the relay configuration must be defined within the pin map, otherwise the step will throw an exception.
/// Supported devices: PXI-2567 and PXIe-6368.
/// This method expects each NI DAQmx task associated with relays in the pin map to have the Task Type set to "DAQmxRelay".
/// </summary>
/// <param name="tsmContext">The <see cref="ISemiconductorModuleContext"/> object.</param>
/// <param name="resetDevice">Whether to reset device during initialization.</param>
Expand All @@ -21,6 +22,9 @@ public static void SetupNIRelayModules(
bool resetDevice = false,
string initialRelayConfigurationToApply = "")
{
// Note that the SetupNIDAQmxDOTask method has its own try catch block and should be called before ApplyRelayConfiguration,
// since the relay configuration being applied could have both 2567 and 6368 relays defined in it.
SetupNIDAQmxDOTask(tsmContext, taskType: "DAQmxRelay");
try
{
InstrumentAbstraction.Relay.InitializeAndClose.Initialize(tsmContext, resetDevice);
Expand Down

0 comments on commit 06cb0fc

Please sign in to comment.