Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxRegisterEveryNSamplesEvent

Hello,
I am using NIDAQmx with the ANSI C API on WinXP.
I am having some troubles doing continuous synchronous AI AO task on a NI6229 M-series card. I tried following the example given, which has finite number of samples, but I am having troubles stopping the task.

The first question I have is:

What does the function DAQmxRegisterEveryNSamplesEvent exactly do?

the impression I have is that the registered callback function is executed immediately and not after the Nsamples are collected.

can anyone help or give an example where continuous synchronous task is done?

Thanks,

Best regards

Francesco


0 Kudos
Message 1 of 3
(3,253 Views)

Hello,

You can find the description of this function below :

Registers a callback function to receive an event when the specified number of samples is written from the device to the buffer or from the buffer to the device. This function only works with devices that support buffered tasks.

When you stop a task explicitly any pending events are discarded. For example, if you call DAQmxStopTask then you do not receive any pending events.

Regards.

0 Kudos
Message 2 of 3
(3,239 Views)
Hello,

I had read that 🙂 but I had misunderstood the meaning of "from the buffer to the device". I thought that meant the callback function was executed after the samples had been sent to output, but in fact it is executed right after the data has been downloaded to the device, and not necessarily sent to output yet.

This has solved the issue.

Thank you anyway,

Francesco
0 Kudos
Message 3 of 3
(3,230 Views)