Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxRegisterEveryNSamplesEvent buffers up callbacks until the end

Solved!
Go to solution

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.

Dale S.
RF Systems Engineer - NI
0 Kudos
Message 11 of 15
(1,210 Views)

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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 12 of 15
(1,203 Views)
Solution
Accepted by RedmondUser

I was previously unaware of this. Looks like DAQmxRegisterSignalEvent is the function you want.

 

Thanks for the suggestion Kevin!

Dale S.
RF Systems Engineer - NI
0 Kudos
Message 13 of 15
(1,199 Views)

Sweeeet.  I try this out. thanks.

0 Kudos
Message 14 of 15
(1,193 Views)

Yup, totally works!

0 Kudos
Message 15 of 15
(1,170 Views)