Hello, I am trying to acquire information from the analogue channel and I have already configured the trigger from a digital pin to start the data acquisition, now I am trying to finish the data acquisition through the next trigger. As much as I search, I can't find much information on this subject. I have tried dwf.FDwfDigitalInStatus(hdwf, out sts2) to stop the acquisition, but it counts infinitely and without stopping even though I get the pulses every 2 or 3 seconds. Can anyone help me?
This is the configuration I am using
Quote
///PARAMETROS DE GENERACION DE SEÑAL
dwf.FDwfAnalogOutNodeEnableSet(hdwf, 0, dwf.AnalogOutNodeCarrier, 1);
// set sine function
dwf.FDwfAnalogOutNodeFunctionSet(hdwf, 0, dwf.AnalogOutNodeCarrier, 3);
// 5khz
//////////////////
//set up acquisition #######
dwf.FDwfAnalogInFrequencySet(hdwf, AcqHz); // set acquisition frequency
dwf.FDwfAnalogInBufferSizeSet(hdwf, Samples); // set the buffer size for AnalogIn
dwf.FDwfAnalogInChannelRangeSet(hdwf, 0, ChlRange);
//////////////
//set up trigger for the analog channel to be the DigitalInDetector
dwf.FDwfAnalogInTriggerAutoTimeoutSet(hdwf, 0); // disable auto trigger at analog channel
dwf.FDwfAnalogInTriggerSourceSet(hdwf, dwf.trigsrcDetectorDigitalIn); // set the triggger source for the analog channels to be the DigitalInTriggerDetector
// move trigger to left boundary, otherwise the signal will start in the middle
dwf.FDwfAnalogInTriggerPositionSet(hdwf, 0.0); ; // Configures the horizontal trigger position in seconds.
// settings for the trigger on digital channel
double hzDI;
dwf.FDwfDigitalInInternalClockInfo(hdwf, out hzDI);
//sample rate = system frequency / divider
dwf.FDwfDigitalInDividerSet(hdwf, (uint)(hzDI / 100e6));
// Configuracion del pineado
// Configura el bit correspondiente al pin 0 (DIO0) como 1
dwf.FDwfDigitalInTriggerSet(hdwf, 0, 0, 0, 1 << 0);
dwf.FDwfDigitalInInputOrderSet(hdwf, 1);
dwf.FDwfAnalogInChannelEnableSet(hdwf, 0, 1); // enable Analog Channel 1
dwf.FDwfDigitalInConfigure(hdwf, 1, 1);
//dwf.FDwfAnalogInConfigure(hdwf, 1, 1);
Thread.Sleep(2000);
and this is the main loop
Quote
while (isReceptionActive)
{
while (true)
{
dwf.FDwfAnalogInStatus(hdwf, 1, out sts);
// dwf.FDwfDigitalInStatus(hdwf, 1, out sts2);
Question
Aissa Akrikez
Hello, I am trying to acquire information from the analogue channel and I have already configured the trigger from a digital pin to start the data acquisition, now I am trying to finish the data acquisition through the next trigger. As much as I search, I can't find much information on this subject. I have tried dwf.FDwfDigitalInStatus(hdwf, out sts2) to stop the acquisition, but it counts infinitely and without stopping even though I get the pulses every 2 or 3 seconds. Can anyone help me?
This is the configuration I am using
and this is the main loop
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now