01-11-2017 09:33 AM
Hi,
I think you are encountering the same problem I mentioned previously. The function help for DAQmxRegisterEveryNSamplesEvent states:
"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."
The issue is that the time when the samples are written to the 6363 will not be the same time that they are put on the AO pin. This will be controlled by the hardware trigger signal and is unknown by your code.
I recommend routing the AO signal to an AI task and polling it at whatever interval you would like the user interface to be updated. You could also route the sample clock of the AO task to a counter task, poll the count, and then calculate the current AO value. You should be able to do this with an internally routed signal.
01-11-2017 03:09 PM
In LabVIEW, I can register an AO task for a DAQmx event known as a "Signal Event". I feed in my DAQmx task reference, and can select from an event type from a small set of options. The one called "Sample Clock" worked for me on a PCIe-6341.
I'd guess there's a similar way to register a callback function for that event, but I really don't know any of the text language syntax for DAQmx.
-Kevin P
01-11-2017 03:38 PM
I was previously unaware of this. Looks like DAQmxRegisterSignalEvent is the function you want.
Thanks for the suggestion Kevin!
01-11-2017 04:45 PM
Sweeeet. I try this out. thanks.
01-16-2017 04:13 PM
Yup, totally works!