04-29-2022 02:10 PM
Does anyone have any ideas on how to accomplish this? Currently my code writes out the entire series of samples(in a array) upon receiving a digital trigger using WriteMultiSample from the AnalogMultiChannelWriter Class. I would like to somehow write a single sample per trigger. I'm kind of new to using daqmx and I'm trying to accomplish this in c#. Thanks so much for any advice!
Solved! Go to Solution.
04-29-2022 03:45 PM
I'm a LabVIEW guy and don't know any of the C# syntax.
But in terms of NI's DAQmx *terminology*, it sounds like you want to configure your task to use the external signal as a "sample clock" rather than as a "trigger". Many common DAQ devices support this, some of the more specialized ones may not. What DAQ device will you be using?
-Kevin P
04-29-2022 04:06 PM
Hi, Thanks so much for the response! That makes a lot of sense, does it work similar to an internal clock where I set the rate? Like will it automatically know to use the digital triggers to write each individual sample? My DAQ device is the PCIe-6374. Thanks again!
04-29-2022 05:34 PM
I managed to get it working 😄 thanks again!
07-26-2022 03:22 PM
Dear Kevin,
I have a similar question as the thread, which application need to send a AO voltage when receiving a rising TTL signal. through your post I understand I was doing the task in a wrong way (seen the attachment). Would you like to help to give a simple example on "use the external signals as a "sample clock" rather than as a "trigger" ".
Thanks in advance and sorry for such naïve question.
Hei L
07-28-2022 07:23 PM
The main thing I see is that you should write the whole buffer of AO values to your task *before* starting it. That's the normal procedure in a buffered task with a sample clock.
Otherwise, it appears that you *are* using the counter output as your AO sample clock, at least according to your comments about PFI3. I don't know your whole app, but I'd venture that you might not need to configure a trigger for your AO task. You're using the same signal as the sample clock and you're (correctly) starting the AO task before the counter task. That alone will probably do what you need.
-Kevin P