10-15-2018 04:36 AM
I am using accelerometer with the cDAQ-9181 and NI9234. I try to run the C# .NET example, named "ContAccelSamp_IntClk_AnlgStart"
how do all four channels simultaneously in the .NET example?
10-15-2018 02:58 PM
Hi,
Here's some code I used for a 4 channel 9211 temperature daq module. It should help you get started.
Curt
' Initialize local variables
Dim sampleRate As Double = 2.4 '3 ' 1000
Dim rangeMin As Double = 0
Dim rangeMax As Double = 1 '5
Dim samplesPerChan As Int32 = 4 '100
Dim cliplimit As Double = 0.2
Application.DoEvents()
myTask.AIChannels.CreateThermocoupleChannel("Dev1/ai0:3", "", _
0, 200, AIThermocoupleType.J, AITemperatureUnits.DegreesC)
myTask.Timing.ConfigureSampleClock("", sampleRate, _
SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, samplesPerChan)
' Verify the task
myTask.Control(TaskAction.Verify)
reader = New AnalogMultiChannelReader(myTask.Stream)
' Read the data
Dim data As Double(,) = reader.ReadMultiSample(samplesPerChan)
Dim data0(4) As Double
Dim data1(4) As Double
Dim data2(4) As Double
Dim data3(4) As Double
For i = 0 To 3
data0(i) = data(0, i)
data1(i) = data(1, i)
data2(i) = data(2, i)
data3(i) = data(3, i)
Next
10-16-2018 03:05 AM
Hi
Thank you for your repay.