Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

C# - Digital input as trigger for analog input

Hi, I'm using a cDAQ-9188XT with a NI 9375 for digital inputs and a NI 9201 for analog inputs. I need to start reading an analog channel when a change from 1 to 0 occurs on a digital input and stop the reading on the next change from 1 to 0. Right now I'm using C# with an analog task that adds the readings to a List<Double> and a digital task that adds a Double.NaN to the same list when this change occurs, but my data seems to be out of phase due the read waveform samples buffer so I consider using triggers will solve that issue, but I haven't been able to find any documentation on how to achieve this.

 

Thanks in advance for your help with this.

0 Kudos
Message 1 of 2
(5,051 Views)

m0ndul,

 

Below is a CVI example with external triggering for synchronization. You can ignore the sections for signal output but the trigger method should prove useful for you.

 

http://www.ni.com/example/25881/en/

0 Kudos
Message 2 of 2
(5,020 Views)