From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect Readings After Turning SCXI Unit Off and Back On

I have a weird problem.  If I run my program to log two thermocouples it works fine.  Then I can turn the SCXI chassis off and back on and the numbers will be incorrect (twice what they should be).  If I then stop my program and open LabVIEW to log the same temperatures, everything is fine.  Is there some sort of reset I need to do or a reconfigure or something?  Keep in mind that before I turn off the unit I stop my VB.NET program and I turn the unit back on before I restart the program.  Using SCXI-1000 with an SCXI-1125.
 
Good Readings
 
 
Bad Readings
 
 
Code:
************************************************************************************************************************************
While Channels(ChannelCount).Device = "SC1Mod1"

With Channels(ChannelCount)

If Not mod1TaskCreated(0) Then

Tasks(0) =

New Task("mod1task")

mod1TaskCreated(0) =

True

End If

Select Case Channels(ChannelCount).Type

Case Is = "Temperature"

Tasks(0).AIChannels.CreateThermocoupleChannel(.Device & "/" & .Channel, .Name, _

.Min, .Max, AIThermocoupleType.K, AITemperatureUnits.DegreesF)

Tasks(0).AIChannels(.Name).AutoZeroMode = AIAutoZeroMode.None

Tasks(0).AIChannels(.Name).LowpassEnable =

True

Tasks(0).AIChannels(.Name).LowpassCutoffFrequency = 4

Case Is = "Voltage"

Tasks(0).AIChannels.CreateVoltageChannel(.Device & "/" & .Channel, .Name, AITerminalConfiguration.Differential, _

.Min, .Max, AIVoltageUnits.Volts)

Tasks(0).AIChannels(.Name).AutoZeroMode = AIAutoZeroMode.None

Tasks(0).AIChannels(.Name).LowpassEnable =

True

Tasks(0).AIChannels(.Name).LowpassCutoffFrequency = 4

Case Else

MsgBox("Error in channel configuration!", MsgBoxStyle.Critical, "Warning!")

System.Console.WriteLine("Error in Channel Configuration. Abort.")

Exit Sub

End Select

End With

ChannelCount += 1

End While

Tasks(0).Timing.ConfigureSampleClock("", 10000, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 1000)

Tasks(0).Control(TaskAction.Verify)

reader =

New AnalogMultiChannelReader(Tasks(0).Stream)

Task1Data = reader.ReadMultiSample(1000)

************************************************************************************************************************************

Thanks.

 
 
Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 1 of 5
(3,077 Views)
Problem solved:
 

Private dvc As DAQmx.Device

dvc = DaqSystem.Local.LoadDevice("SC1Mod1")

dvc.Reset()

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 2 of 5
(3,072 Views)

For discussion of why this situation arises please see this thread.

Thanks-

Tom W
National Instruments
0 Kudos
Message 3 of 5
(3,063 Views)
Thanks Tom.
Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 4 of 5
(3,061 Views)

Not a problem- let us know if you run into anything else.

Thanks again!

Tom W
National Instruments
0 Kudos
Message 5 of 5
(3,059 Views)