Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 1999

NIDCPower: Specified property cannot be set while the task is running. What's the task that's running?

$
0
0

I'm trying to get measurements on a PXIe4139, and I can't set the AperatureTime property.  Here's the exception I get:

Ivi.Driver.IviCDriverException was unhandled
  ErrorCode=0
  HResult=-2146233088
  Message=ModularInstruments.NIDCPower: Specified property cannot be set while the task is running.

Set the property prior to starting the task, or stop the task prior to setting the property.

Property: Aperture Time

 

And the code, in it's entierty...

 

      power = new NIDCPower("PXI5Slot3", false, true);
      power.Outputs["0"].Source.Output.Function = DCPowerSourceOutputFunction.DCVoltage;
      power.Outputs["0"].Source.Voltage.VoltageLevel = voltage;
      power.Outputs["0"].Source.Output.Enabled = true;
      power.Outputs["0"].Measurement.ApertureTime = 0.000001;
      power.Outputs["0"].Measurement.SamplesToAverage = 0;
      while (true)
      {
        var measurement = power.Measurement.Fetch("0", new NationalInstruments.PrecisionTimeSpan(1.0), 1);
        Console.Writeline(measurement.VoltageMeasurements[0]);
        Console.Writeline(measurement.CurrentMeasurements[0]);
      }

What am I missing?


Viewing all articles
Browse latest Browse all 1999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>